diff --git a/.github/workflows/samples-dotnet8-server.yaml b/.github/workflows/samples-dotnet8-server.yaml new file mode 100644 index 0000000000000..817455aa4d7cf --- /dev/null +++ b/.github/workflows/samples-dotnet8-server.yaml @@ -0,0 +1,36 @@ +name: Samples C# .Net 8 Server + +on: + push: + paths: + - samples/server/petstore/aspnetcore-8.0/** + - samples/server/petstore/aspnetcore-8.0-*/** + pull_request: + paths: + - samples/server/petstore/aspnetcore-8.0/** + - samples/server/petstore/aspnetcore-8.0-*/** +jobs: + build: + name: Build .Net 8 servers + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/server/petstore/aspnetcore-8.0 + - samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse + - samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes + - samples/server/petstore/aspnetcore-8.0-pocoModels + - samples/server/petstore/aspnetcore-8.0-project4Models + - samples/server/petstore/aspnetcore-8.0-useSwashBuckle + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '8.0.x' + - name: Build + working-directory: ${{ matrix.sample }} + run: dotnet build Org.OpenAPITools.sln + - name: Test + working-directory: ${{ matrix.sample }} + run: dotnet test Org.OpenAPITools.sln diff --git a/.github/workflows/samples-java-client-echo-api-jdk17.yaml b/.github/workflows/samples-java-client-echo-api-jdk17.yaml index 670f461952670..ddbbfcd9de6f9 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk17.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk17.yaml @@ -3,10 +3,10 @@ name: Java Client (Echo API) JDK17 on: push: paths: - - samples/client/echo_api/java/restclient + - samples/client/echo_api/java/** pull_request: paths: - - samples/client/echo_api/java/restclient + - samples/client/echo_api/java/** jobs: build: name: Build Java Client JDK17 @@ -16,6 +16,11 @@ jobs: matrix: sample: # clients + - samples/client/echo_api/java/apache-httpclient + - samples/client/echo_api/java/native + - samples/client/echo_api/java/feign-gson + - samples/client/echo_api/java/resttemplate + - samples/client/echo_api/java/resteasy - samples/client/echo_api/java/restclient steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/samples-kotlin-server-jdk17.yaml b/.github/workflows/samples-kotlin-server-jdk17.yaml index e0f850fb0f5c8..6d45bcdf419ef 100644 --- a/.github/workflows/samples-kotlin-server-jdk17.yaml +++ b/.github/workflows/samples-kotlin-server-jdk17.yaml @@ -29,6 +29,7 @@ jobs: sample: # server - samples/server/petstore/kotlin-springboot-3 + - samples/server/petstore/kotlin-springboot-delegate-nodefaults - samples/server/petstore/kotlin-springboot-request - samples/server/petstore/kotlin-springboot-request-cookie - samples/server/petstore/kotlin-server/javalin diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml index b98d4c69532a8..be8be39d2f574 100644 --- a/.github/workflows/samples-kotlin-server.yaml +++ b/.github/workflows/samples-kotlin-server.yaml @@ -29,6 +29,7 @@ jobs: sample: # server - samples/server/petstore/kotlin-springboot + - samples/server/petstore/kotlin-springboot-multipart-request-model - samples/server/petstore/kotlin-springboot-bigdecimal-default - samples/server/petstore/kotlin-springboot-delegate - samples/server/petstore/kotlin-springboot-modelMutable diff --git a/.github/workflows/samples-python-client-echo-api.yaml b/.github/workflows/samples-python-client-echo-api.yaml index 1446a813ba3a8..24c4fd3e9451d 100644 --- a/.github/workflows/samples-python-client-echo-api.yaml +++ b/.github/workflows/samples-python-client-echo-api.yaml @@ -18,11 +18,11 @@ jobs: - samples/client/echo_api/python - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent python-version: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" + - "3.12" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -42,7 +42,7 @@ jobs: - name: Test working-directory: ${{ matrix.sample }} - run: python -m pytest + run: python -m unittest discover - name: mypy working-directory: ${{ matrix.sample }} diff --git a/README.md b/README.md index 61e07db46c633..68195c874354e 100644 --- a/README.md +++ b/README.md @@ -84,13 +84,13 @@ If you find OpenAPI Generator useful for work, please consider asking your compa OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification) (both 2.0 and 3.0 are supported). Currently, the following languages/frameworks are supported: -| | Languages/Frameworks | -| -------------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (9.x - 18.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** | -| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) | -| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | -| **Configuration files** | [**Apache2**](https://httpd.apache.org/) | -| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** | +| | Languages/Frameworks | +| -------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (9.x - 18.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** | +| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) | +| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | +| **Configuration files** | [**Apache2**](https://httpd.apache.org/) | +| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** | ## Table of contents @@ -998,6 +998,7 @@ Here is a list of template creators: * Java (okhttp-gson): @xhh * Java (RestTemplate): @nbruno * Java (Spring 5 WebClient): @daonomic + * Java (Spring 6 RestClient): @nicklas2751 * Java (RESTEasy): @gayathrigs * Java (Vertx): @lopesmcc * Java (Google APIs Client Library): @charlescapps diff --git a/bin/configs/aspnetcore-8.0-NewtonsoftFalse.yaml b/bin/configs/aspnetcore-8.0-NewtonsoftFalse.yaml new file mode 100644 index 0000000000000..24c1a5a92a97d --- /dev/null +++ b/bin/configs/aspnetcore-8.0-NewtonsoftFalse.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + useNewtonsoft: false diff --git a/bin/configs/aspnetcore-8.0-nullableReferenceTypes.yaml b/bin/configs/aspnetcore-8.0-nullableReferenceTypes.yaml new file mode 100644 index 0000000000000..8f346e92d5d29 --- /dev/null +++ b/bin/configs/aspnetcore-8.0-nullableReferenceTypes.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + nullableReferenceTypes: true \ No newline at end of file diff --git a/bin/configs/aspnetcore-8.0-pocoModels.yaml b/bin/configs/aspnetcore-8.0-pocoModels.yaml new file mode 100644 index 0000000000000..799ed7e6296bf --- /dev/null +++ b/bin/configs/aspnetcore-8.0-pocoModels.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-pocoModels +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + pocoModels: true diff --git a/bin/configs/aspnetcore-8.0-project4Models.yaml b/bin/configs/aspnetcore-8.0-project4Models.yaml new file mode 100644 index 0000000000000..e4781826be130 --- /dev/null +++ b/bin/configs/aspnetcore-8.0-project4Models.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-project4Models +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + useSeparateModelProject: true diff --git a/bin/configs/aspnetcore-8.0-useSwashBuckle.yaml b/bin/configs/aspnetcore-8.0-useSwashBuckle.yaml new file mode 100644 index 0000000000000..951da2a219fc6 --- /dev/null +++ b/bin/configs/aspnetcore-8.0-useSwashBuckle.yaml @@ -0,0 +1,11 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-useSwashBuckle +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + useSwashBuckle: false + buildTarget: library + isLibrary: true diff --git a/bin/configs/aspnetcore-8.0.yaml b/bin/configs/aspnetcore-8.0.yaml new file mode 100644 index 0000000000000..205fa554e55e0 --- /dev/null +++ b/bin/configs/aspnetcore-8.0.yaml @@ -0,0 +1,8 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0 +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' diff --git a/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml new file mode 100644 index 0000000000000..bf22ad329a770 --- /dev/null +++ b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml @@ -0,0 +1,14 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot-delegate-nodefaults +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + documentationProvider: none + annotationLibrary: swagger2 + useSwaggerUI: "true" + delegatePattern: "true" + skipDefaultInterface: "true" + beanValidations: "true" + requestMappingMode: "api_interface" + useSpringBoot3: "true" diff --git a/bin/configs/kotlin-spring-boot-delegate.yaml b/bin/configs/kotlin-spring-boot-delegate.yaml index 3e70591b81bf3..38fdee37dc7ea 100644 --- a/bin/configs/kotlin-spring-boot-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-delegate.yaml @@ -8,5 +8,6 @@ additionalProperties: annotationLibrary: swagger2 useSwaggerUI: "true" delegatePattern: "true" + appendRequestToHandler: "true" beanValidations: "true" requestMappingMode: none diff --git a/bin/configs/kotlin-spring-boot-multipart-request-model.yaml b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml new file mode 100644 index 0000000000000..63d0b59fd5bb2 --- /dev/null +++ b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml @@ -0,0 +1,5 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot-multipart-request-model +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring diff --git a/bin/configs/typescript-fetch-oneOf.yaml b/bin/configs/typescript-fetch-oneOf.yaml new file mode 100644 index 0000000000000..a6e57df4cd71e --- /dev/null +++ b/bin/configs/typescript-fetch-oneOf.yaml @@ -0,0 +1,4 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/oneOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-fetch diff --git a/bin/configs/typescript-fetch-self-import-issue.yaml b/bin/configs/typescript-fetch-self-import-issue.yaml new file mode 100644 index 0000000000000..d4312e9329190 --- /dev/null +++ b/bin/configs/typescript-fetch-self-import-issue.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-fetch +outputDir: samples/client/others/typescript-fetch/self-import-issue +inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +additionalProperties: + typescriptThreePlus: "true" + legacyDiscriminatorBehavior: "false" diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 5dbedb169c542..9a028ed2977fb 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -18,7 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|aspnetCoreVersion|ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|
**2.0**
ASP.NET Core 2.0
**2.1**
ASP.NET Core 2.1
**2.2**
ASP.NET Core 2.2
**3.0**
ASP.NET Core 3.0
**3.1**
ASP.NET Core 3.1
**5.0**
ASP.NET Core 5.0
**6.0**
ASP.NET Core 6.0
|3.1| +|aspnetCoreVersion|ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|
**2.0**
ASP.NET Core 2.0
**2.1**
ASP.NET Core 2.1
**2.2**
ASP.NET Core 2.2
**3.0**
ASP.NET Core 3.0
**3.1**
ASP.NET Core 3.1
**5.0**
ASP.NET Core 5.0
**6.0**
ASP.NET Core 6.0
**7.0**
ASP.NET Core 7.0
**8.0**
ASP.NET Core 8.0
|8.0| |buildTarget|Target to build an application or library|
**program**
Generate code for a standalone server
**library**
Generate code for a server abstract class library
|program| |classModifier|Class Modifier for controller classes: Empty string or abstract.| || |compatibilityVersion|ASP.Net Core CompatibilityVersion| |Version_2_2| @@ -45,7 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0|
**3.0.0**
Swashbuckle 3.0.0
**4.0.0**
Swashbuckle 4.0.0
**5.0.0**
Swashbuckle 5.0.0
**6.4.0**
Swashbuckle 6.4.0
|3.0.0| +|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0|
**3.0.0**
Swashbuckle 3.0.0
**4.0.0**
Swashbuckle 4.0.0
**5.0.0**
Swashbuckle 5.0.0
**6.4.0**
Swashbuckle 6.4.0
|6.4.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeForDate|Use DateTime to model date properties even if DateOnly supported. (.net 6.0+ only)| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index f6faec2c83d83..b40ecbbc5f0c5 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -46,7 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |serverPort|configuration the port in which the sever is to run on| |8080| |serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false| |serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false| -|skipDefaultInterface|Whether to skip generation of default implementations for interfaces| |false| +|skipDefaultInterface|Whether to skip generation of default implementations for interfaces (Api interfaces or Delegate interfaces depending on the delegatePattern option)| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |sourceFolder|source folder for generated code| |src/main/kotlin| @@ -57,6 +57,18 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| |useTags|Whether to use tags for creating interface and controller class names| |false| +## SUPPORTED VENDOR EXTENSIONS + +| Extension name | Description | Applicable for | Default value | +| -------------- | ----------- | -------------- | ------------- | +|x-accepts|Specify custom value for 'Accept' header for operation|OPERATION|null +|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null +|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null +|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL| +|x-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null +|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null + + ## IMPORT MAPPING | Type/Alias | Imports | diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java index 9f6506e254f18..5a0f5e5d9afa3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java @@ -186,7 +186,9 @@ public AspNetServerCodegen() { aspnetCoreVersion.addEnum("3.1", "ASP.NET Core 3.1"); aspnetCoreVersion.addEnum("5.0", "ASP.NET Core 5.0"); aspnetCoreVersion.addEnum("6.0", "ASP.NET Core 6.0"); - aspnetCoreVersion.setDefault("3.1"); + aspnetCoreVersion.addEnum("7.0", "ASP.NET Core 7.0"); + aspnetCoreVersion.addEnum("8.0", "ASP.NET Core 8.0"); + aspnetCoreVersion.setDefault("8.0"); aspnetCoreVersion.setOptValue(aspnetCoreVersion.getDefault()); cliOptions.add(aspnetCoreVersion); @@ -194,7 +196,7 @@ public AspNetServerCodegen() { swashbuckleVersion.addEnum("4.0.0", "Swashbuckle 4.0.0"); swashbuckleVersion.addEnum("5.0.0", "Swashbuckle 5.0.0"); swashbuckleVersion.addEnum("6.4.0", "Swashbuckle 6.4.0"); - swashbuckleVersion.setDefault("3.0.0"); + swashbuckleVersion.setDefault("6.4.0"); swashbuckleVersion.setOptValue(swashbuckleVersion.getDefault()); cliOptions.add(swashbuckleVersion); @@ -427,7 +429,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("typeConverter.mustache", packageFolder + File.separator + "Converters", "CustomEnumConverter.cs")); } - if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0") || aspnetCoreVersion.getOptValue().startsWith("6.")) { + if (!aspnetCoreVersion.getOptValue().startsWith("2.")) { supportingFiles.add(new SupportingFile("OpenApi" + File.separator + "TypeExtensions.mustache", packageFolder + File.separator + "OpenApi", "TypeExtensions.cs")); } @@ -681,7 +683,7 @@ private void setBuildTarget() { private void setAspnetCoreVersion(String packageFolder) { setCliOption(aspnetCoreVersion); - if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0") || aspnetCoreVersion.getOptValue().startsWith("6.")) { + if (!aspnetCoreVersion.getOptValue().startsWith("2.")) { compatibilityVersion = null; } else if ("2.0".equals(aspnetCoreVersion.getOptValue())) { compatibilityVersion = null; @@ -698,6 +700,8 @@ private void setAspnetCoreVersion(String packageFolder) { private String determineTemplateVersion(String frameworkVersion) { switch (frameworkVersion) { + case "8.0": + case "7.0": case "6.0": case "5.0": case "3.1": diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index c78355a902c2e..e8f251fd48343 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -32,6 +32,7 @@ import org.openapitools.codegen.CodegenResponse; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.VendorExtension; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; import org.openapitools.codegen.languages.features.SwaggerUIFeatures; @@ -93,6 +94,8 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String SERVICE_INTERFACE = "serviceInterface"; public static final String SERVICE_IMPLEMENTATION = "serviceImplementation"; public static final String SKIP_DEFAULT_INTERFACE = "skipDefaultInterface"; + public static final String SKIP_DEFAULT_API_INTERFACE = "skipDefaultApiInterface"; + public static final String SKIP_DEFAULT_DELEGATE_INTERFACE = "skipDefaultDelegateInterface"; public static final String REACTIVE = "reactive"; public static final String INTERFACE_ONLY = "interfaceOnly"; public static final String USE_FEIGN_CLIENT_URL = "useFeignClientUrl"; @@ -134,6 +137,8 @@ public String getDescription() { private String title = "OpenAPI Kotlin Spring"; private boolean useBeanValidation = true; @Setter private boolean skipDefaultInterface = false; + @Setter private boolean skipDefaultApiInterface = false; + @Setter private boolean skipDefaultDelegateInterface = false; @Setter private boolean exceptionHandler = true; @Setter private boolean gradleBuildFile = true; private boolean useSwaggerUI = true; @@ -221,7 +226,7 @@ public KotlinSpringServerCodegen() { addSwitch(SERVICE_IMPLEMENTATION, "generate stub service implementations that extends service " + "interfaces. If this is set to true service interfaces will also be generated", serviceImplementation); addSwitch(USE_BEANVALIDATION, "Use BeanValidation API annotations to validate data types", useBeanValidation); - addSwitch(SKIP_DEFAULT_INTERFACE, "Whether to skip generation of default implementations for interfaces", skipDefaultInterface); + addSwitch(SKIP_DEFAULT_INTERFACE, "Whether to skip generation of default implementations for interfaces (Api interfaces or Delegate interfaces depending on the delegatePattern option)", skipDefaultInterface); addSwitch(REACTIVE, "use coroutines for reactive behavior", reactive); addSwitch(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.", interfaceOnly); addSwitch(USE_FEIGN_CLIENT_URL, "Whether to generate Feign client with url parameter.", useFeignClientUrl); @@ -561,6 +566,16 @@ public void processOpts() { this.setDelegatePattern(Boolean.parseBoolean(additionalProperties.get(DELEGATE_PATTERN).toString())); } + if (skipDefaultInterface) { + if (delegatePattern) { + this.setSkipDefaultDelegateInterface(true); + } else { + this.setSkipDefaultApiInterface(true); + } + } + writePropertyBack(SKIP_DEFAULT_API_INTERFACE, skipDefaultApiInterface); + writePropertyBack(SKIP_DEFAULT_DELEGATE_INTERFACE, skipDefaultDelegateInterface); + if (additionalProperties.containsKey(USE_TAGS)) { this.setUseTags(Boolean.parseBoolean(additionalProperties.get(USE_TAGS).toString())); } @@ -874,7 +889,7 @@ public void setReturnContainer(final String returnContainer) { final List allParams = operation.allParams; if (allParams != null) { if (this.isAppendRequestToHandler()) { - allParams.add(new RequestCodegenParameter(true)); + allParams.add(new RequestCodegenParameter()); } allParams.forEach(param -> // This is necessary in case 'modelMutable' is enabled, @@ -971,7 +986,16 @@ protected boolean needToImport(String type) { @Data @EqualsAndHashCode(callSuper = true) static class RequestCodegenParameter extends CodegenParameter { - boolean isRequestObject; + + boolean isRequestObject = true; + + public RequestCodegenParameter() { + this.isOptional = false; + this.required = true; + this.paramName = "serverHttpRequest"; + this.dataType = "ServerHttpRequest"; + } + } public RequestMappingMode getRequestMappingMode() { @@ -982,4 +1006,16 @@ public void setRequestMappingMode(RequestMappingMode requestMappingMode) { this.requestMappingMode = requestMappingMode; } + @Override + public List getSupportedVendorExtensions() { + List extensions = super.getSupportedVendorExtensions(); + extensions.add(VendorExtension.X_ACCEPTS); + extensions.add(VendorExtension.X_CLASS_EXTRA_ANNOTATION); + extensions.add(VendorExtension.X_CONTENT_TYPE); + extensions.add(VendorExtension.X_DISCRIMINATOR_VALUE); + extensions.add(VendorExtension.X_FIELD_EXTRA_ANNOTATION); + extensions.add(VendorExtension.X_PATTERN_MESSAGE); + return extensions; + } + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 73ce991ffaf2b..dcbf5db9cf162 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -41,6 +41,7 @@ import java.util.*; import java.util.stream.Collectors; +import static java.util.Objects.nonNull; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; @@ -387,8 +388,32 @@ public Map postProcessAllModels(Map objs) for (ModelsMap entry : result.values()) { for (ModelMap model : entry.getModels()) { ExtendedCodegenModel codegenModel = (ExtendedCodegenModel) model.getModel(); - model.put("hasImports", codegenModel.imports.size() > 0); + boolean importsPresent = !codegenModel.imports.isEmpty(); + + // When legacyDiscriminatorBehaviour = false, DefaultCodegen will add the mapped models of the + // discriminator to codegenModel.imports, causing us to duplicate the import if we don't remove them + CodegenDiscriminator discriminator = codegenModel.discriminator; + boolean mappedDiscriminatorModelsPresent = nonNull(discriminator) + && nonNull(discriminator.getMappedModels()); + if (importsPresent && mappedDiscriminatorModelsPresent) { + Set mappedDiscriminatorModelNames = discriminator.getMappedModels() + .stream() + .map(CodegenDiscriminator.MappedModel::getModelName) + .collect(Collectors.toSet()); + Set filteredImports = codegenModel.imports + .stream() + .filter(modelImport -> + !mappedDiscriminatorModelNames.contains(modelImport)) + .collect(Collectors.toSet()); + + codegenModel.imports.clear(); + codegenModel.imports.addAll(filteredImports); + } + + model.put("hasImports", importsPresent); model.put("tsImports", toTsImports(codegenModel, parseImports(codegenModel))); + + allModels.add(codegenModel); if (codegenModel.isEntity) { entityModelClassnames.add(codegenModel.classname); diff --git a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache index acdaef19aecaf..60d2d5ceeb5fc 100644 --- a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache @@ -2,8 +2,8 @@ package {{invokerPackage}}; import java.util.Set; -import {{javaxPackage}}.validation.ConstraintViolation; -import {{javaxPackage}}.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 10a66d7538b2b..c72fc521b76d9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -278,7 +278,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field httpClient.

* * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -298,7 +298,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -321,7 +321,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -342,7 +342,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -363,7 +363,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -410,7 +410,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -426,7 +426,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -442,7 +442,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -458,7 +458,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -480,7 +480,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -496,7 +496,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -513,7 +513,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -530,7 +530,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -546,7 +546,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -563,7 +563,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -579,7 +579,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -595,7 +595,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -612,7 +612,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -634,7 +634,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -646,7 +646,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -666,7 +666,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -688,7 +688,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -712,7 +712,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -734,7 +734,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -757,7 +757,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -778,7 +778,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 8549641079c8e..ada640379e31f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -30,10 +30,10 @@ import jakarta.validation.constraints.*; import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} -import {{javaxPackage}}.validation.ConstraintViolation; -import {{javaxPackage}}.validation.Validation; -import {{javaxPackage}}.validation.ValidatorFactory; -import {{javaxPackage}}.validation.executable.ExecutableValidator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; +import jakarta.validation.executable.ExecutableValidator; import java.util.Set; import java.lang.reflect.Method; import java.lang.reflect.Type; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache index d63c511a90c7a..d7d9dae2bffbb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache @@ -8,9 +8,9 @@ import {{invokerPackage}}.ApiClient; import {{apiPackage}}.{{classname}}; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -31,12 +31,12 @@ import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jacks /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 0bcd38064664f..3ddee45351914 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -104,14 +104,13 @@ ext { swagger_annotations_version = "2.2.15" {{/swagger2AnnotationLibrary}} rest_assured_version = "5.3.2" - junit_version = "4.13.2" + junit_version = "5.10.3" {{#jackson}} jackson_version = "2.17.1" jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" {{/jackson}} {{#gson}} gson_version = "2.10.1" @@ -121,6 +120,7 @@ ext { jodatime_version = "2.10.5" {{/joda}} okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { @@ -163,5 +163,5 @@ dependencies { implementation "org.hibernate:hibernate-validator:6.0.19.Final" {{/performBeanValidation}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 3476f0659da8e..ce4037ac50165 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -43,7 +43,7 @@ lazy val root = (project in file(".")). "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", {{/performBeanValidation}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index 3523ed4fc8d99..396dd69c20bbd 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -331,8 +331,8 @@ {{/performBeanValidation}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -366,6 +366,6 @@ 3.0.2 {{/useBeanValidation}} 3.6.0 - 4.13.2 + 5.10.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache index d6e0baeaee0e5..416e5ea895a55 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache @@ -1,5 +1,9 @@ package {{invokerPackage}}; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +{{/withXml}} import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; @@ -12,8 +16,8 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; - import org.springframework.http.converter.HttpMessageConverter; - import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; {{#withXml}} import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; {{/withXml}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache index 247b48b0e1921..ec6244a82dcf4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache @@ -23,12 +23,7 @@ Building the API client library requires: 1. Java 17+ -{{#jersey2}} -2. Maven (3.8.3+)/Gradle (7.2+) -{{/jersey2}} -{{^jersey2}} 2. Maven/Gradle -{{/jersey2}} ## Installation @@ -87,33 +82,6 @@ Then manually install the following JARs: - `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` - `target/lib/*.jar` -{{#jersey2}} -## Usage - -To add a HTTP proxy for the API client, use `ClientConfig`: -```java -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; -import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.client.ClientProperties; -import {{{invokerPackage}}}.*; -import {{{package}}}.{{{classname}}}; - -... - -ApiClient defaultClient = Configuration.getDefaultApiClient(); -ClientConfig clientConfig = defaultClient.getClientConfig(); -clientConfig.connectorProvider(new ApacheConnectorProvider()); -clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); -clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); -clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); -defaultClient.setClientConfig(clientConfig); - -{{{classname}}} apiInstance = new {{{classname}}}(defaultClient); -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -``` - -{{/jersey2}} ## Getting Started Please follow the [installation](#installation) instruction and execute the following Java code: @@ -128,7 +96,7 @@ import {{{package}}}.{{{classname}}}; public class {{{classname}}}Example { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("{{{basePath}}}"); {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -173,10 +141,10 @@ public class {{{classname}}}Example { try { {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} - } catch (ApiException e) { + } catch (HttpStatusCodeException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache index 9227bbb78b065..dab62f328cb0f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache @@ -3,8 +3,9 @@ package {{package}}; import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -25,7 +26,7 @@ public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService({{classname}}.class); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index fdd5705c57b5c..96a0a66ca1e0c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -112,7 +112,7 @@ ext { {{/usePlayWS}} jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" {{#useRxJava2}} rx_java_version = "2.1.1" {{/useRxJava2}} @@ -162,5 +162,5 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/jackson}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index 5de5032a93004..7e7f69093ba22 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -37,7 +37,7 @@ lazy val root = (project in file(".")). {{/joda}} "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 8336f99ffdb05..a365e18f29ae0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -367,8 +367,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -413,6 +413,6 @@ 3.0.2 {{/useBeanValidation}} 1.0.1 - 4.13.2 + 5.10.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache index df1c211856e8c..1469d11fb761b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache @@ -6,11 +6,10 @@ package {{package}}; import {{invokerPackage}}.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,24 +30,18 @@ import java.util.Map; /** * API tests for {{classname}} */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new {{classname}}Impl(); } - {{#operations}}{{#operation}} + + {{#operations}} + {{#operation}} /** * {{summary}} * {{notes}} @@ -66,5 +59,6 @@ public class {{classname}}Test { async.complete(); }); } - {{/operation}}{{/operations}} + {{/operation}} + {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index 353a8a46eac8c..0e8fd590ce585 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -33,7 +33,7 @@ ext { jackson_version = "2.17.1" jackson_databind_version = "2.17.1" vertx_version = "3.5.2" - junit_version = "4.13.2" + junit_version = "5.10.3" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} @@ -56,6 +56,6 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index fc22b0a4399b3..b9b44cd85dfca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -284,8 +284,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -315,6 +315,6 @@ {{^useJakartaEe}} 1.3.5 {{/useJakartaEe}} - 4.13.2 + 5.10.3 diff --git a/modules/openapi-generator/src/main/resources/Java/model.mustache b/modules/openapi-generator/src/main/resources/Java/model.mustache index 55e6678d2f05a..b504167937214 100644 --- a/modules/openapi-generator/src/main/resources/Java/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/model.mustache @@ -49,8 +49,8 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache index f4006312fa691..4900c6d27ded9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache @@ -224,7 +224,7 @@ for this project used jakarta.validation-api --> {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} - 3.3.0 + 3.5.9 2.17.1 UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache index 17e831cefbfa6..dc1d394348d75 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache @@ -344,7 +344,7 @@ for this project used jakarta.validation-api --> 4.13.2 1.2.12 {{/generateSpringBootApplication}} - 3.3.0 + 3.5.9 2.17.1 UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache index e508af02b98e3..cbee869609067 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -245,14 +245,14 @@ for this project used jakarta.validation-api --> {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} - 3.3.0 + 3.5.9 2.17.1 - {{#useJakartaEe}} - 2.1.1 - {{/useJakartaEe}} - {{^useJakartaEe}} - 1.3.5 - {{/useJakartaEe}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} + 1.3.5 + {{/useJakartaEe}} UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index ad1fbf8c03a7f..961cd74d1579e 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -302,14 +302,14 @@ for this project used jakarta.validation-api --> {{#generateSpringBootApplication}} 1.5.9.RELEASE {{/generateSpringBootApplication}} - 3.3.0 + 3.5.9 2.17.1 - {{#useJakartaEe}} - 2.1.1 - {{/useJakartaEe}} - {{^useJakartaEe}} - 1.3.5 - {{/useJakartaEe}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} + 1.3.5 + {{/useJakartaEe}} UTF-8 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache index 1b328da49ea0d..1609fa8656e43 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache @@ -9,7 +9,7 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} - @field:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} {{#kotlinx_serialization}} {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache index 4a31e0d01edf8..3c9387d10151f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache @@ -9,7 +9,7 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} - @field:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} {{#kotlinx_serialization}} {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache index 5d47b0460358f..4d1af3ad52c28 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache @@ -13,13 +13,20 @@ import java.util.Optional {{/useRequestMappingOnController}} {{#operations}} class {{classname}}Controller( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: {{classname}}Delegate? + {{#skipDefaultDelegateInterface}} + private val delegate: {{classname}}Delegate + {{/skipDefaultDelegateInterface}} + {{^skipDefaultDelegateInterface}} + delegate: {{classname}}Delegate? + {{/skipDefaultDelegateInterface}} ) : {{classname}} { +{{^skipDefaultDelegateInterface}} private lateinit var delegate: {{classname}}Delegate init { this.delegate = Optional.ofNullable(delegate).orElse(object : {{classname}}Delegate {}) } +{{/skipDefaultDelegateInterface}} override fun getDelegate(): {{classname}}Delegate = delegate } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache index b1203ff381b4b..47bd58a48188a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache @@ -7,6 +7,9 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +{{#appendRequestToHandler}} +import org.springframework.http.server.reactive.ServerHttpRequest +{{/appendRequestToHandler}} {{#reactive}} import kotlinx.coroutines.flow.Flow {{/reactive}} @@ -31,9 +34,9 @@ interface {{classname}}Delegate { * @see {{classname}}#{{operationId}} */ {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^isFile}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{^-last}}, - {{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} { + {{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} { {{>methodBody}} - } + }{{/skipDefaultDelegateInterface}} {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index a6dd387803ab7..6f92da7db7f48 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -71,7 +71,7 @@ import kotlin.collections.Map interface {{classname}} { {{#isDelegate}} - fun getDelegate(): {{classname}}Delegate = object: {{classname}}Delegate {} + fun getDelegate(): {{classname}}Delegate{{^skipDefaultDelegateInterface}} = object: {{classname}}Delegate {}{{/skipDefaultDelegateInterface}} {{/isDelegate}} {{#operation}} @@ -103,14 +103,14 @@ interface {{classname}} { produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, consumes = [{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}]{{/hasConsumes}}{{/singleContentTypes}} ) - {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{>requesObject}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultInterface}} { + {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{>requesObject}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultApiInterface}} { {{^isDelegate}} return {{>returnValue}} {{/isDelegate}} {{#isDelegate}} return getDelegate().{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{/isDelegate}} - }{{/skipDefaultInterface}} + }{{/skipDefaultApiInterface}} {{/operation}} } {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache index 996353148d6c7..583ee37f90e06 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache @@ -4,7 +4,7 @@ format: email @get:Email{{/isEmail}}{{! pattern set }}{{#pattern}} - @get:Pattern(regexp="{{{.}}}"){{/pattern}}{{! + @get:Pattern(regexp="{{{pattern}}}"{{#vendorExtensions.x-pattern-message}}, message="{{vendorExtensions.x-pattern-message}}"{{/vendorExtensions.x-pattern-message}}){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @get:Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache index ad632087709d6..9b58b57a41bb1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache @@ -8,6 +8,9 @@ {{#additionalModelTypeAnnotations}} {{{.}}} {{/additionalModelTypeAnnotations}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{.}}} +{{/vendorExtensions.x-class-extra-annotation}} {{#discriminator}}interface {{classname}}{{/discriminator}}{{^discriminator}}{{#hasVars}}data {{/hasVars}}class {{classname}}( {{#requiredVars}} {{>dataClassReqVar}}{{^-last}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index 7232af07e2915..ab575d4bf9d34 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -1,5 +1,6 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#deprecated}} - @Deprecated(message = ""){{/deprecated}} + @Deprecated(message = ""){{/deprecated}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} @get:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 80b7ea4c7e189..92e2875ac08ab 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,4 +1,5 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} - @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache index 6d725334a1656..3d1a5787e382c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}@RequestParam{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache index 660726f0c518b..f8d228d171018 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache @@ -1,4 +1,5 @@ {{#swagger2AnnotationLibrary}} @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} - @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} + @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache index 0f46b49c2b60d..710ae9c450cad 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache @@ -1,4 +1,5 @@ {{#swagger2AnnotationLibrary}} @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} - @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} + @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache index 31766db08e7cb..6720e351fb748 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache @@ -39,7 +39,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected ?array $responseHeaders; @@ -55,10 +55,10 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as stdClass or string + * @param string[][]|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string */ - public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], mixed $responseBody = null) + public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -68,7 +68,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders(): ?array { diff --git a/modules/openapi-generator/src/main/resources/php/ApiException.mustache b/modules/openapi-generator/src/main/resources/php/ApiException.mustache index e9d6544b21c15..c5c3995dd5408 100644 --- a/modules/openapi-generator/src/main/resources/php/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/php/ApiException.mustache @@ -40,7 +40,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -56,7 +56,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) @@ -69,7 +69,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache index 5a96f2f6f5ab8..83aaec422dd41 100644 --- a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache @@ -44,7 +44,7 @@ class ApiException extends RequestException /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -72,7 +72,7 @@ class ApiException extends RequestException /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache index 400685f0abcb8..48bbdc26783ee 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache @@ -14,6 +14,7 @@ from fastapi import ( # noqa: F401 Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -65,7 +66,9 @@ async def {{operationId}}( {{/hasAuthMethods}} ) -> {{returnType}}{{^returnType}}None{{/returnType}}: {{#notes}}"""{{.}}""" - return Base{{classname}}.subclasses[0]().{{operationId}}({{#allParams}}{{>impl_argument}}{{^-last}}, {{/-last}}{{/allParams}}){{/notes}}{{^notes}}...{{/notes}} + {{/notes}}if not Base{{classname}}.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await Base{{classname}}.subclasses[0]().{{operationId}}({{#allParams}}{{>impl_argument}}{{^-last}}, {{/-last}}{{/allParams}}) {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache index 2e80168a328c2..d1d95c12eff8b 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache @@ -15,7 +15,7 @@ class Base{{classname}}: Base{{classname}}.subclasses = Base{{classname}}.subclasses + (cls,) {{#operations}} {{#operation}} - def {{operationId}}( + async def {{operationId}}( self, {{#allParams}} {{>impl_argument_definition}}, diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index c7d4a6d700f6f..aad33bcc06cbb 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -5,6 +5,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -59,6 +60,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -346,6 +348,7 @@ class ApiClient: If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -371,6 +374,8 @@ class ApiClient: ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -462,6 +467,8 @@ class ApiClient: return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache index 0e65dec85ea95..9a9f56b5f3d8e 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache @@ -36,6 +36,8 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole return {{{.}}}FromJSONTyped(json, true); } {{/oneOf}} + + return {} as any; {{/discriminator}} } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index f335afb56635a..a16014271aa59 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -2955,4 +2955,26 @@ public void shouldGenerateOAuthTokenSuppliers() { } + @Test public void testRestClientWithXML_issue_19137() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(Map.of( + CodegenConstants.API_PACKAGE, "xyz.abcdef.api", + CodegenConstants.WITH_XML, true + )) + .setInputSpec("src/test/resources/3_1/java/petstore.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + TestUtils.assertFileContains( + output.resolve("src/main/java/xyz/abcdef/ApiClient.java"), + "import com.fasterxml.jackson.dataformat.xml.XmlMapper;", + "import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;" + ); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFastapiCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFastapiCodegenTest.java new file mode 100644 index 0000000000000..458c9415ebee6 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFastapiCodegenTest.java @@ -0,0 +1,56 @@ +package org.openapitools.codegen.python; + +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.Test; +import org.openapitools.codegen.CodegenConstants; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +public class PythonFastapiCodegenTest { + @Test + public void testAdditionalPropertiesPutForConfigValues() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final String IMPL_PKG = "impl_package"; + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("python-fastapi") + .setPackageName("nodesc") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")) + .setInputSpec("src/test/resources/3_1/nodesc.yaml") + .addAdditionalProperty(CodegenConstants.FASTAPI_IMPLEMENTATION_PACKAGE, IMPL_PKG); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileExists(Paths.get(output.getAbsolutePath(), "/src", IMPL_PKG, "__init__.py")); + } + + @Test + public void testEndpointSpecsWithoutDescription() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("python-fastapi") + .setPackageName("nodesc") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")) + .setInputSpec("src/test/resources/3_1/nodesc.yaml"); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileContains(Paths.get(output + "/src/nodesc/apis/nodesc_api.py"), + "return await BaseNodescApi.subclasses[0]().nodesc()\n"); + TestUtils.assertFileContains(Paths.get(output + "/src/nodesc/apis/desc_api.py"), + "return await BaseDescApi.subclasses[0]().desc()\n"); + } +} diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml new file mode 100644 index 0000000000000..5a95b54371826 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml @@ -0,0 +1,45 @@ +openapi: '3.0.1' +info: + version: 1.0.0 + title: MultipartFile test +paths: + /multipart-mixed: + post: + tags: + - multipart + description: Mixed MultipartFile test + operationId: multipartMixed + requestBody: + content: + multipart/form-data: + schema: + type: object + required: + - status + - file + properties: + status: + $ref: '#/components/schemas/MultipartMixedStatus' + marker: + description: "additional object" + type: object + properties: + name: + type: string + file: + description: "a file" + type: string + format: binary + responses: + '204': + description: Successful operation +components: + schemas: + MultipartMixedStatus: + description: "additional field as Enum" + type: string + enum: + - ALLOWED + - IN_PROGRESS + - REJECTED + example: REJECTED \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml new file mode 100644 index 0000000000000..244139a28d36e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml @@ -0,0 +1,37 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: testing oneOf without discriminator +servers: + - url: http://localhost:3000 +paths: + /test: + get: + operationId: test + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TestResponse' +components: + schemas: + TestResponse: + oneOf: + - $ref: "#/components/schemas/TestA" + - $ref: "#/components/schemas/TestB" + TestA: + type: object + properties: + foo: + type: string + required: + - foo + TestB: + type: object + properties: + bar: + type: string + required: + - bar diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml new file mode 100644 index 0000000000000..0a2116cc581ba --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml @@ -0,0 +1,34 @@ +openapi: "3.0.1" +info: + title: Example + version: "1" +paths: {} +components: + schemas: + BranchDto: + type: object + properties: + name: + type: string + AbstractUserDto: + type: object + properties: + username: + type: string + branch: + "$ref": "#/components/schemas/BranchDto" + type: + type: string + discriminator: + propertyName: type + mapping: + internal-authenticated: "#/components/schemas/InternalAuthenticatedUserDto" + remote-authenticated: "#/components/schemas/RemoteAuthenticatedUserDto" + InternalAuthenticatedUserDto: + type: object + allOf: + - "$ref": "#/components/schemas/AbstractUserDto" + RemoteAuthenticatedUserDto: + type: object + allOf: + - "$ref": "#/components/schemas/AbstractUserDto" diff --git a/modules/openapi-generator/src/test/resources/3_1/nodesc.yaml b/modules/openapi-generator/src/test/resources/3_1/nodesc.yaml new file mode 100644 index 0000000000000..8aea06fd71266 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_1/nodesc.yaml @@ -0,0 +1,35 @@ +openapi: 3.1.0 +info: + description: >- + Yet another example. + version: 1.0.0 + title: OpenAPI example +tags: + - name: nodesc + description: Endpoints have no description + - name: desc + description: Endpoints have description +paths: + /nodesc: + post: + tags: + - nodesc + summary: dummy operation + operationId: nodesc + responses: + '200': + description: successful operation + '405': + description: Invalid input + /desc: + post: + tags: + - desc + summary: dummy operation + description: 'Description' + operationId: desc + responses: + '200': + description: successful operation + '405': + description: Invalid input diff --git a/samples/client/echo_api/java/restclient/README.md b/samples/client/echo_api/java/restclient/README.md index 5797ed235f299..dbfceaf19e8b5 100644 --- a/samples/client/echo_api/java/restclient/README.md +++ b/samples/client/echo_api/java/restclient/README.md @@ -89,7 +89,7 @@ import org.openapitools.client.api.AuthApi; public class AuthApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://localhost:3000"); // Configure HTTP basic authorization: http_auth @@ -101,10 +101,10 @@ public class AuthApiExample { try { String result = apiInstance.testAuthHttpBasic(); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException e) { System.err.println("Exception when calling AuthApi#testAuthHttpBasic"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java index f65f1252309d2..13ab8c39940f1 100644 --- a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java @@ -10,8 +10,8 @@ import org.springframework.http.HttpMethod; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; - import org.springframework.http.converter.HttpMessageConverter; - import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java index 61840f4251bfd..42145cd9d3b2e 100644 --- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java @@ -15,17 +15,22 @@ import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.GifHttpMessageConverter; import org.openapitools.client.OctetStreamHttpMessageConverter; +import org.openapitools.client.model.Category; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.Pet.StatusEnum; import org.openapitools.client.model.StringEnumRef; import org.openapitools.client.model.Tag; @@ -117,11 +122,18 @@ public void testBodyMultipartFormdataArrayOfBinaryTest() throws IOException { *

Test single binary in multipart mime */ @Test - public void testBodyMultipartFormdataSingleBinaryTest() { - File myFile = null; - String response = api.testBodyMultipartFormdataSingleBinary(myFile); + public void testBodyMultipartFormdataSingleBinaryTest() throws IOException { + // given + var testFile = Files.createTempFile("test", ".txt"); + String testFileContent = "Lorem ipsum dolor sit amet"; + Files.writeString(testFile, testFileContent); + + // when + String response = api.testBodyMultipartFormdataSingleBinary(testFile.toFile()); - // TODO: test validations + // then + assertThat(response, containsString("Content-Type: multipart/form-data")); + assertThat(response, containsString(testFileContent)); } /** @@ -131,10 +143,26 @@ public void testBodyMultipartFormdataSingleBinaryTest() { */ @Test public void testEchoBodyAllOfPetTest() { - Pet pet = null; + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "192"); + + Pet pet = + new Pet() + .id(42L) + .name("Corgi") + .category(new Category().id(1L).name("Dogs")) + .status(StatusEnum.SOLD) + .addPhotoUrlsItem( + "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg") + .addTagsItem(new Tag().id(1L).name("cute")); + + // when Pet response = api.testEchoBodyAllOfPet(pet); - // TODO: test validations + // then + assertThat(response, is(pet)); } /** @@ -144,10 +172,22 @@ public void testEchoBodyAllOfPetTest() { */ @Test public void testEchoBodyFreeFormObjectResponseStringTest() { - Object body = null; - String response = api.testEchoBodyFreeFormObjectResponseString(body); + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "51"); - // TODO: test validations + Object mapAsObject = + new HashMap<>( + Map.of( + "firstKey", "firstValue", + "secondKey", "secondValue")); + + // when + String response = api.testEchoBodyFreeFormObjectResponseString(mapAsObject); + + // then + assertThat(response, is("{\"firstKey\":\"firstValue\",\"secondKey\":\"secondValue\"}")); } /** @@ -157,10 +197,26 @@ public void testEchoBodyFreeFormObjectResponseStringTest() { */ @Test public void testEchoBodyPetTest() { - Pet pet = null; + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "192"); + + Pet pet = + new Pet() + .id(42L) + .name("Corgi") + .category(new Category().id(1L).name("Dogs")) + .status(StatusEnum.SOLD) + .addPhotoUrlsItem( + "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg") + .addTagsItem(new Tag().id(1L).name("cute")); + + // when Pet response = api.testEchoBodyPet(pet); - // TODO: test validations + // then + assertThat(response, is(pet)); } /** @@ -170,10 +226,29 @@ public void testEchoBodyPetTest() { */ @Test public void testEchoBodyPetResponseStringTest() { - Pet pet = null; + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "192"); + + Pet pet = + new Pet() + .id(42L) + .name("Corgi") + .category(new Category().id(1L).name("Dogs")) + .status(StatusEnum.SOLD) + .addPhotoUrlsItem( + "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg") + .addTagsItem(new Tag().id(1L).name("cute")); + + // when String response = api.testEchoBodyPetResponseString(pet); - // TODO: test validations + // then + assertThat( + response, + is( + "{\"id\":42,\"name\":\"Corgi\",\"category\":{\"id\":1,\"name\":\"Dogs\"},\"photoUrls\":[\"https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg\"],\"tags\":[{\"id\":1,\"name\":\"cute\"}],\"status\":\"sold\"}")); } /** @@ -183,10 +258,14 @@ public void testEchoBodyPetResponseStringTest() { */ @Test public void testEchoBodyStringEnumTest() { - String body = null; + // given + String body = "\"failure\""; + + // when StringEnumRef response = api.testEchoBodyStringEnum(body); - // TODO: test validations + // then + assertThat(response, is(StringEnumRef.FAILURE)); } /** @@ -196,9 +275,13 @@ public void testEchoBodyStringEnumTest() { */ @Test public void testEchoBodyTagResponseStringTest() { + // given Tag tag = null; + + // when String response = api.testEchoBodyTagResponseString(tag); - // TODO: test validations + // then + assertThat(response, nullValue()); } } diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/FormApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/FormApiTest.java index 2db712c5dd784..140bca8e3deaa 100644 --- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/FormApiTest.java +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/FormApiTest.java @@ -10,72 +10,154 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.TestFormObjectMultipartRequestMarker; -import org.junit.Test; -import org.junit.Ignore; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; +import org.junit.Test; +import org.openapitools.client.model.TestFormObjectMultipartRequestMarker; -/** - * API tests for FormApi - */ -@Ignore +/** API tests for FormApi */ public class FormApiTest { - private final FormApi api = new FormApi(); - - - /** - * Test form parameter(s) - * - * Test form parameter(s) - */ - @Test - public void testFormIntegerBooleanStringTest() { - Integer integerForm = null; - Boolean booleanForm = null; - String stringForm = null; - String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm); - - // TODO: test validations - } - - /** - * Test form parameter(s) for multipart schema - * - * Test form parameter(s) for multipart schema - */ - @Test - public void testFormObjectMultipartTest() { - TestFormObjectMultipartRequestMarker marker = null; - String response = api.testFormObjectMultipart(marker); - - // TODO: test validations - } - - /** - * Test form parameter(s) for oneOf schema - * - * Test form parameter(s) for oneOf schema - */ - @Test - public void testFormOneofTest() { - String form1 = null; - Integer form2 = null; - String form3 = null; - Boolean form4 = null; - Long id = null; - String name = null; - String response = api.testFormOneof(form1, form2, form3, form4, id, name); - - // TODO: test validations - } - -} \ No newline at end of file + private final FormApi api = new FormApi(); + + /** + * Test form parameter(s) + * + *

Test form parameter(s) + */ + @Test + public void testFormIntegerBooleanStringTest() { + // Given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "53"); + + Integer integerForm = 42; + Boolean booleanForm = true; + String stringForm = "Test123"; + + // When + String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm); + + // Then + assertThat(response, containsString("integer_form=42&boolean_form=true&string_form=Test123")); + } + + /** + * Test form parameter(s) for multipart schema + * + *

Test form parameter(s) for multipart schema + */ + @Test + public void testFormObjectMultipartTest() { + // Given + TestFormObjectMultipartRequestMarker marker = + new TestFormObjectMultipartRequestMarker().name("Test Marker"); + + // When + String response = api.testFormObjectMultipart(marker); + + // Then + assertThat(response, containsString("{\"name\":\"Test Marker\"}")); + } + + /** + * Test form parameter(s) for oneOf schema with only the first parameters filled + * + *

Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_first() { + // Given + String form1 = "test12"; + Integer form2 = 12; + + String form3 = null; + Boolean form4 = null; + + Long id = null; + String name = null; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat(response, containsString("form1=test12&form2=12")); + } + + /** + * Test form parameter(s) for oneOf schema with only the second parameters filled + * + *

Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_second() { + // Given + String form1 = null; + Integer form2 = null; + + String form3 = "34test"; + Boolean form4 = false; + + Long id = null; + String name = null; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat(response, containsString("form3=34test&form4=false")); + } + + /** + * Test form parameter(s) for oneOf schema with only the third parameters filled + * + *

Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_third() { + // Given + String form1 = null; + Integer form2 = null; + + String form3 = null; + Boolean form4 = null; + + Long id = 21L; + String name = "Hans"; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat(response, containsString("id=21&name=Hans")); + } + + /** + * Test form parameter(s) for oneOf schema with all parameters filled + * + *

Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_all() { + // Given + String form1 = "test12"; + Integer form2 = 12; + + String form3 = "34test"; + Boolean form4 = false; + + Long id = 21L; + String name = "Hans"; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat( + response, containsString("form1=test12&form2=12&form3=34test&form4=false&id=21&name=Hans")); + } +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java index bc92762bfc85f..c0230e6b003df 100644 --- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java @@ -10,43 +10,51 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; +import org.junit.Test; +import org.openapitools.client.model.StringEnumRef; -/** - * API tests for HeaderApi - */ -@Ignore +/** API tests for HeaderApi */ public class HeaderApiTest { - private final HeaderApi api = new HeaderApi(); - - - /** - * Test header parameter(s) - * - * Test header parameter(s) - */ - @Test - public void testHeaderIntegerBooleanStringEnumsTest() { - Integer integerHeader = null; - Boolean booleanHeader = null; - String stringHeader = null; - String enumNonrefStringHeader = null; - StringEnumRef enumRefStringHeader = null; - String response = api.testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader); - - // TODO: test validations - } - -} \ No newline at end of file + private final HeaderApi api = new HeaderApi(); + + /** + * Test header parameter(s) + * + *

Test header parameter(s) + */ + @Test + public void testHeaderIntegerBooleanStringEnumsTest() { + // Given + Integer integerHeader = 11; + Boolean booleanHeader = true; + String stringHeader = "simple String Header"; + String enumNonrefStringHeader = "false"; + StringEnumRef enumRefStringHeader = StringEnumRef.UNCLASSIFIED; + + // When + String response = + api.testHeaderIntegerBooleanStringEnums( + integerHeader, + booleanHeader, + stringHeader, + enumNonrefStringHeader, + enumRefStringHeader); + + // Then + assertThat( + response, + allOf( + containsString("integer_header: 11"), + containsString("boolean_header: true"), + containsString("string_header: simple String Header"), + containsString("enum_nonref_string_header: false"), + containsString("enum_ref_string_header: unclassified"))); + } +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java index dfb396727f46a..d9381c9c2f3e2 100644 --- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java @@ -10,42 +10,40 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; +import org.junit.Test; +import org.openapitools.client.model.StringEnumRef; -/** - * API tests for PathApi - */ -@Ignore +/** API tests for PathApi */ public class PathApiTest { - private final PathApi api = new PathApi(); - - - /** - * Test path parameter(s) - * - * Test path parameter(s) - */ - @Test - public void testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathTest() { - String pathString = null; - Integer pathInteger = null; - String enumNonrefStringPath = null; - StringEnumRef enumRefStringPath = null; - String response = api.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath); - - // TODO: test validations - } - -} \ No newline at end of file + private final PathApi api = new PathApi(); + + /** + * Test path parameter(s) + * + *

Test path parameter(s) + */ + @Test + public void + testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathTest() { + // Given + String pathString = "simple String Path"; + Integer pathInteger = 50; + String enumNonrefStringPath = "true"; + StringEnumRef enumRefStringPath = StringEnumRef.SUCCESS; + + // When + String response = + api.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath( + pathString, pathInteger, enumNonrefStringPath, enumRefStringPath); + + // Then + assertThat( + response, containsString("/path/string/simple%20String%20Path/integer/50/true/success")); + } +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java index 72e47f93f69fb..827ef91367e09 100644 --- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java @@ -10,167 +10,206 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.DataQuery; -import java.time.LocalDate; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + import java.time.Instant; +import java.time.LocalDate; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.openapitools.client.model.DataQuery; import org.openapitools.client.model.Pet; import org.openapitools.client.model.StringEnumRef; import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter; import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * API tests for QueryApi - */ -@Ignore +/** API tests for QueryApi */ public class QueryApiTest { - private final QueryApi api = new QueryApi(); - - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testEnumRefStringTest() { - String enumNonrefStringQuery = null; - StringEnumRef enumRefStringQuery = null; - String response = api.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryDatetimeDateStringTest() { - Instant datetimeQuery = null; - LocalDate dateQuery = null; - String stringQuery = null; - String response = api.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryIntegerBooleanStringTest() { - Integer integerQuery = null; - Boolean booleanQuery = null; - String stringQuery = null; - String response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleDeepObjectExplodeTrueObjectTest() { - Pet queryObject = null; - String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleDeepObjectExplodeTrueObjectAllOfTest() { - TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = null; - String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeFalseArrayIntegerTest() { - List queryObject = null; - String response = api.testQueryStyleFormExplodeFalseArrayInteger(queryObject); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeFalseArrayStringTest() { - List queryObject = null; - String response = api.testQueryStyleFormExplodeFalseArrayString(queryObject); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeTrueArrayStringTest() { - TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = null; - String response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeTrueObjectTest() { - Pet queryObject = null; - String response = api.testQueryStyleFormExplodeTrueObject(queryObject); - - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeTrueObjectAllOfTest() { - DataQuery queryObject = null; - String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject); - - // TODO: test validations - } - -} \ No newline at end of file + private final QueryApi api = new QueryApi(); + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + public void testEnumRefStringTest() { + // Given + String enumNonrefStringQuery = "false"; + StringEnumRef enumRefStringQuery = StringEnumRef.SUCCESS; + + // When + String response = api.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery); + + // Then + assertThat( + response, containsString("?enum_nonref_string_query=false&enum_ref_string_query=success")); + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + public void testQueryDatetimeDateStringTest() { + // Given + Instant datetimeQuery = Instant.ofEpochMilli(1720361075); + LocalDate dateQuery = LocalDate.of(2024, 7, 7); + String stringQuery = "2024-07-07T16:05:59Z"; + + // When + String response = api.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery); + + // Then + assertThat( + response, + containsString( + "?datetime_query=1970-01-20T21%3A52%3A41.075Z&date_query=2024-07-07&string_query=2024-07-07T16%3A05%3A59Z")); + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + public void testQueryIntegerBooleanStringTest() { + // Given + Integer integerQuery = 42; + Boolean booleanQuery = false; + String stringQuery = "Hello World!"; + + // When + String response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); + + // Then + assertThat( + response, + containsString("?integer_query=42&boolean_query=false&string_query=Hello%20World%21")); + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleDeepObjectExplodeTrueObjectTest() { + Pet queryObject = null; + String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject); + + // Like Spring WebClient and RestTemplate, the deep object style is currently not + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleDeepObjectExplodeTrueObjectAllOfTest() { + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = null; + String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject); + + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeFalseArrayIntegerTest() { + // Given + List queryObject = List.of(1, 6, 2, 5, 3, 4); + + // When + String response = api.testQueryStyleFormExplodeFalseArrayInteger(queryObject); + + // Then + assertThat(response, containsString("?query_object=1%2C6%2C2%2C5%2C3%2C4")); + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeFalseArrayStringTest() { + // Given + List queryObject = List.of("Hello", "World"); + + // When + String response = api.testQueryStyleFormExplodeFalseArrayString(queryObject); + + // Then + assertThat(response, containsString("?query_object=Hello%2CWorld")); + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleFormExplodeTrueArrayStringTest() { + // Given + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = + new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() + .addValuesItem("Hello") + .addValuesItem("Hallo") + .addValuesItem("Bonjour"); + + // When + String response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + + // Then + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + assertThat( + response, containsString("?query_object=Hello&query_object=Hallo&query_object=Bonjour")); + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleFormExplodeTrueObjectTest() { + Pet queryObject = null; + String response = api.testQueryStyleFormExplodeTrueObject(queryObject); + + // TODO: test validations + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + } + + /** + * Test query parameter(s) + * + *

Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleFormExplodeTrueObjectAllOfTest() { + DataQuery queryObject = null; + String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject); + + // TODO: test validations + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt index 36cea63cf1aa7..4207d12f74be6 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Bird ( - @field:JsonProperty("size") + @get:JsonProperty("size") val propertySize: kotlin.String? = null, - @field:JsonProperty("color") + @get:JsonProperty("color") val color: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt index fe59d37f3eb9e..9ca46c3d0fa90 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt index 758fa3e16126d..aa1c1f36365a7 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt @@ -36,28 +36,28 @@ import com.fasterxml.jackson.annotation.JsonProperty data class DefaultValue ( - @field:JsonProperty("array_string_enum_ref_default") + @get:JsonProperty("array_string_enum_ref_default") val arrayStringEnumRefDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_enum_default") + @get:JsonProperty("array_string_enum_default") val arrayStringEnumDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_default") + @get:JsonProperty("array_string_default") val arrayStringDefault: kotlin.collections.List? = arrayListOf("failure","skipped"), - @field:JsonProperty("array_integer_default") + @get:JsonProperty("array_integer_default") val arrayIntegerDefault: kotlin.collections.List? = arrayListOf(1,3), - @field:JsonProperty("array_string") + @get:JsonProperty("array_string") val arrayString: kotlin.collections.List? = null, - @field:JsonProperty("array_string_nullable") + @get:JsonProperty("array_string_nullable") val arrayStringNullable: kotlin.collections.List? = null, - @field:JsonProperty("array_string_extension_nullable") + @get:JsonProperty("array_string_extension_nullable") val arrayStringExtensionNullable: kotlin.collections.List? = null, - @field:JsonProperty("string_nullable") + @get:JsonProperty("string_nullable") val stringNullable: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt index 4c05a68b04e4c..5658fb2393f0c 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class NumberPropertiesOnly ( - @field:JsonProperty("number") + @get:JsonProperty("number") val number: java.math.BigDecimal? = null, - @field:JsonProperty("float") + @get:JsonProperty("float") val float: kotlin.Float? = null, - @field:JsonProperty("double") + @get:JsonProperty("double") val double: kotlin.Double? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 35e8747eb7ea5..adc88b273579d 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt index 60c9249f60320..6c346a4c093f0 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt @@ -30,10 +30,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Query ( /* Query */ - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("outcomes") + @get:JsonProperty("outcomes") val outcomes: kotlin.collections.List? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index 617a4684ea1a5..9cef5f51bd689 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt index 9463efaec7235..2c197f0ce8013 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt @@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonProperty data class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ( - @field:JsonProperty("values") + @get:JsonProperty("values") val propertyValues: kotlin.collections.List? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt index 36cea63cf1aa7..4207d12f74be6 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Bird ( - @field:JsonProperty("size") + @get:JsonProperty("size") val propertySize: kotlin.String? = null, - @field:JsonProperty("color") + @get:JsonProperty("color") val color: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt index fe59d37f3eb9e..9ca46c3d0fa90 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt index 758fa3e16126d..aa1c1f36365a7 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt @@ -36,28 +36,28 @@ import com.fasterxml.jackson.annotation.JsonProperty data class DefaultValue ( - @field:JsonProperty("array_string_enum_ref_default") + @get:JsonProperty("array_string_enum_ref_default") val arrayStringEnumRefDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_enum_default") + @get:JsonProperty("array_string_enum_default") val arrayStringEnumDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_default") + @get:JsonProperty("array_string_default") val arrayStringDefault: kotlin.collections.List? = arrayListOf("failure","skipped"), - @field:JsonProperty("array_integer_default") + @get:JsonProperty("array_integer_default") val arrayIntegerDefault: kotlin.collections.List? = arrayListOf(1,3), - @field:JsonProperty("array_string") + @get:JsonProperty("array_string") val arrayString: kotlin.collections.List? = null, - @field:JsonProperty("array_string_nullable") + @get:JsonProperty("array_string_nullable") val arrayStringNullable: kotlin.collections.List? = null, - @field:JsonProperty("array_string_extension_nullable") + @get:JsonProperty("array_string_extension_nullable") val arrayStringExtensionNullable: kotlin.collections.List? = null, - @field:JsonProperty("string_nullable") + @get:JsonProperty("string_nullable") val stringNullable: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt index 4c05a68b04e4c..5658fb2393f0c 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class NumberPropertiesOnly ( - @field:JsonProperty("number") + @get:JsonProperty("number") val number: java.math.BigDecimal? = null, - @field:JsonProperty("float") + @get:JsonProperty("float") val float: kotlin.Float? = null, - @field:JsonProperty("double") + @get:JsonProperty("double") val double: kotlin.Double? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 35e8747eb7ea5..adc88b273579d 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt index 60c9249f60320..6c346a4c093f0 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt @@ -30,10 +30,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Query ( /* Query */ - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("outcomes") + @get:JsonProperty("outcomes") val outcomes: kotlin.collections.List? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index 617a4684ea1a5..9cef5f51bd689 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt index 9463efaec7235..2c197f0ce8013 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt @@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonProperty data class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ( - @field:JsonProperty("values") + @get:JsonProperty("values") val propertyValues: kotlin.collections.List? = null ) { diff --git a/samples/client/echo_api/php-nextgen/src/ApiException.php b/samples/client/echo_api/php-nextgen/src/ApiException.php index 7ff847f700f38..fa1d216dbd921 100644 --- a/samples/client/echo_api/php-nextgen/src/ApiException.php +++ b/samples/client/echo_api/php-nextgen/src/ApiException.php @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected ?array $responseHeaders; @@ -65,10 +65,10 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as stdClass or string + * @param string[][]|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string */ - public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], mixed $responseBody = null) + public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -78,7 +78,7 @@ public function __construct(string $message = "", int $code = 0, ?array $respons /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders(): ?array { diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py index feef534a2f261..c6fa28de31976 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py @@ -16,6 +16,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -67,6 +68,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -339,6 +341,7 @@ def sanitize_for_serialization(self, obj): If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -364,6 +367,8 @@ def sanitize_for_serialization(self, obj): ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -455,6 +460,8 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index feef534a2f261..c6fa28de31976 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -16,6 +16,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -67,6 +68,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -339,6 +341,7 @@ def sanitize_for_serialization(self, obj): If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -364,6 +367,8 @@ def sanitize_for_serialization(self, obj): ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -455,6 +460,8 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java index e77ed7e20e0b2..5ae6fc2b4872f 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -179,7 +179,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -199,7 +199,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -220,7 +220,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -241,7 +241,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -278,7 +278,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -294,7 +294,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -310,7 +310,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -326,7 +326,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -348,7 +348,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -364,7 +364,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -380,7 +380,7 @@ public ApiClient setBearerToken(String bearerToken) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -402,7 +402,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -414,7 +414,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -434,7 +434,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -456,7 +456,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -480,7 +480,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -502,7 +502,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -525,7 +525,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -546,7 +546,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java index e77ed7e20e0b2..5ae6fc2b4872f 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -179,7 +179,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -199,7 +199,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -220,7 +220,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -241,7 +241,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -278,7 +278,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -294,7 +294,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -310,7 +310,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -326,7 +326,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -348,7 +348,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -364,7 +364,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -380,7 +380,7 @@ public ApiClient setBearerToken(String bearerToken) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -402,7 +402,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -414,7 +414,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -434,7 +434,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -456,7 +456,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -480,7 +480,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -502,7 +502,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -525,7 +525,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -546,7 +546,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/README.md b/samples/client/others/java/restclient-useAbstractionForFiles/README.md index c73486a0315e1..996790b4d0735 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/README.md +++ b/samples/client/others/java/restclient-useAbstractionForFiles/README.md @@ -89,17 +89,17 @@ import org.openapitools.client.api.ResourceApi; public class ResourceApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://localhost"); ResourceApi apiInstance = new ResourceApi(defaultClient); try { File result = apiInstance.resourceInResponse(); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException e) { System.err.println("Exception when calling ResourceApi#resourceInResponse"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java index 016560282476e..bfa3ff1fa5bfe 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java @@ -10,8 +10,8 @@ import org.springframework.http.HttpMethod; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; - import org.springframework.http.converter.HttpMessageConverter; - import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator-ignore b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES new file mode 100644 index 0000000000000..e75080e4b5f4f --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES @@ -0,0 +1,7 @@ +index.ts +models/AbstractUserDto.ts +models/BranchDto.ts +models/InternalAuthenticatedUserDto.ts +models/RemoteAuthenticatedUserDto.ts +models/index.ts +runtime.ts diff --git a/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/VERSION b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/client/others/typescript-fetch/self-import-issue/index.ts b/samples/client/others/typescript-fetch/self-import-issue/index.ts new file mode 100644 index 0000000000000..ff7dac6ec1516 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/index.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './models/index'; diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts new file mode 100644 index 0000000000000..0b133d0c066ca --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { BranchDto } from './BranchDto'; +import { + BranchDtoFromJSON, + BranchDtoFromJSONTyped, + BranchDtoToJSON, +} from './BranchDto'; + +import { InternalAuthenticatedUserDtoFromJSONTyped } from './InternalAuthenticatedUserDto'; +import { RemoteAuthenticatedUserDtoFromJSONTyped } from './RemoteAuthenticatedUserDto'; +/** + * + * @export + * @interface AbstractUserDto + */ +export interface AbstractUserDto { + /** + * + * @type {string} + * @memberof AbstractUserDto + */ + username?: string; + /** + * + * @type {BranchDto} + * @memberof AbstractUserDto + */ + branch?: BranchDto; + /** + * + * @type {string} + * @memberof AbstractUserDto + */ + type?: string; +} + +/** + * Check if a given object implements the AbstractUserDto interface. + */ +export function instanceOfAbstractUserDto(value: object): value is AbstractUserDto { + return true; +} + +export function AbstractUserDtoFromJSON(json: any): AbstractUserDto { + return AbstractUserDtoFromJSONTyped(json, false); +} + +export function AbstractUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AbstractUserDto { + if (json == null) { + return json; + } + if (!ignoreDiscriminator) { + if (json['type'] === 'internal-authenticated') { + return InternalAuthenticatedUserDtoFromJSONTyped(json, true); + } + if (json['type'] === 'remote-authenticated') { + return RemoteAuthenticatedUserDtoFromJSONTyped(json, true); + } + } + return { + + 'username': json['username'] == null ? undefined : json['username'], + 'branch': json['branch'] == null ? undefined : BranchDtoFromJSON(json['branch']), + 'type': json['type'] == null ? undefined : json['type'], + }; +} + +export function AbstractUserDtoToJSON(value?: AbstractUserDto | null): any { + if (value == null) { + return value; + } + return { + + 'username': value['username'], + 'branch': BranchDtoToJSON(value['branch']), + 'type': value['type'], + }; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/BranchDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/BranchDto.ts new file mode 100644 index 0000000000000..916a5431fdb9b --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/BranchDto.ts @@ -0,0 +1,60 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface BranchDto + */ +export interface BranchDto { + /** + * + * @type {string} + * @memberof BranchDto + */ + name?: string; +} + +/** + * Check if a given object implements the BranchDto interface. + */ +export function instanceOfBranchDto(value: object): value is BranchDto { + return true; +} + +export function BranchDtoFromJSON(json: any): BranchDto { + return BranchDtoFromJSONTyped(json, false); +} + +export function BranchDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): BranchDto { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function BranchDtoToJSON(value?: BranchDto | null): any { + if (value == null) { + return value; + } + return { + + 'name': value['name'], + }; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/InternalAuthenticatedUserDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/InternalAuthenticatedUserDto.ts new file mode 100644 index 0000000000000..9d4c676133538 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/InternalAuthenticatedUserDto.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { BranchDto } from './BranchDto'; +import { + BranchDtoFromJSON, + BranchDtoFromJSONTyped, + BranchDtoToJSON, +} from './BranchDto'; +import type { AbstractUserDto } from './AbstractUserDto'; +import { + AbstractUserDtoFromJSON, + AbstractUserDtoFromJSONTyped, + AbstractUserDtoToJSON, +} from './AbstractUserDto'; + +/** + * + * @export + * @interface InternalAuthenticatedUserDto + */ +export interface InternalAuthenticatedUserDto extends AbstractUserDto { +} + +/** + * Check if a given object implements the InternalAuthenticatedUserDto interface. + */ +export function instanceOfInternalAuthenticatedUserDto(value: object): value is InternalAuthenticatedUserDto { + return true; +} + +export function InternalAuthenticatedUserDtoFromJSON(json: any): InternalAuthenticatedUserDto { + return InternalAuthenticatedUserDtoFromJSONTyped(json, false); +} + +export function InternalAuthenticatedUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): InternalAuthenticatedUserDto { + return json; +} + +export function InternalAuthenticatedUserDtoToJSON(value?: InternalAuthenticatedUserDto | null): any { + return value; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/RemoteAuthenticatedUserDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/RemoteAuthenticatedUserDto.ts new file mode 100644 index 0000000000000..041a565770273 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/RemoteAuthenticatedUserDto.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { BranchDto } from './BranchDto'; +import { + BranchDtoFromJSON, + BranchDtoFromJSONTyped, + BranchDtoToJSON, +} from './BranchDto'; +import type { AbstractUserDto } from './AbstractUserDto'; +import { + AbstractUserDtoFromJSON, + AbstractUserDtoFromJSONTyped, + AbstractUserDtoToJSON, +} from './AbstractUserDto'; + +/** + * + * @export + * @interface RemoteAuthenticatedUserDto + */ +export interface RemoteAuthenticatedUserDto extends AbstractUserDto { +} + +/** + * Check if a given object implements the RemoteAuthenticatedUserDto interface. + */ +export function instanceOfRemoteAuthenticatedUserDto(value: object): value is RemoteAuthenticatedUserDto { + return true; +} + +export function RemoteAuthenticatedUserDtoFromJSON(json: any): RemoteAuthenticatedUserDto { + return RemoteAuthenticatedUserDtoFromJSONTyped(json, false); +} + +export function RemoteAuthenticatedUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteAuthenticatedUserDto { + return json; +} + +export function RemoteAuthenticatedUserDtoToJSON(value?: RemoteAuthenticatedUserDto | null): any { + return value; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/index.ts b/samples/client/others/typescript-fetch/self-import-issue/models/index.ts new file mode 100644 index 0000000000000..4eb72f75acc26 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/index.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AbstractUserDto'; +export * from './BranchDto'; +export * from './InternalAuthenticatedUserDto'; +export * from './RemoteAuthenticatedUserDto'; diff --git a/samples/client/others/typescript-fetch/self-import-issue/runtime.ts b/samples/client/others/typescript-fetch/self-import-issue/runtime.ts new file mode 100644 index 0000000000000..7dab7bfd087e0 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/runtime.ts @@ -0,0 +1,426 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java index 857d4d668a1f4..474aac64f4d9a 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java @@ -193,7 +193,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -213,7 +213,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -234,7 +234,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -255,7 +255,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -276,7 +276,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -321,7 +321,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -369,7 +369,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -391,7 +391,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -423,7 +423,7 @@ public ApiClient setBearerToken(String bearerToken) { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public ApiClient setAccessToken(String accessToken) { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -456,7 +456,7 @@ public ApiClient setOauthCredentials(String clientId, String clientSecret) { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public ApiClient setOauthCredentialsForPublicClient(String clientId) { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public ApiClient setOauthPasswordFlow(String username, String password) { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public ApiClient setOauthAuthorizationCodeFlow(String code) { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -521,7 +521,7 @@ public ApiClient setOauthScope(String scope) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -543,7 +543,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -555,7 +555,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -575,7 +575,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -597,7 +597,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -621,7 +621,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -643,7 +643,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -666,7 +666,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -687,7 +687,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 857d4d668a1f4..474aac64f4d9a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -193,7 +193,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -213,7 +213,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -234,7 +234,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -255,7 +255,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -276,7 +276,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -321,7 +321,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -369,7 +369,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -391,7 +391,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -423,7 +423,7 @@ public ApiClient setBearerToken(String bearerToken) { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public ApiClient setAccessToken(String accessToken) { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -456,7 +456,7 @@ public ApiClient setOauthCredentials(String clientId, String clientSecret) { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public ApiClient setOauthCredentialsForPublicClient(String clientId) { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public ApiClient setOauthPasswordFlow(String username, String password) { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public ApiClient setOauthAuthorizationCodeFlow(String code) { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -521,7 +521,7 @@ public ApiClient setOauthScope(String scope) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -543,7 +543,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -555,7 +555,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -575,7 +575,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -597,7 +597,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -621,7 +621,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -643,7 +643,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -666,7 +666,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -687,7 +687,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/client/petstore/java/rest-assured-jackson/build.gradle b/samples/client/petstore/java/rest-assured-jackson/build.gradle index e68a5e0a9a23b..3d35d7ba46b9a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.gradle +++ b/samples/client/petstore/java/rest-assured-jackson/build.gradle @@ -98,12 +98,12 @@ if(hasProperty('target') && target == 'android') { ext { rest_assured_version = "5.3.2" - junit_version = "4.13.2" + junit_version = "5.10.3" jackson_version = "2.17.1" jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" - jakarta_annotation_version = "1.3.5" okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { @@ -119,5 +119,5 @@ dependencies { implementation "jakarta.validation:jakarta.validation-api:3.0.2" implementation "org.hibernate:hibernate-validator:6.0.19.Final" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/rest-assured-jackson/build.sbt b/samples/client/petstore/java/rest-assured-jackson/build.sbt index e080650b9efd8..58b7d967ddced 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.sbt +++ b/samples/client/petstore/java/rest-assured-jackson/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/samples/client/petstore/java/rest-assured-jackson/pom.xml b/samples/client/petstore/java/rest-assured-jackson/pom.xml index 8456b100c80d5..9023c63de60db 100644 --- a/samples/client/petstore/java/rest-assured-jackson/pom.xml +++ b/samples/client/petstore/java/rest-assured-jackson/pom.xml @@ -269,8 +269,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -286,6 +286,6 @@ 1.3.5 3.0.2 3.6.0 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java index 53034a2a25ffb..b0947b63fe59c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java @@ -2,8 +2,8 @@ import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0e4b0a6ab6e67..094646cde8807 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -24,8 +24,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index b61c0d778e2b4..68cbe7e56d130 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -25,8 +25,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index d9c9b7393e40f..ccdf243345f25 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -24,8 +24,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index c77addb03e0a7..ec1283abd0fe6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -26,8 +26,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 73386505b31c8..904ff113d4c48 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -24,8 +24,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 2fdcb9c15608b..1dd2801d6d91d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -25,8 +25,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4a1d824b29b33..f3a8b70ea6fa7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -24,8 +24,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index fe66655b2f527..557b795601f84 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -24,8 +24,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index a8f2489613abd..13dc9aba4e8e2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -25,8 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7c31ea14a69fc..d91470282fea8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -26,8 +26,8 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 3816d38be0332..5af39fea7ac4b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -26,8 +26,8 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index 76a52fafc6a28..c4f16ec3f1ca7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -26,8 +26,8 @@ import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index d233119ee5fad..0b3004a76c239 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -26,8 +26,8 @@ import org.openapitools.client.model.Cat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index 7983d08f1678c..d83d75a6aa07c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index 6408522665331..3a9fe775adefa 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -26,8 +26,8 @@ import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index db43d5fd9c640..3c33bff1ff431 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index e70f9d3645d22..2b29d15d6441e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index aa06260b1d9a4..e38f8033c49b2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index 0fc77b68946ba..e60ed3366a0ae 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -26,8 +26,8 @@ import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index 6cfc8b9b91e35..2bab3284cd7f7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -25,8 +25,8 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java index 43ec2faf20c86..9d1fa380058fb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java @@ -17,8 +17,8 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 9edf4a304704d..4b86c00837467 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -23,8 +23,8 @@ import org.openapitools.client.model.OuterEnum; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a84b74ee00c3c..bc20899d1f1dc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -26,8 +26,8 @@ import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index 50622f05dd900..c6775d338df98 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -27,8 +27,8 @@ import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7aa2339be4a94..4bfe6ade50b62 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index bf4c9039851be..67db6912bd3e2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -24,8 +24,8 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4a9858d55dc79..7f2df1916affa 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -27,8 +27,8 @@ import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index f31f4cffaeeb6..f4ec492e40bf7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 129591d347729..306ed022829be 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java index d08a88a08858d..d05f30d1af193 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java index 6e2114eeab311..c1c0483e479d6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index 08b490c82a9b0..f60dd8282c412 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index 0f09c05d03ed4..e909b7f5107a1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index 3635b349033c4..1f84c2eaa8c6a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -23,8 +23,8 @@ import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index 022a0bf3fc1a8..416a9d0d9bbe8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -23,8 +23,8 @@ import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index 7e5735607246d..eee0245e640ce 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -23,8 +23,8 @@ import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java index 386290bc65289..efff50487a8da 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -17,8 +17,8 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index 093cd05b227ee..c9a14898c13d7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -30,8 +30,8 @@ import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ee671e4a08a10..fe64b45ac343b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index fc54a3c89bcbb..51991d3c86bd1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index 4c2b211817745..189356c8f9a9f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c8540c08e5b6d..fb6dc376eddd0 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -26,8 +26,8 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 25742953a138b..f131b903c5cd7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -26,8 +26,8 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index 52b6e37db53d8..51da02daf60be 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index d96ba1c777f42..91dbe96cac72c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -26,8 +26,8 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index d1efa43a3087a..93441f6ab512f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,18 +14,25 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.UUID; import org.openapitools.client.ApiClient; import org.openapitools.client.api.AnotherFakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +40,12 @@ /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -52,10 +59,12 @@ public void createApi() { */ @Test public void shouldSee200AfterCall123testSpecialTags() { + String uuidTest = null; Client body = null; api.call123testSpecialTags() + .uuidTestHeader(uuidTest) .body(body).execute(r -> r.prettyPeek()); // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java index 183de79127e12..b2db670058897 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -26,14 +26,20 @@ import org.openapitools.client.api.FakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -41,12 +47,12 @@ /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -303,4 +309,4 @@ public void shouldSee200AfterTestQueryParameterCollectionFormat() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 3d2b74185bac0..de05aa0a336a7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.api.FakeClassnameTags123Api; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +39,12 @@ /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -58,4 +64,4 @@ public void shouldSee200AfterTestClassname() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java index 1ae1e95a3a7a6..7d169d41366d5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -21,14 +21,20 @@ import org.openapitools.client.api.PetApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -36,12 +42,12 @@ /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -244,7 +250,7 @@ public void shouldSee405AfterUpdatePetWithForm() { public void shouldSee200AfterUploadFile() { Long petId = null; String additionalMetadata = null; - File file = null; + File _file = null; api.uploadFile() .petIdPath(petId).execute(r -> r.prettyPeek()); // TODO: test validations @@ -265,4 +271,4 @@ public void shouldSee200AfterUploadFileWithRequiredFile() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java index 88b10b312b06c..c3e65eb4696f6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.api.StoreApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +39,12 @@ /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -136,4 +142,4 @@ public void shouldSee400AfterPlaceOrder() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java index 8b224223bdb4f..b8e03ee1d4f4d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -13,19 +13,26 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; import org.openapitools.client.api.UserApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +40,12 @@ /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -64,7 +71,7 @@ public void shouldSee0AfterCreateUser() { */ @Test public void shouldSee0AfterCreateUsersWithArrayInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithArrayInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -76,7 +83,7 @@ public void shouldSee0AfterCreateUsersWithArrayInput() { */ @Test public void shouldSee0AfterCreateUsersWithListInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithListInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -203,4 +210,4 @@ public void shouldSee404AfterUpdateUser() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 4f6fd800ab713..faacb289c17e7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesAnyType() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 41e6497ecee94..b506ff7ae92a9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -21,22 +21,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesArray() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index d2e17831ba7cc..ba65ffedc14f6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesBoolean() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 14fd8022febe8..72854079e5ed4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -22,22 +22,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -45,7 +44,7 @@ public void testAdditionalPropertiesClass() { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -53,7 +52,7 @@ public void mapStringTest() { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -61,7 +60,7 @@ public void mapNumberTest() { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -69,7 +68,7 @@ public void mapIntegerTest() { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -77,7 +76,7 @@ public void mapBooleanTest() { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -85,7 +84,7 @@ public void mapArrayIntegerTest() { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -93,7 +92,7 @@ public void mapArrayAnytypeTest() { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -101,7 +100,7 @@ public void mapMapStringTest() { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -109,7 +108,7 @@ public void mapMapAnytypeTest() { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -117,7 +116,7 @@ public void anytype1Test() { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -125,7 +124,7 @@ public void anytype2Test() { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 58b7521c6a7bc..916c2c2bcb3db 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesInteger() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 10ad938f52cd5..a099245eec5b1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -21,22 +21,21 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesNumber() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index bcbb9c54b27fb..d47c9a37d1fef 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index f7662d6c4692a..3820dd2e23ceb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesString() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java index 930e5c17d074a..24776d3cb515a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,25 +21,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -47,7 +43,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,7 +51,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec57..6bbe877044db5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -44,7 +44,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc8e..eaf908bb1ab79 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -44,7 +44,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c28..99c6bcf536016 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -19,24 +19,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -44,7 +44,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -52,7 +52,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -60,7 +60,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/BigCatTest.java index 765bd1505128f..20bc4e0d4247a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -44,7 +44,7 @@ public void testBigCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -68,7 +68,7 @@ public void declawedTest() { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a0738..a0217acd1f202 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -41,7 +40,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -49,7 +48,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -57,7 +56,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -65,7 +64,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -73,7 +72,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -81,7 +80,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java index 90fdba14c24b4..1b389a075be0d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,23 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -46,7 +44,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -62,7 +60,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e630..22fcbd7f3ccb9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -41,7 +40,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e64..6ef5c744fbcbb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -41,7 +40,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b744a..8028f11bc2b96 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -41,7 +40,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bda3..b2a12ab4c5e09 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,22 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -45,7 +44,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +60,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c17..4a755b0d44251 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -19,23 +19,23 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -43,7 +43,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -51,7 +51,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd2c..48aa1a737fce7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java index 8907cfa8e8f08..b06e3eb195d93 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -42,7 +41,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -50,7 +49,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -58,7 +57,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -66,7 +65,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -74,7 +73,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bcfb..0048cb2c74977 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -19,24 +19,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -44,7 +44,7 @@ public void testFileSchemaTestClass() { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -52,7 +52,7 @@ public void _fileTest() { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java index 48bec93d99430..3060f7f2d56d7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,22 +23,21 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -46,7 +45,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -54,7 +53,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -62,7 +61,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -70,7 +69,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -78,7 +77,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -86,7 +85,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -94,7 +93,7 @@ public void _doubleTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -102,7 +101,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -110,7 +109,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -118,7 +117,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -126,7 +125,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -134,7 +133,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -142,7 +141,7 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -150,7 +149,7 @@ public void passwordTest() { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d450025..908f0aff6ed71 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -41,7 +40,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472bee..3752c5ba31fdc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -43,7 +42,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -51,7 +50,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -59,7 +58,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -67,7 +66,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96bede..0f47e193af8d6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,22 +23,21 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -46,7 +45,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -54,7 +53,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -62,7 +61,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f97619899..5743b70142b84 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -41,7 +40,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e6f..436e4abd59e3c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -41,7 +40,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -49,7 +48,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -57,7 +56,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71beb1..f128d7b9ac2e7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -41,7 +40,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5ac..92273f48d2396 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -41,7 +40,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d239f..1c5337654cd45 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -41,7 +40,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb408b..1a6aa18fa20da 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -41,7 +40,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -57,7 +56,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -65,7 +64,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad52..8623386a5e95e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -42,7 +41,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df151..670c2535646bf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -42,7 +41,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -58,7 +57,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -66,7 +65,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -74,7 +73,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -82,7 +81,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e14..870a977da9449 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -42,7 +41,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -50,7 +49,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -58,7 +57,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf0a..0333ee657a0f2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9ae9..2e4303f1e4b54 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,27 +20,27 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec204873..c56da4290fa9c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -41,7 +40,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875ac9..9501cf722d66a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -41,7 +40,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948ec..dc9cf9742efa5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -41,7 +40,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 8c096c188fcea..7ee75c3573150 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -44,7 +44,7 @@ public void testTypeHolderDefault() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -52,7 +52,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -60,7 +60,7 @@ public void numberItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -68,7 +68,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -76,7 +76,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index b1655df616567..5c77882f50079 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -44,7 +44,7 @@ public void testTypeHolderExample() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -52,7 +52,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -60,7 +60,7 @@ public void numberItemTest() { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -68,7 +68,7 @@ public void floatItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -76,7 +76,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -84,7 +84,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b90..69d274133b976 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -41,7 +40,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -57,7 +56,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -65,7 +64,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -73,7 +72,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -81,7 +80,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -89,7 +88,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -97,7 +96,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.java index 4bab95a912646..d2e45fadf56c6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -44,7 +44,7 @@ public void testXmlItem() { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -52,7 +52,7 @@ public void attributeStringTest() { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -60,7 +60,7 @@ public void attributeNumberTest() { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -68,7 +68,7 @@ public void attributeIntegerTest() { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -76,7 +76,7 @@ public void attributeBooleanTest() { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -84,7 +84,7 @@ public void wrappedArrayTest() { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -92,7 +92,7 @@ public void nameStringTest() { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -100,7 +100,7 @@ public void nameNumberTest() { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -108,7 +108,7 @@ public void nameIntegerTest() { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -116,7 +116,7 @@ public void nameBooleanTest() { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -124,7 +124,7 @@ public void nameArrayTest() { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -132,7 +132,7 @@ public void nameWrappedArrayTest() { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -140,7 +140,7 @@ public void prefixStringTest() { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -148,7 +148,7 @@ public void prefixNumberTest() { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -156,7 +156,7 @@ public void prefixIntegerTest() { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -164,7 +164,7 @@ public void prefixBooleanTest() { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -172,7 +172,7 @@ public void prefixArrayTest() { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -180,7 +180,7 @@ public void prefixWrappedArrayTest() { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -188,7 +188,7 @@ public void namespaceStringTest() { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -196,7 +196,7 @@ public void namespaceNumberTest() { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -204,7 +204,7 @@ public void namespaceIntegerTest() { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -212,7 +212,7 @@ public void namespaceBooleanTest() { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -220,7 +220,7 @@ public void namespaceArrayTest() { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -228,7 +228,7 @@ public void namespaceWrappedArrayTest() { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -236,7 +236,7 @@ public void prefixNsStringTest() { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -244,7 +244,7 @@ public void prefixNsNumberTest() { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -252,7 +252,7 @@ public void prefixNsIntegerTest() { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -260,7 +260,7 @@ public void prefixNsBooleanTest() { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -268,7 +268,7 @@ public void prefixNsArrayTest() { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index b81ff3e04bba2..bf42131b49d5c 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -98,10 +98,11 @@ if(hasProperty('target') && target == 'android') { ext { rest_assured_version = "5.3.2" - junit_version = "4.13.2" + junit_version = "5.10.3" gson_version = "2.10.1" gson_fire_version = "1.9.0" okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { @@ -113,5 +114,5 @@ dependencies { implementation "jakarta.validation:jakarta.validation-api:3.0.2" implementation "org.hibernate:hibernate-validator:6.0.19.Final" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/rest-assured/build.sbt b/samples/client/petstore/java/rest-assured/build.sbt index bc19cbe382047..52d6008056ef0 100644 --- a/samples/client/petstore/java/rest-assured/build.sbt +++ b/samples/client/petstore/java/rest-assured/build.sbt @@ -19,7 +19,7 @@ lazy val root = (project in file(".")). "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/samples/client/petstore/java/rest-assured/pom.xml b/samples/client/petstore/java/rest-assured/pom.xml index cabf0fdd6c429..006eb9f1d8f45 100644 --- a/samples/client/petstore/java/rest-assured/pom.xml +++ b/samples/client/petstore/java/rest-assured/pom.xml @@ -246,8 +246,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -260,6 +260,6 @@ 1.3.5 3.0.2 3.6.0 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java index 53034a2a25ffb..b0947b63fe59c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java @@ -2,8 +2,8 @@ import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 5cf039cdbaa03..fbde24e630bf4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 718d46054337b..b8f65f9d70956 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 9e6f720bd1da1..45f3399723050 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index c95334e19c1b8..803506fbbb34d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -25,8 +25,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index edbb5a7483561..4fa34da740b70 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 181ae082d3b9a..855985ef31c74 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -24,8 +24,8 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fa598b737e24b..316a6dddbd872 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 70a6746c068c3..f0141ef12e268 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index 0bcf1dda74262..ace152998b130 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 07dabe7137582..8d49e5edcd5f2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 79a62d69a4ace..3374787065c99 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index bf78db6c857e7..d6f2eefadb087 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -25,8 +25,8 @@ import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index 8abc9cd1908de..52486c521a22c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Cat; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index a845fb14d5a31..3542628c41ff3 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index 3c3f35642c77c..c816ad83ba02c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index a7f83941e9101..59344d98769dd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index 728ac929aa096..7ede445f5872e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index e8e95f562bfa5..0566009f40a97 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index 967b03b796174..ffee10ce3350a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index 5cbf2b732d3a8..e8dcd12225747 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -24,8 +24,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java index ae6366ff6196d..3e594e7ef3ef3 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java @@ -16,8 +16,8 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import java.io.IOException; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 116db437d2d93..d3301f626b7fc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index eba5ce6a8cafd..f2452c75861fd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -25,8 +25,8 @@ import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index ccb46c88663fc..c02078c47bbfb 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -26,8 +26,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 0e3baac6d28e9..a291fafed1ab4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 5f11eeb5660c7..0f2d52849c835 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7b7f566d97a2c..00cadb44f0abc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -26,8 +26,8 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index 445a26f96729d..c6f67c4351293 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 0db408357888d..a243d5ef6f4df 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java index d14b5a2d19589..f23bf58f1203c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java index f5bb314ed0577..41c3f65fd69c9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index dee36bc4994e3..b8387d3e6d1b7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index f62f28d183483..7b1abf1bc41e7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index 6db860452b240..ba4b865054271 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index 249a6eb07e022..6a6a5148fde12 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.time.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index 921c8cad6385d..725981f368203 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java index be690856408e3..5cf2df0096528 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -16,8 +16,8 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import java.io.IOException; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index 9e46cfbafea83..bb36f325ec2fe 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -28,8 +28,8 @@ import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1551442e16ac3..4a83c7f3cf232 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index b9779c5001184..3c0304d39c753 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index af4964e1353ea..67db6def18de9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index d866015de8e90..7965e37382311 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9577c9719fa51..350edc6cdb65e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index 37c45e72bacd2..ff454e4e7b3d4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -21,8 +21,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index 20033c5ef0806..467ee821720f0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 11417e240fcf5..98ae595b408f6 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,18 +14,25 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.UUID; import org.openapitools.client.ApiClient; import org.openapitools.client.api.AnotherFakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +40,12 @@ /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -52,10 +59,12 @@ public void createApi() { */ @Test public void shouldSee200AfterCall123testSpecialTags() { + String uuidTest = null; Client body = null; api.call123testSpecialTags() + .uuidTestHeader(uuidTest) .body(body).execute(r -> r.prettyPeek()); // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java index e248c2155a251..a7abe7c1e7525 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -26,14 +26,20 @@ import org.openapitools.client.api.FakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -41,12 +47,12 @@ /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -303,4 +309,4 @@ public void shouldSee200AfterTestQueryParameterCollectionFormat() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index d8fbcab912343..fa03b6cd79b44 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.api.FakeClassnameTags123Api; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +39,12 @@ /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -58,4 +64,4 @@ public void shouldSee200AfterTestClassname() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java index 933f5aed2b856..ad4bf4ca0b0c2 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,19 +16,24 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import org.openapitools.client.ApiClient; import org.openapitools.client.api.PetApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 java.util.Set; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; @@ -37,12 +42,12 @@ /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -245,7 +250,7 @@ public void shouldSee405AfterUpdatePetWithForm() { public void shouldSee200AfterUploadFile() { Long petId = null; String additionalMetadata = null; - File file = null; + File _file = null; api.uploadFile() .petIdPath(petId).execute(r -> r.prettyPeek()); // TODO: test validations @@ -266,4 +271,4 @@ public void shouldSee200AfterUploadFileWithRequiredFile() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java index b4ca1cc5d743a..8463e0282404d 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.api.StoreApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +39,12 @@ /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -136,4 +142,4 @@ public void shouldSee400AfterPlaceOrder() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java index b64674d7bf4d3..cbb964e6209c1 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -13,19 +13,26 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; import org.openapitools.client.api.UserApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +40,12 @@ /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -64,7 +71,7 @@ public void shouldSee0AfterCreateUser() { */ @Test public void shouldSee0AfterCreateUsersWithArrayInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithArrayInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -76,7 +83,7 @@ public void shouldSee0AfterCreateUsersWithArrayInput() { */ @Test public void shouldSee0AfterCreateUsersWithListInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithListInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -203,4 +210,4 @@ public void shouldSee404AfterUpdateUser() { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 50305c9c36512..04fa4f5b6d9af 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -21,22 +21,21 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesAnyType() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index d48028727f8b2..80dc3fcbd43d5 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -22,22 +22,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -45,7 +44,7 @@ public void testAdditionalPropertiesArray() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 287c5b053a0b6..ca1046a0fc825 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -21,22 +21,21 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesBoolean() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 3363cd409f9a6..3c34271bf0dce 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -23,22 +23,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -46,7 +45,7 @@ public void testAdditionalPropertiesClass() { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -54,7 +53,7 @@ public void mapStringTest() { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -62,7 +61,7 @@ public void mapNumberTest() { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -70,7 +69,7 @@ public void mapIntegerTest() { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -78,7 +77,7 @@ public void mapBooleanTest() { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -86,7 +85,7 @@ public void mapArrayIntegerTest() { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -94,7 +93,7 @@ public void mapArrayAnytypeTest() { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -102,7 +101,7 @@ public void mapMapStringTest() { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -110,7 +109,7 @@ public void mapMapAnytypeTest() { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -118,7 +117,7 @@ public void anytype1Test() { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -126,7 +125,7 @@ public void anytype2Test() { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 77d9b6526c558..e9f37e84ecda9 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -21,22 +21,21 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesInteger() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 09113d376a661..3d6ac0eec2591 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -22,22 +22,21 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -45,7 +44,7 @@ public void testAdditionalPropertiesNumber() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index c5b1e774cc2b3..47389e5fd5475 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -21,22 +21,21 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index d7f054fbbd9ca..162ae6f2edd62 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -21,22 +21,21 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesString() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java index 39baa2cbc382f..e8508c4319b85 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -19,25 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -45,7 +41,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +49,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 165c1862aeed0..9d8fb3480f6e6 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -21,23 +21,23 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -45,7 +45,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4c5e8b7ef58a3..ef70479bb3ce3 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -21,23 +21,23 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -45,7 +45,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java index eaf7cb8aadf4b..f5c7ed8752f93 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -20,24 +20,24 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -45,7 +45,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -53,7 +53,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -61,7 +61,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d893..aa1db2031da5b 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -42,7 +42,7 @@ public void testBigCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public void declawedTest() { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java index dad32fc08952a..eda1830e0c01f 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -42,7 +41,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -50,7 +49,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -58,7 +57,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -66,7 +65,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -74,7 +73,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -82,7 +81,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java index f272c0fa92f22..6e38fb46e73d4 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java @@ -20,23 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -44,7 +42,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java index 09046fd21c4f9..4ac631b1e8c4f 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -42,7 +41,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java index 6998a0cb766a4..aa381b709d903 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -42,7 +41,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java index 103e991a4032f..95f0e2d39d2c8 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -42,7 +41,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java index 35c27a3eda030..f65ec9fbebe98 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -43,7 +42,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -51,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -59,7 +58,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java index b87e410f9635d..1175d0a96ec83 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -20,23 +20,23 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -44,7 +44,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -52,7 +52,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java index 329454658e33a..cb2a9c6949874 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java index 6569d711402f4..b097f85302d21 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -43,7 +42,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -51,7 +50,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -59,7 +58,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -67,7 +66,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -75,7 +74,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 3df1cafc7f94c..08d51e19dad08 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -20,24 +20,24 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -45,7 +45,7 @@ public void testFileSchemaTestClass() { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -53,7 +53,7 @@ public void _fileTest() { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java index 24d631e5c6e99..bcdcaf9dd061c 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,22 +24,21 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -47,7 +46,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -55,7 +54,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -63,7 +62,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -71,7 +70,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -79,7 +78,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -87,7 +86,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -95,7 +94,7 @@ public void _doubleTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -103,7 +102,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -111,7 +110,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -119,7 +118,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -127,7 +126,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -135,7 +134,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -143,7 +142,7 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -151,7 +150,7 @@ public void passwordTest() { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index 6da8d8d167e6d..01be6b15413ca 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -42,7 +41,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -50,7 +49,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java index 038898516faa6..d9b643e6b43d0 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -21,22 +21,21 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -44,7 +43,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -52,7 +51,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -60,7 +59,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -68,7 +67,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b0c6aec73eecb..0d57da0126e78 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -24,22 +24,21 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -47,7 +46,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -55,7 +54,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -63,7 +62,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index ad739d2173cc8..ecae6e0f4370a 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -42,7 +41,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -50,7 +49,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 8c57deac71277..bb4aa91a78caf 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -42,7 +41,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -50,7 +49,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -58,7 +57,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java index a40382564ac25..973730324cc8e 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -42,7 +41,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java index 8a2d23e90ec8d..bdba8c46a91be 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -42,7 +41,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 3ec9148deee8d..ae4eaf6295f7f 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -42,7 +41,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java index 96201d5a52038..f35cf4746e52c 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -42,7 +41,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -50,7 +49,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -58,7 +57,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -66,7 +65,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 192572d7dcadb..16ed327afed80 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -43,7 +42,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java index ee9699fba98bd..439814c48b16e 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -43,7 +42,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,7 +50,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -59,7 +58,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -67,7 +66,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -75,7 +74,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -83,7 +82,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 620678b1cd961..cf76f8e58d065 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -43,7 +42,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -51,7 +50,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -59,7 +58,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 220d40e83cbbe..4110989633b98 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java index 13936977f7dfb..82448ec23687a 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,27 +20,27 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 61bda609f8df9..72101f74b6188 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -42,7 +41,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -50,7 +49,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index ed82c1fd67957..dfc2065188db9 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -42,7 +41,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java index 7ddf73984f2d0..36eea1ddb7bfc 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -42,7 +41,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 1561e6bbb3d2b..3f8ac3d4a3fc5 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -21,23 +21,23 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -45,7 +45,7 @@ public void testTypeHolderDefault() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -53,7 +53,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -61,7 +61,7 @@ public void numberItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -69,7 +69,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -77,7 +77,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index b369123e981cc..e0a7a0d614ceb 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -21,23 +21,23 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -45,7 +45,7 @@ public void testTypeHolderExample() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -53,7 +53,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -61,7 +61,7 @@ public void numberItemTest() { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -69,7 +69,7 @@ public void floatItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -77,7 +77,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -85,7 +85,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java index 2d4e842d6a391..5163783cfdc1d 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java @@ -19,22 +19,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -42,7 +41,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -58,7 +57,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -66,7 +65,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -74,7 +73,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -82,7 +81,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -90,7 +89,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -98,7 +97,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java index 0476f2f1630fe..3cfe59d203cd3 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -21,23 +21,23 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -45,7 +45,7 @@ public void testXmlItem() { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -53,7 +53,7 @@ public void attributeStringTest() { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -61,7 +61,7 @@ public void attributeNumberTest() { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -69,7 +69,7 @@ public void attributeIntegerTest() { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -77,7 +77,7 @@ public void attributeBooleanTest() { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -85,7 +85,7 @@ public void wrappedArrayTest() { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -93,7 +93,7 @@ public void nameStringTest() { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -101,7 +101,7 @@ public void nameNumberTest() { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -109,7 +109,7 @@ public void nameIntegerTest() { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -117,7 +117,7 @@ public void nameBooleanTest() { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -125,7 +125,7 @@ public void nameArrayTest() { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -133,7 +133,7 @@ public void nameWrappedArrayTest() { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -141,7 +141,7 @@ public void prefixStringTest() { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -149,7 +149,7 @@ public void prefixNumberTest() { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -157,7 +157,7 @@ public void prefixIntegerTest() { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -165,7 +165,7 @@ public void prefixBooleanTest() { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -173,7 +173,7 @@ public void prefixArrayTest() { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -181,7 +181,7 @@ public void prefixWrappedArrayTest() { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -189,7 +189,7 @@ public void namespaceStringTest() { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -197,7 +197,7 @@ public void namespaceNumberTest() { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -205,7 +205,7 @@ public void namespaceIntegerTest() { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -213,7 +213,7 @@ public void namespaceBooleanTest() { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -221,7 +221,7 @@ public void namespaceArrayTest() { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -229,7 +229,7 @@ public void namespaceWrappedArrayTest() { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -237,7 +237,7 @@ public void prefixNsStringTest() { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -245,7 +245,7 @@ public void prefixNsNumberTest() { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -253,7 +253,7 @@ public void prefixNsIntegerTest() { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -261,7 +261,7 @@ public void prefixNsBooleanTest() { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -269,7 +269,7 @@ public void prefixNsArrayTest() { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/restclient-nullable-arrays/README.md b/samples/client/petstore/java/restclient-nullable-arrays/README.md index 2f66a14f3e9d8..bbf22c81d6522 100644 --- a/samples/client/petstore/java/restclient-nullable-arrays/README.md +++ b/samples/client/petstore/java/restclient-nullable-arrays/README.md @@ -89,17 +89,17 @@ import org.openapitools.client.api.DefaultApi; public class DefaultApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://localhost"); DefaultApi apiInstance = new DefaultApi(defaultClient); try { List result = apiInstance.nullableArrayTestGet(); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException e) { System.err.println("Exception when calling DefaultApi#nullableArrayTestGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java index 016560282476e..bfa3ff1fa5bfe 100644 --- a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -10,8 +10,8 @@ import org.springframework.http.HttpMethod; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; - import org.springframework.http.converter.HttpMessageConverter; - import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/samples/client/petstore/java/restclient-swagger2/README.md b/samples/client/petstore/java/restclient-swagger2/README.md index f4a78e06f7b9f..38aee4a6be8a1 100644 --- a/samples/client/petstore/java/restclient-swagger2/README.md +++ b/samples/client/petstore/java/restclient-swagger2/README.md @@ -89,7 +89,7 @@ import org.openapitools.client.api.AnotherFakeApi; public class AnotherFakeApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); @@ -97,10 +97,10 @@ public class AnotherFakeApiExample { try { Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java index 3a18efd062b1e..20b9ece9bc9c6 100644 --- a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -10,8 +10,8 @@ import org.springframework.http.HttpMethod; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; - import org.springframework.http.converter.HttpMessageConverter; - import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/samples/client/petstore/java/restclient/README.md b/samples/client/petstore/java/restclient/README.md index f4a78e06f7b9f..38aee4a6be8a1 100644 --- a/samples/client/petstore/java/restclient/README.md +++ b/samples/client/petstore/java/restclient/README.md @@ -89,7 +89,7 @@ import org.openapitools.client.api.AnotherFakeApi; public class AnotherFakeApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); @@ -97,10 +97,10 @@ public class AnotherFakeApiExample { try { Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java index 3a18efd062b1e..20b9ece9bc9c6 100644 --- a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java @@ -10,8 +10,8 @@ import org.springframework.http.HttpMethod; import org.springframework.http.InvalidMediaTypeException; import org.springframework.http.MediaType; - import org.springframework.http.converter.HttpMessageConverter; - import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index fac37c8155606..16873603b036c 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -106,7 +106,7 @@ ext { play_version = "2.6.7" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" json_fire_version = "1.9.0" } @@ -130,5 +130,5 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2-play26/build.sbt b/samples/client/petstore/java/retrofit2-play26/build.sbt index 0057176a21299..5fd16c7014b72 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.sbt +++ b/samples/client/petstore/java/retrofit2-play26/build.sbt @@ -21,7 +21,7 @@ lazy val root = (project in file(".")). "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index f13843c9821bf..9c926c73279fa 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -290,8 +290,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -311,6 +311,6 @@ 2.1.1 3.0.2 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 0307ed17779ae..575598ee4c2d9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -1,9 +1,21 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; /** * API tests for AnotherFakeApi @@ -12,7 +24,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -24,8 +36,9 @@ public void setup() { */ @Test public void call123testSpecialTagsTest() { - Client client = null; - // Client response = api.call123testSpecialTags(client); + UUID uuidTest = null; + Client body = null; + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java index 82a96b9818b3e..20f06e6eb9092 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -9,14 +9,21 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.openapitools.client.model.XmlItem; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + /** * API tests for FakeApi */ @@ -24,11 +31,23 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } + /** + * creates an XmlItem + * + * this route creates an XmlItem + */ + @Test + public void createXmlItemTest() { + XmlItem xmlItem = null; + // api.createXmlItem(xmlItem); + + // TODO: test validations + } /** * * @@ -48,8 +67,8 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + OuterComposite body = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(body); // TODO: test validations } @@ -84,8 +103,8 @@ public void fakeOuterStringSerializeTest() { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - // api.testBodyWithFileSchema(fileSchemaTestClass); + FileSchemaTestClass body = null; + // api.testBodyWithFileSchema(body); // TODO: test validations } @@ -97,8 +116,8 @@ public void testBodyWithFileSchemaTest() { @Test public void testBodyWithQueryParamsTest() { String query = null; - User user = null; - // api.testBodyWithQueryParams(query, user); + User body = null; + // api.testBodyWithQueryParams(query, body); // TODO: test validations } @@ -109,15 +128,15 @@ public void testBodyWithQueryParamsTest() { */ @Test public void testClientModelTest() { - Client client = null; - // Client response = api.testClientModel(client); + Client body = null; + // Client response = api.testClientModel(body); // TODO: test validations } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ @Test public void testEndpointParametersTest() { @@ -182,8 +201,8 @@ public void testGroupParametersTest() { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - // api.testInlineAdditionalProperties(requestBody); + Map param = null; + // api.testInlineAdditionalProperties(param); // TODO: test validations } @@ -198,6 +217,22 @@ public void testJsonFormDataTest() { String param2 = null; // api.testJsonFormData(param, param2); + // TODO: test validations + } + /** + * + * + * To test the collection format in query parameters + */ + @Test + public void testQueryParameterCollectionFormatTest() { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index e615576da238f..4037ef6fbe832 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -1,9 +1,20 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; /** * API tests for FakeClassnameTags123Api @@ -12,7 +23,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } @@ -24,8 +35,8 @@ public void setup() { */ @Test public void testClassnameTest() { - Client client = null; - // Client response = api.testClassname(client); + Client body = null; + // Client response = api.testClassname(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java index 9d7a40be31446..cc6f0aba773f2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -1,12 +1,23 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -import java.io.File; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; /** * API tests for PetApi @@ -15,7 +26,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -23,19 +34,19 @@ public void setup() { /** * Add a new pet to the store * - * + * */ @Test public void addPetTest() { - Pet pet = null; - // api.addPet(pet); + Pet body = null; + // api.addPet(body); // TODO: test validations } /** * Deletes a pet * - * + * */ @Test public void deletePetTest() { @@ -64,8 +75,8 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { - List tags = null; - // List response = api.findPetsByTags(tags); + Set tags = null; + // Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -84,19 +95,19 @@ public void getPetByIdTest() { /** * Update an existing pet * - * + * */ @Test public void updatePetTest() { - Pet pet = null; - // api.updatePet(pet); + Pet body = null; + // api.updatePet(body); // TODO: test validations } /** * Updates a pet in the store with form data * - * + * */ @Test public void updatePetWithFormTest() { @@ -110,21 +121,21 @@ public void updatePetWithFormTest() { /** * uploads an image * - * + * */ @Test public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + File _file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); // TODO: test validations } /** * uploads an image (required) * - * + * */ @Test public void uploadFileWithRequiredFileTest() { diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java index 8cb33d8fd1697..cb6aefe945998 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -1,9 +1,20 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; /** * API tests for StoreApi @@ -12,7 +23,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } @@ -55,12 +66,12 @@ public void getOrderByIdTest() { /** * Place an order for a pet * - * + * */ @Test public void placeOrderTest() { - Order order = null; - // Order response = api.placeOrder(order); + Order body = null; + // Order response = api.placeOrder(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java index c64cf2a1a68af..ab150fabca41d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,11 +1,21 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; /** * API tests for UserApi @@ -14,7 +24,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } @@ -26,32 +36,32 @@ public void setup() { */ @Test public void createUserTest() { - User user = null; - // api.createUser(user); + User body = null; + // api.createUser(body); // TODO: test validations } /** * Creates list of users with given input array * - * + * */ @Test public void createUsersWithArrayInputTest() { - List user = null; - // api.createUsersWithArrayInput(user); + List<@Valid User> body = null; + // api.createUsersWithArrayInput(body); // TODO: test validations } /** * Creates list of users with given input array * - * + * */ @Test public void createUsersWithListInputTest() { - List user = null; - // api.createUsersWithListInput(user); + List<@Valid User> body = null; + // api.createUsersWithListInput(body); // TODO: test validations } @@ -70,7 +80,7 @@ public void deleteUserTest() { /** * Get user by user name * - * + * */ @Test public void getUserByNameTest() { @@ -82,7 +92,7 @@ public void getUserByNameTest() { /** * Logs user into the system * - * + * */ @Test public void loginUserTest() { @@ -95,7 +105,7 @@ public void loginUserTest() { /** * Logs out current logged in user session * - * + * */ @Test public void logoutUserTest() { @@ -111,8 +121,8 @@ public void logoutUserTest() { @Test public void updateUserTest() { String username = null; - User user = null; - // api.updateUser(username, user); + User body = null; + // api.updateUser(username, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 2b0bd0bbaefef..faacb289c17e7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesAnyType() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index c6dd88eea82c0..b506ff7ae92a9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,29 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesArray() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 9d474c0dd8015..ba65ffedc14f6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesBoolean() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index c6bcc988bf945..72854079e5ed4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,47 +13,119 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } /** - * Test the property 'mapProperty' + * Test the property 'mapString' + */ + @Test + void mapStringTest() { + // TODO: test mapString + } + + /** + * Test the property 'mapNumber' + */ + @Test + void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' */ @Test - public void mapPropertyTest() { - // TODO: test mapProperty + void anytype2Test() { + // TODO: test anytype2 } /** - * Test the property 'mapOfMapProperty' + * Test the property 'anytype3' */ @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty + void anytype3Test() { + // TODO: test anytype3 } } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index bf1b1c427b64c..916c2c2bcb3db 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesInteger() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index b9cb6470e38d5..a099245eec5b1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,29 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -44,7 +43,7 @@ public void testAdditionalPropertiesNumber() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3cbcb8ec3b0ff..d47c9a37d1fef 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 1d3c05075eaaa..3820dd2e23ceb 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -43,7 +42,7 @@ public void testAdditionalPropertiesString() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java index beb02882b30ec..24776d3cb515a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,29 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -43,7 +43,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -51,7 +51,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index ae7970522b15c..6bbe877044db5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -44,7 +44,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 6151b7068b757..eaf908bb1ab79 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -44,7 +44,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 4bb62b6569ae7..99c6bcf536016 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -44,7 +44,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -52,7 +52,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -60,7 +60,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java index 765bd1505128f..20bc4e0d4247a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -44,7 +44,7 @@ public void testBigCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -68,7 +68,7 @@ public void declawedTest() { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java index eae9be7938c95..a0217acd1f202 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -41,7 +40,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -49,7 +48,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -57,7 +56,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -65,7 +64,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -73,7 +72,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -81,7 +80,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java index dcb9f2d4cae6e..1b389a075be0d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -42,7 +44,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +60,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java index 1df27cf03202e..22fcbd7f3ccb9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -41,7 +40,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java index 04eb02f835e2a..6ef5c744fbcbb 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -41,7 +40,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java index 03b6bb41a5293..8028f11bc2b96 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -41,7 +40,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java index 06ac28f804adf..b2a12ab4c5e09 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -42,7 +44,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +60,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 11b5f01985fe7..4a755b0d44251 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,29 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -43,7 +43,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -51,7 +51,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java index cb51ca50c9583..48aa1a737fce7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java index 13122a0cb978b..b06e3eb195d93 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -42,7 +41,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -50,7 +49,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -58,7 +57,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -66,7 +65,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -74,7 +73,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index a6b0d8ff7b057..0048cb2c74977 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,45 +13,46 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java index 097984bdeac41..3060f7f2d56d7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,32 +13,31 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -46,7 +45,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -54,7 +53,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -62,7 +61,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -70,7 +69,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -78,7 +77,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -86,7 +85,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -94,7 +93,7 @@ public void _doubleTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -102,7 +101,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -110,7 +109,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -118,7 +117,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -126,7 +125,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -134,7 +133,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -142,8 +141,16 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } + /** + * Test the property 'bigDecimal' + */ + @Test + void bigDecimalTest() { + // TODO: test bigDecimal + } + } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index 2c4b2470b9830..908f0aff6ed71 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -41,7 +40,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java index 0f08d8c88f07b..3752c5ba31fdc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,28 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -44,7 +42,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -52,7 +50,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -60,7 +58,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -68,7 +66,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 95cd93a316d77..0f47e193af8d6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,33 +13,31 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -47,7 +45,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -55,7 +53,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -63,7 +61,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 1ad55ca32ea6c..5743b70142b84 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -41,7 +40,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 73d28676aeae0..436e4abd59e3c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -41,7 +40,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -49,7 +48,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -57,7 +56,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java index 5b3fde28d4b4d..f128d7b9ac2e7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -43,7 +40,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java index 36755ee2bd6a0..92273f48d2396 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -43,7 +40,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b073fda001402..1c5337654cd45 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -41,7 +40,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java index e81ebc38e6529..1a6aa18fa20da 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -41,7 +40,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -57,7 +56,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -65,7 +64,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 565c8bd0627e8..8623386a5e95e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -42,7 +41,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java index d65ce716e13ed..670c2535646bf 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -42,7 +41,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -58,7 +57,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -66,7 +65,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -74,7 +73,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -82,7 +81,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 49b656a93faff..870a977da9449 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -42,7 +41,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -50,7 +49,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -58,7 +57,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 61154c6d88182..0333ee657a0f2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java index bf6908e4a4556..2e4303f1e4b54 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,31 +13,34 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -45,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -53,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -61,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -69,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -77,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -85,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index e48b31a39fdae..c56da4290fa9c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -41,7 +40,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 1696eee82dad9..9501cf722d66a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -41,7 +40,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java index b37aca5fdfc80..dc9cf9742efa5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -41,7 +40,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 409076e80a3af..7ee75c3573150 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -44,7 +44,7 @@ public void testTypeHolderDefault() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -52,7 +52,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -60,7 +60,7 @@ public void numberItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -68,7 +68,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -76,7 +76,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index ffd8f3ddc33e9..5c77882f50079 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -44,7 +44,7 @@ public void testTypeHolderExample() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -52,15 +52,23 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } + /** + * Test the property 'floatItem' + */ + @Test + void floatItemTest() { + // TODO: test floatItem + } + /** * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -68,7 +76,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -76,7 +84,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java index 76733c9e72f28..69d274133b976 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -41,7 +40,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -57,7 +56,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -65,7 +64,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -73,7 +72,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -81,7 +80,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -89,7 +88,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -97,7 +96,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java index 55e75391e00e9..d2e45fadf56c6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -44,7 +44,7 @@ public void testXmlItem() { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -52,7 +52,7 @@ public void attributeStringTest() { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -60,7 +60,7 @@ public void attributeNumberTest() { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -68,7 +68,7 @@ public void attributeIntegerTest() { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -76,7 +76,7 @@ public void attributeBooleanTest() { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -84,7 +84,7 @@ public void wrappedArrayTest() { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -92,7 +92,7 @@ public void nameStringTest() { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -100,7 +100,7 @@ public void nameNumberTest() { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -108,7 +108,7 @@ public void nameIntegerTest() { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -116,7 +116,7 @@ public void nameBooleanTest() { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -124,7 +124,7 @@ public void nameArrayTest() { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -132,7 +132,7 @@ public void nameWrappedArrayTest() { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -140,7 +140,7 @@ public void prefixStringTest() { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -148,7 +148,7 @@ public void prefixNumberTest() { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -156,7 +156,7 @@ public void prefixIntegerTest() { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -164,7 +164,7 @@ public void prefixBooleanTest() { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -172,7 +172,7 @@ public void prefixArrayTest() { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -180,7 +180,7 @@ public void prefixWrappedArrayTest() { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -188,7 +188,7 @@ public void namespaceStringTest() { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -196,7 +196,7 @@ public void namespaceNumberTest() { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -204,7 +204,7 @@ public void namespaceIntegerTest() { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -212,7 +212,7 @@ public void namespaceBooleanTest() { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -220,56 +220,56 @@ public void namespaceArrayTest() { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } /** - * Test the property 'prefixNamespaceString' + * Test the property 'prefixNsString' */ @Test - public void prefixNamespaceStringTest() { - // TODO: test prefixNamespaceString + void prefixNsStringTest() { + // TODO: test prefixNsString } /** - * Test the property 'prefixNamespaceNumber' + * Test the property 'prefixNsNumber' */ @Test - public void prefixNamespaceNumberTest() { - // TODO: test prefixNamespaceNumber + void prefixNsNumberTest() { + // TODO: test prefixNsNumber } /** - * Test the property 'prefixNamespaceInteger' + * Test the property 'prefixNsInteger' */ @Test - public void prefixNamespaceIntegerTest() { - // TODO: test prefixNamespaceInteger + void prefixNsIntegerTest() { + // TODO: test prefixNsInteger } /** - * Test the property 'prefixNamespaceBoolean' + * Test the property 'prefixNsBoolean' */ @Test - public void prefixNamespaceBooleanTest() { - // TODO: test prefixNamespaceBoolean + void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean } /** - * Test the property 'prefixNamespaceArray' + * Test the property 'prefixNsArray' */ @Test - public void prefixNamespaceArrayTest() { - // TODO: test prefixNamespaceArray + void prefixNsArrayTest() { + // TODO: test prefixNsArray } /** - * Test the property 'prefixNamespaceWrappedArray' + * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNamespaceWrappedArrayTest() { - // TODO: test prefixNamespaceWrappedArray + void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray } } diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index 1a891a2ef8008..d64edfad0255c 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -101,7 +101,7 @@ ext { retrofit_version = "2.3.0" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" json_fire_version = "1.9.0" } @@ -116,5 +116,5 @@ dependencies { } implementation "io.gsonfire:gson-fire:$json_fire_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2/build.sbt b/samples/client/petstore/java/retrofit2/build.sbt index 1a2ae1ec441d3..06a3a304b698a 100644 --- a/samples/client/petstore/java/retrofit2/build.sbt +++ b/samples/client/petstore/java/retrofit2/build.sbt @@ -16,7 +16,7 @@ lazy val root = (project in file(".")). "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 27a703dff5653..e171f87669096 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -249,8 +249,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -265,6 +265,6 @@ 2.5.0 1.3.5 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 1d45ba717a26b..ac000a3d22aff 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -2,9 +2,13 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -25,12 +29,13 @@ public void setup() { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number */ @Test - public void testSpecialTagsTest() { - Client client = null; - // Client response = api.testSpecialTags(client); + public void call123testSpecialTagsTest() { + UUID uuidTest = null; + Client body = null; + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java index eaff766c5d561..896c594ae92e7 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,10 +5,14 @@ import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.openapitools.client.model.XmlItem; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -24,11 +28,23 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } + /** + * creates an XmlItem + * + * this route creates an XmlItem + */ + @Test + public void createXmlItemTest() { + XmlItem xmlItem = null; + // api.createXmlItem(xmlItem); + + // TODO: test validations + } /** * * @@ -48,8 +64,8 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + OuterComposite body = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(body); // TODO: test validations } @@ -84,8 +100,8 @@ public void fakeOuterStringSerializeTest() { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - // api.testBodyWithFileSchema(fileSchemaTestClass); + FileSchemaTestClass body = null; + // api.testBodyWithFileSchema(body); // TODO: test validations } @@ -97,8 +113,8 @@ public void testBodyWithFileSchemaTest() { @Test public void testBodyWithQueryParamsTest() { String query = null; - User user = null; - // api.testBodyWithQueryParams(query, user); + User body = null; + // api.testBodyWithQueryParams(query, body); // TODO: test validations } @@ -109,15 +125,15 @@ public void testBodyWithQueryParamsTest() { */ @Test public void testClientModelTest() { - Client client = null; - // Client response = api.testClientModel(client); + Client body = null; + // Client response = api.testClientModel(body); // TODO: test validations } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ @Test public void testEndpointParametersTest() { @@ -182,8 +198,8 @@ public void testGroupParametersTest() { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - // api.testInlineAdditionalProperties(requestBody); + Map param = null; + // api.testInlineAdditionalProperties(param); // TODO: test validations } @@ -198,6 +214,22 @@ public void testJsonFormDataTest() { String param2 = null; // api.testJsonFormData(param, param2); + // TODO: test validations + } + /** + * + * + * To test the collection format in query parameters + */ + @Test + public void testQueryParameterCollectionFormatTest() { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6e32cc2848147..3bde721991882 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -2,9 +2,12 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } @@ -29,8 +32,8 @@ public void setup() { */ @Test public void testClassnameTest() { - Client client = null; - // Client response = api.testClassname(client); + Client body = null; + // Client response = api.testClassname(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java index 65eed9391e988..c9cf0ff38e4b1 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -4,9 +4,13 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Before; -import org.junit.Test; +import java.util.Set; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -19,7 +23,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -31,8 +35,8 @@ public void setup() { */ @Test public void addPetTest() { - Pet pet = null; - // api.addPet(pet); + Pet body = null; + // api.addPet(body); // TODO: test validations } @@ -68,8 +72,8 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { - List tags = null; - // List response = api.findPetsByTags(tags); + Set tags = null; + // Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -92,8 +96,8 @@ public void getPetByIdTest() { */ @Test public void updatePetTest() { - Pet pet = null; - // api.updatePet(pet); + Pet body = null; + // api.updatePet(body); // TODO: test validations } @@ -120,8 +124,22 @@ public void updatePetWithFormTest() { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + File _file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + + // TODO: test validations + } + /** + * uploads an image (required) + * + * + */ + @Test + public void uploadFileWithRequiredFileTest() { + Long petId = null; + File requiredFile = null; + String additionalMetadata = null; + // ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java index 2f72f617c3abb..3a00aa1b95e37 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -2,9 +2,12 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } @@ -64,8 +67,8 @@ public void getOrderByIdTest() { */ @Test public void placeOrderTest() { - Order order = null; - // Order response = api.placeOrder(order); + Order body = null; + // Order response = api.placeOrder(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java index 9174f6d02508f..a269d4fc6b117 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,10 +1,14 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } @@ -29,8 +33,8 @@ public void setup() { */ @Test public void createUserTest() { - User user = null; - // api.createUser(user); + User body = null; + // api.createUser(body); // TODO: test validations } @@ -41,8 +45,8 @@ public void createUserTest() { */ @Test public void createUsersWithArrayInputTest() { - List user = null; - // api.createUsersWithArrayInput(user); + List body = null; + // api.createUsersWithArrayInput(body); // TODO: test validations } @@ -53,8 +57,8 @@ public void createUsersWithArrayInputTest() { */ @Test public void createUsersWithListInputTest() { - List user = null; - // api.createUsersWithListInput(user); + List body = null; + // api.createUsersWithListInput(body); // TODO: test validations } @@ -114,8 +118,8 @@ public void logoutUserTest() { @Test public void updateUserTest() { String username = null; - User user = null; - // api.updateUser(username, user); + User body = null; + // api.updateUser(username, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 656f057716158..04fa4f5b6d9af 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesAnyType() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 4c5bdc4ffad6b..80dc3fcbd43d5 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -47,7 +44,7 @@ public void testAdditionalPropertiesArray() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index de976999c6339..ca1046a0fc825 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesBoolean() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 3c18ad38c7e37..3c34271bf0dce 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,45 +18,115 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } /** - * Test the property 'mapProperty' + * Test the property 'mapString' + */ + @Test + void mapStringTest() { + // TODO: test mapString + } + + /** + * Test the property 'mapNumber' + */ + @Test + void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' */ @Test - public void mapPropertyTest() { - // TODO: test mapProperty + void anytype2Test() { + // TODO: test anytype2 } /** - * Test the property 'mapOfMapProperty' + * Test the property 'anytype3' */ @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty + void anytype3Test() { + // TODO: test anytype3 } } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 712e0c131b12b..e9f37e84ecda9 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesInteger() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index a2039fa83a552..3d6ac0eec2591 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -47,7 +44,7 @@ public void testAdditionalPropertiesNumber() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3c9fe9323b851..47389e5fd5475 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 3a3942ab84d60..162ae6f2edd62 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesString() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java index 30ed464f5e1d2..e8508c4319b85 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -44,7 +41,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +49,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 7094752605059..9d8fb3480f6e6 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -47,7 +45,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 2f88d6ad4b9bf..ef70479bb3ce3 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -47,7 +45,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 3182aa654811f..f5c7ed8752f93 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -47,7 +45,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -55,7 +53,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -63,7 +61,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d893..aa1db2031da5b 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -42,7 +42,7 @@ public void testBigCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public void declawedTest() { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 1d029ba7c5049..eda1830e0c01f 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -44,7 +41,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -52,7 +49,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -60,7 +57,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -68,7 +65,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -76,7 +73,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -84,7 +81,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java index 718bb5b6baf6f..6e38fb46e73d4 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -45,7 +42,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java index 79374c54e6f3e..4ac631b1e8c4f 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -44,7 +41,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java index 4c66db89c4f6c..aa381b709d903 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -44,7 +41,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java index 1a9f6d6fc9e71..95f0e2d39d2c8 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -44,7 +41,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java index 8392c17456478..f65ec9fbebe98 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -45,7 +42,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java index a116bb028fc87..1175d0a96ec83 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -46,7 +44,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -54,7 +52,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java index 97855ba723a19..cb2a9c6949874 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java index d43e3cace6dad..b097f85302d21 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -45,7 +42,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -53,7 +50,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -61,7 +58,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -69,7 +66,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -77,7 +74,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index a960673c61695..08d51e19dad08 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,43 +18,42 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java index c6ffb82e15b58..bcdcaf9dd061c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,27 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -47,7 +46,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -55,7 +54,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -63,7 +62,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -71,7 +70,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -79,7 +78,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -87,7 +86,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -95,7 +94,7 @@ public void _doubleTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -103,7 +102,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -111,7 +110,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -119,7 +118,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -127,7 +126,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -135,7 +134,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -143,8 +142,16 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } + /** + * Test the property 'bigDecimal' + */ + @Test + void bigDecimalTest() { + // TODO: test bigDecimal + } + } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index d854c0c9daf21..01be6b15413ca 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -44,7 +41,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,7 +49,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java index 9f78d486659fe..d9b643e6b43d0 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -47,7 +43,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -55,7 +51,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -63,7 +59,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -71,7 +67,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f9229a1a76b44..0d57da0126e78 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,30 +18,27 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -49,7 +46,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -57,7 +54,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -65,7 +62,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dcea58773348d..ecae6e0f4370a 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -44,7 +41,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 46b8648fdccfe..bb4aa91a78caf 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -44,7 +41,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -52,7 +49,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -60,7 +57,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java index 132012d4c3877..973730324cc8e 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -44,7 +41,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java index d3ed2075e9a46..bdba8c46a91be 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -44,7 +41,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 4135ead568640..ae4eaf6295f7f 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -44,7 +41,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java index bdc04b000c186..f35cf4746e52c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -44,7 +41,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -60,7 +57,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -68,7 +65,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 214a6d4538dc6..16ed327afed80 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -45,7 +42,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java index b97d88a4de21e..439814c48b16e 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -44,7 +42,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +50,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -60,7 +58,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -68,7 +66,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -76,7 +74,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -84,7 +82,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 710bfedd58050..cf76f8e58d065 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -45,7 +42,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -53,7 +50,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -61,7 +58,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 064f84b3ff607..4110989633b98 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java index 4e8e4c65827ef..82448ec23687a 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,29 +18,29 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index c89b608f60967..72101f74b6188 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -44,7 +41,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,7 +49,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index d058c884e4935..dfc2065188db9 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -44,7 +41,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java index 27acc7ce8e770..36eea1ddb7bfc 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -44,7 +41,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index f120407395a8c..3f8ac3d4a3fc5 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -47,7 +45,7 @@ public void testTypeHolderDefault() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public void numberItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +69,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +77,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 5e99dff0caefe..e0a7a0d614ceb 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -47,7 +45,7 @@ public void testTypeHolderExample() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,15 +53,23 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } + /** + * Test the property 'floatItem' + */ + @Test + void floatItemTest() { + // TODO: test floatItem + } + /** * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +77,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +85,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java index da1c9bda4b5d6..5163783cfdc1d 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -44,7 +41,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -60,7 +57,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -68,7 +65,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -76,7 +73,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -84,7 +81,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -92,7 +89,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -100,7 +97,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java index 5e861e1862103..3cfe59d203cd3 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -47,7 +45,7 @@ public void testXmlItem() { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -55,7 +53,7 @@ public void attributeStringTest() { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -63,7 +61,7 @@ public void attributeNumberTest() { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -71,7 +69,7 @@ public void attributeIntegerTest() { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -79,7 +77,7 @@ public void attributeBooleanTest() { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -87,7 +85,7 @@ public void wrappedArrayTest() { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -95,7 +93,7 @@ public void nameStringTest() { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -103,7 +101,7 @@ public void nameNumberTest() { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -111,7 +109,7 @@ public void nameIntegerTest() { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -119,7 +117,7 @@ public void nameBooleanTest() { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -127,7 +125,7 @@ public void nameArrayTest() { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -135,7 +133,7 @@ public void nameWrappedArrayTest() { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -143,7 +141,7 @@ public void prefixStringTest() { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -151,7 +149,7 @@ public void prefixNumberTest() { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -159,7 +157,7 @@ public void prefixIntegerTest() { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -167,7 +165,7 @@ public void prefixBooleanTest() { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -175,7 +173,7 @@ public void prefixArrayTest() { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -183,7 +181,7 @@ public void prefixWrappedArrayTest() { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -191,7 +189,7 @@ public void namespaceStringTest() { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -199,7 +197,7 @@ public void namespaceNumberTest() { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -207,7 +205,7 @@ public void namespaceIntegerTest() { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -215,7 +213,7 @@ public void namespaceBooleanTest() { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -223,56 +221,56 @@ public void namespaceArrayTest() { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } /** - * Test the property 'prefixNamespaceString' + * Test the property 'prefixNsString' */ @Test - public void prefixNamespaceStringTest() { - // TODO: test prefixNamespaceString + void prefixNsStringTest() { + // TODO: test prefixNsString } /** - * Test the property 'prefixNamespaceNumber' + * Test the property 'prefixNsNumber' */ @Test - public void prefixNamespaceNumberTest() { - // TODO: test prefixNamespaceNumber + void prefixNsNumberTest() { + // TODO: test prefixNsNumber } /** - * Test the property 'prefixNamespaceInteger' + * Test the property 'prefixNsInteger' */ @Test - public void prefixNamespaceIntegerTest() { - // TODO: test prefixNamespaceInteger + void prefixNsIntegerTest() { + // TODO: test prefixNsInteger } /** - * Test the property 'prefixNamespaceBoolean' + * Test the property 'prefixNsBoolean' */ @Test - public void prefixNamespaceBooleanTest() { - // TODO: test prefixNamespaceBoolean + void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean } /** - * Test the property 'prefixNamespaceArray' + * Test the property 'prefixNsArray' */ @Test - public void prefixNamespaceArrayTest() { - // TODO: test prefixNamespaceArray + void prefixNsArrayTest() { + // TODO: test prefixNsArray } /** - * Test the property 'prefixNamespaceWrappedArray' + * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNamespaceWrappedArrayTest() { - // TODO: test prefixNamespaceWrappedArray + void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray } } diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 4bad500d2424f..f55f6d44fe93b 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -101,7 +101,7 @@ ext { retrofit_version = "2.3.0" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" rx_java_version = "2.1.1" json_fire_version = "1.9.0" } @@ -119,5 +119,5 @@ dependencies { } implementation "io.gsonfire:gson-fire:$json_fire_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2rx2/build.sbt b/samples/client/petstore/java/retrofit2rx2/build.sbt index 872d126e7c5fe..1fc10a88b7a6d 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.sbt +++ b/samples/client/petstore/java/retrofit2rx2/build.sbt @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index 283c5647bd8b2..8ee5b1ab864ad 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -259,8 +259,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -276,6 +276,6 @@ 2.1.1 1.3.5 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 1d45ba717a26b..ac000a3d22aff 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -2,9 +2,13 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -25,12 +29,13 @@ public void setup() { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number */ @Test - public void testSpecialTagsTest() { - Client client = null; - // Client response = api.testSpecialTags(client); + public void call123testSpecialTagsTest() { + UUID uuidTest = null; + Client body = null; + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java index 82a96b9818b3e..896c594ae92e7 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -9,9 +9,13 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.openapitools.client.model.XmlItem; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -24,11 +28,23 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } + /** + * creates an XmlItem + * + * this route creates an XmlItem + */ + @Test + public void createXmlItemTest() { + XmlItem xmlItem = null; + // api.createXmlItem(xmlItem); + + // TODO: test validations + } /** * * @@ -48,8 +64,8 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + OuterComposite body = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(body); // TODO: test validations } @@ -84,8 +100,8 @@ public void fakeOuterStringSerializeTest() { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - // api.testBodyWithFileSchema(fileSchemaTestClass); + FileSchemaTestClass body = null; + // api.testBodyWithFileSchema(body); // TODO: test validations } @@ -97,8 +113,8 @@ public void testBodyWithFileSchemaTest() { @Test public void testBodyWithQueryParamsTest() { String query = null; - User user = null; - // api.testBodyWithQueryParams(query, user); + User body = null; + // api.testBodyWithQueryParams(query, body); // TODO: test validations } @@ -109,15 +125,15 @@ public void testBodyWithQueryParamsTest() { */ @Test public void testClientModelTest() { - Client client = null; - // Client response = api.testClientModel(client); + Client body = null; + // Client response = api.testClientModel(body); // TODO: test validations } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ @Test public void testEndpointParametersTest() { @@ -182,8 +198,8 @@ public void testGroupParametersTest() { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - // api.testInlineAdditionalProperties(requestBody); + Map param = null; + // api.testInlineAdditionalProperties(param); // TODO: test validations } @@ -198,6 +214,22 @@ public void testJsonFormDataTest() { String param2 = null; // api.testJsonFormData(param, param2); + // TODO: test validations + } + /** + * + * + * To test the collection format in query parameters + */ + @Test + public void testQueryParameterCollectionFormatTest() { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6e32cc2848147..3bde721991882 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -2,9 +2,12 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } @@ -29,8 +32,8 @@ public void setup() { */ @Test public void testClassnameTest() { - Client client = null; - // Client response = api.testClassname(client); + Client body = null; + // Client response = api.testClassname(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java index 65eed9391e988..c9cf0ff38e4b1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -4,9 +4,13 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Before; -import org.junit.Test; +import java.util.Set; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -19,7 +23,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -31,8 +35,8 @@ public void setup() { */ @Test public void addPetTest() { - Pet pet = null; - // api.addPet(pet); + Pet body = null; + // api.addPet(body); // TODO: test validations } @@ -68,8 +72,8 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { - List tags = null; - // List response = api.findPetsByTags(tags); + Set tags = null; + // Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -92,8 +96,8 @@ public void getPetByIdTest() { */ @Test public void updatePetTest() { - Pet pet = null; - // api.updatePet(pet); + Pet body = null; + // api.updatePet(body); // TODO: test validations } @@ -120,8 +124,22 @@ public void updatePetWithFormTest() { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + File _file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + + // TODO: test validations + } + /** + * uploads an image (required) + * + * + */ + @Test + public void uploadFileWithRequiredFileTest() { + Long petId = null; + File requiredFile = null; + String additionalMetadata = null; + // ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java index 2f72f617c3abb..3a00aa1b95e37 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -2,9 +2,12 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } @@ -64,8 +67,8 @@ public void getOrderByIdTest() { */ @Test public void placeOrderTest() { - Order order = null; - // Order response = api.placeOrder(order); + Order body = null; + // Order response = api.placeOrder(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java index 9174f6d02508f..a269d4fc6b117 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,10 +1,14 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } @@ -29,8 +33,8 @@ public void setup() { */ @Test public void createUserTest() { - User user = null; - // api.createUser(user); + User body = null; + // api.createUser(body); // TODO: test validations } @@ -41,8 +45,8 @@ public void createUserTest() { */ @Test public void createUsersWithArrayInputTest() { - List user = null; - // api.createUsersWithArrayInput(user); + List body = null; + // api.createUsersWithArrayInput(body); // TODO: test validations } @@ -53,8 +57,8 @@ public void createUsersWithArrayInputTest() { */ @Test public void createUsersWithListInputTest() { - List user = null; - // api.createUsersWithListInput(user); + List body = null; + // api.createUsersWithListInput(body); // TODO: test validations } @@ -114,8 +118,8 @@ public void logoutUserTest() { @Test public void updateUserTest() { String username = null; - User user = null; - // api.updateUser(username, user); + User body = null; + // api.updateUser(username, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 656f057716158..04fa4f5b6d9af 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesAnyType() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 4c5bdc4ffad6b..80dc3fcbd43d5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -47,7 +44,7 @@ public void testAdditionalPropertiesArray() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index de976999c6339..ca1046a0fc825 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesBoolean() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 3c18ad38c7e37..3c34271bf0dce 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,45 +18,115 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } /** - * Test the property 'mapProperty' + * Test the property 'mapString' + */ + @Test + void mapStringTest() { + // TODO: test mapString + } + + /** + * Test the property 'mapNumber' + */ + @Test + void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' */ @Test - public void mapPropertyTest() { - // TODO: test mapProperty + void anytype2Test() { + // TODO: test anytype2 } /** - * Test the property 'mapOfMapProperty' + * Test the property 'anytype3' */ @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty + void anytype3Test() { + // TODO: test anytype3 } } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 712e0c131b12b..e9f37e84ecda9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesInteger() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index a2039fa83a552..3d6ac0eec2591 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -47,7 +44,7 @@ public void testAdditionalPropertiesNumber() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3c9fe9323b851..47389e5fd5475 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 3a3942ab84d60..162ae6f2edd62 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesString() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java index 30ed464f5e1d2..e8508c4319b85 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -44,7 +41,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +49,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 7094752605059..9d8fb3480f6e6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -47,7 +45,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 2f88d6ad4b9bf..ef70479bb3ce3 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -47,7 +45,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 3182aa654811f..f5c7ed8752f93 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -47,7 +45,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -55,7 +53,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -63,7 +61,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d893..aa1db2031da5b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -42,7 +42,7 @@ public void testBigCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public void declawedTest() { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 1d029ba7c5049..eda1830e0c01f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -44,7 +41,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -52,7 +49,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -60,7 +57,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -68,7 +65,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -76,7 +73,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -84,7 +81,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java index 718bb5b6baf6f..6e38fb46e73d4 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -45,7 +42,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java index 79374c54e6f3e..4ac631b1e8c4f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -44,7 +41,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java index 4c66db89c4f6c..aa381b709d903 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -44,7 +41,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java index 1a9f6d6fc9e71..95f0e2d39d2c8 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -44,7 +41,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java index 8392c17456478..f65ec9fbebe98 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -45,7 +42,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java index a116bb028fc87..1175d0a96ec83 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -46,7 +44,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -54,7 +52,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java index 97855ba723a19..cb2a9c6949874 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java index d43e3cace6dad..b097f85302d21 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -45,7 +42,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -53,7 +50,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -61,7 +58,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -69,7 +66,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -77,7 +74,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index a960673c61695..08d51e19dad08 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,43 +18,42 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java index 324f11ac4580d..bcdcaf9dd061c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,30 +18,27 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.io.IOException; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -49,7 +46,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -57,7 +54,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -65,7 +62,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -73,7 +70,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -81,7 +78,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -89,7 +86,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -97,7 +94,7 @@ public void _doubleTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -105,7 +102,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -113,7 +110,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -121,7 +118,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -129,7 +126,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -137,7 +134,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -145,8 +142,16 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } + /** + * Test the property 'bigDecimal' + */ + @Test + void bigDecimalTest() { + // TODO: test bigDecimal + } + } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index d854c0c9daf21..01be6b15413ca 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -44,7 +41,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,7 +49,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java index 9f78d486659fe..d9b643e6b43d0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -47,7 +43,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -55,7 +51,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -63,7 +59,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -71,7 +67,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index af2d1b2db303c..0d57da0126e78 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,31 +18,27 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -50,7 +46,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -58,7 +54,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -66,7 +62,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dcea58773348d..ecae6e0f4370a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -44,7 +41,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 46b8648fdccfe..bb4aa91a78caf 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -44,7 +41,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -52,7 +49,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -60,7 +57,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java index 132012d4c3877..973730324cc8e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -44,7 +41,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java index d3ed2075e9a46..bdba8c46a91be 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -44,7 +41,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 4135ead568640..ae4eaf6295f7f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -44,7 +41,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java index bdc04b000c186..f35cf4746e52c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -44,7 +41,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -60,7 +57,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -68,7 +65,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 214a6d4538dc6..16ed327afed80 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -45,7 +42,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java index 266bb3290d5f9..439814c48b16e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -45,7 +42,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -53,7 +50,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -61,7 +58,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -69,7 +66,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -77,7 +74,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -85,7 +82,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 710bfedd58050..cf76f8e58d065 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -45,7 +42,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -53,7 +50,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -61,7 +58,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 064f84b3ff607..4110989633b98 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java index 4e8e4c65827ef..82448ec23687a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,29 +18,29 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index c89b608f60967..72101f74b6188 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -44,7 +41,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,7 +49,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index d058c884e4935..dfc2065188db9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -44,7 +41,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java index 27acc7ce8e770..36eea1ddb7bfc 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -44,7 +41,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index f120407395a8c..3f8ac3d4a3fc5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -47,7 +45,7 @@ public void testTypeHolderDefault() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public void numberItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +69,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +77,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 5e99dff0caefe..e0a7a0d614ceb 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -47,7 +45,7 @@ public void testTypeHolderExample() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,15 +53,23 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } + /** + * Test the property 'floatItem' + */ + @Test + void floatItemTest() { + // TODO: test floatItem + } + /** * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +77,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +85,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java index da1c9bda4b5d6..5163783cfdc1d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -44,7 +41,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -60,7 +57,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -68,7 +65,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -76,7 +73,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -84,7 +81,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -92,7 +89,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -100,7 +97,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java index 5e861e1862103..3cfe59d203cd3 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -2,7 +2,7 @@ * 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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -47,7 +45,7 @@ public void testXmlItem() { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -55,7 +53,7 @@ public void attributeStringTest() { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -63,7 +61,7 @@ public void attributeNumberTest() { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -71,7 +69,7 @@ public void attributeIntegerTest() { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -79,7 +77,7 @@ public void attributeBooleanTest() { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -87,7 +85,7 @@ public void wrappedArrayTest() { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -95,7 +93,7 @@ public void nameStringTest() { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -103,7 +101,7 @@ public void nameNumberTest() { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -111,7 +109,7 @@ public void nameIntegerTest() { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -119,7 +117,7 @@ public void nameBooleanTest() { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -127,7 +125,7 @@ public void nameArrayTest() { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -135,7 +133,7 @@ public void nameWrappedArrayTest() { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -143,7 +141,7 @@ public void prefixStringTest() { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -151,7 +149,7 @@ public void prefixNumberTest() { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -159,7 +157,7 @@ public void prefixIntegerTest() { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -167,7 +165,7 @@ public void prefixBooleanTest() { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -175,7 +173,7 @@ public void prefixArrayTest() { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -183,7 +181,7 @@ public void prefixWrappedArrayTest() { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -191,7 +189,7 @@ public void namespaceStringTest() { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -199,7 +197,7 @@ public void namespaceNumberTest() { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -207,7 +205,7 @@ public void namespaceIntegerTest() { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -215,7 +213,7 @@ public void namespaceBooleanTest() { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -223,56 +221,56 @@ public void namespaceArrayTest() { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } /** - * Test the property 'prefixNamespaceString' + * Test the property 'prefixNsString' */ @Test - public void prefixNamespaceStringTest() { - // TODO: test prefixNamespaceString + void prefixNsStringTest() { + // TODO: test prefixNsString } /** - * Test the property 'prefixNamespaceNumber' + * Test the property 'prefixNsNumber' */ @Test - public void prefixNamespaceNumberTest() { - // TODO: test prefixNamespaceNumber + void prefixNsNumberTest() { + // TODO: test prefixNsNumber } /** - * Test the property 'prefixNamespaceInteger' + * Test the property 'prefixNsInteger' */ @Test - public void prefixNamespaceIntegerTest() { - // TODO: test prefixNamespaceInteger + void prefixNsIntegerTest() { + // TODO: test prefixNsInteger } /** - * Test the property 'prefixNamespaceBoolean' + * Test the property 'prefixNsBoolean' */ @Test - public void prefixNamespaceBooleanTest() { - // TODO: test prefixNamespaceBoolean + void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean } /** - * Test the property 'prefixNamespaceArray' + * Test the property 'prefixNsArray' */ @Test - public void prefixNamespaceArrayTest() { - // TODO: test prefixNamespaceArray + void prefixNsArrayTest() { + // TODO: test prefixNsArray } /** - * Test the property 'prefixNamespaceWrappedArray' + * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNamespaceWrappedArrayTest() { - // TODO: test prefixNamespaceWrappedArray + void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray } } diff --git a/samples/client/petstore/java/retrofit2rx3/build.gradle b/samples/client/petstore/java/retrofit2rx3/build.gradle index 29bfb6738e9d3..5dd9b794a14d3 100644 --- a/samples/client/petstore/java/retrofit2rx3/build.gradle +++ b/samples/client/petstore/java/retrofit2rx3/build.gradle @@ -101,7 +101,7 @@ ext { retrofit_version = "2.3.0" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" rx_java_version = "3.0.4" json_fire_version = "1.9.0" } @@ -119,5 +119,5 @@ dependencies { } implementation "io.gsonfire:gson-fire:$json_fire_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2rx3/build.sbt b/samples/client/petstore/java/retrofit2rx3/build.sbt index d95ca2d5e8902..55c8701734480 100644 --- a/samples/client/petstore/java/retrofit2rx3/build.sbt +++ b/samples/client/petstore/java/retrofit2rx3/build.sbt @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/samples/client/petstore/java/retrofit2rx3/pom.xml b/samples/client/petstore/java/retrofit2rx3/pom.xml index 5546912ccb141..508fd7747cd70 100644 --- a/samples/client/petstore/java/retrofit2rx3/pom.xml +++ b/samples/client/petstore/java/retrofit2rx3/pom.xml @@ -259,8 +259,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -276,6 +276,6 @@ 3.0.4 1.3.5 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index d53aa9ca73518..ac000a3d22aff 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -2,9 +2,13 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -29,8 +33,9 @@ public void setup() { */ @Test public void call123testSpecialTagsTest() { + UUID uuidTest = null; Client body = null; - // Client response = api.call123testSpecialTags(body); + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java index a18414831d45c..896c594ae92e7 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -10,9 +10,12 @@ import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,7 +28,7 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6fb41f046eef3..3bde721991882 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -2,9 +2,12 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java index 5061b45f8c6dd..c9cf0ff38e4b1 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -5,9 +5,12 @@ import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -20,7 +23,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -121,8 +124,8 @@ public void updatePetWithFormTest() { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + File _file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java index e02a6df70825c..3a00aa1b95e37 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -2,9 +2,12 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java index 8fb13a9389962..a269d4fc6b117 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,10 +1,14 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 5507437bbe464..04fa4f5b6d9af 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesAnyType() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index d770842e2c32c..80dc3fcbd43d5 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -18,28 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -47,7 +44,7 @@ public void testAdditionalPropertiesArray() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 17ad4aa94d878..ca1046a0fc825 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesBoolean() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 19f1a8fe7aabf..3c34271bf0dce 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -18,29 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -48,7 +45,7 @@ public void testAdditionalPropertiesClass() { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -56,7 +53,7 @@ public void mapStringTest() { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -64,7 +61,7 @@ public void mapNumberTest() { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -72,7 +69,7 @@ public void mapIntegerTest() { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -80,7 +77,7 @@ public void mapBooleanTest() { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -88,7 +85,7 @@ public void mapArrayIntegerTest() { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -96,7 +93,7 @@ public void mapArrayAnytypeTest() { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -104,7 +101,7 @@ public void mapMapStringTest() { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -112,7 +109,7 @@ public void mapMapAnytypeTest() { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -120,7 +117,7 @@ public void anytype1Test() { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -128,7 +125,7 @@ public void anytype2Test() { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index e6efde8fed97a..e9f37e84ecda9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesInteger() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 01433159e0f02..3d6ac0eec2591 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -18,28 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -47,7 +44,7 @@ public void testAdditionalPropertiesNumber() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index a307b7604d815..47389e5fd5475 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 6a66b95c7b469..162ae6f2edd62 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -18,27 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesString() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java index 340abc2587a1d..e8508c4319b85 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -18,28 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -47,7 +41,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,7 +49,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index d0e66d293541b..9d8fb3480f6e6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -47,7 +45,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 9afc3397f46c8..ef70479bb3ce3 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -47,7 +45,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java index fab9a30565f37..f5c7ed8752f93 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -47,7 +45,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -55,7 +53,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -63,7 +61,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d893..aa1db2031da5b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -42,7 +42,7 @@ public void testBigCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public void declawedTest() { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java index ced4f48eb5f9d..eda1830e0c01f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -44,7 +41,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -52,7 +49,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -60,7 +57,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -68,7 +65,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -76,7 +73,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -84,7 +81,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java index e26c6db5da98f..6e38fb46e73d4 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java @@ -18,27 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -46,7 +42,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -62,7 +58,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java index a6efa6e1fbc6a..4ac631b1e8c4f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -44,7 +41,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java index 1233feec65ec0..aa381b709d903 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -44,7 +41,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java index 456fab74c4d79..95f0e2d39d2c8 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -44,7 +41,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java index b2e427523bc4e..f65ec9fbebe98 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -45,7 +42,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java index c25b05e9f0d14..1175d0a96ec83 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -18,27 +18,25 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -46,7 +44,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -54,7 +52,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java index 329454658e33a..cb2a9c6949874 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java index 8b76ef5560611..b097f85302d21 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -45,7 +42,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -53,7 +50,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -61,7 +58,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -69,7 +66,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -77,7 +74,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 0ca366212088c..08d51e19dad08 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -18,43 +18,42 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java index 9c600e488b5f1..bcdcaf9dd061c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -18,30 +18,27 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.io.IOException; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -49,7 +46,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -57,7 +54,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -65,7 +62,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -73,7 +70,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -81,7 +78,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -89,7 +86,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -97,7 +94,7 @@ public void _doubleTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -105,7 +102,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -113,7 +110,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -121,7 +118,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -129,7 +126,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -137,7 +134,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -145,7 +142,7 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -153,7 +150,7 @@ public void passwordTest() { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index 0272d7b80004c..01be6b15413ca 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -44,7 +41,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,7 +49,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java index f86a1303fc88c..d9b643e6b43d0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -18,28 +18,24 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -47,7 +43,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -55,7 +51,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -63,7 +59,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -71,7 +67,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 3a23e8217ba45..0d57da0126e78 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -18,31 +18,27 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -50,7 +46,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -58,7 +54,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -66,7 +62,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index d81fa5a0f6697..ecae6e0f4370a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -44,7 +41,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 91bd8fada2607..bb4aa91a78caf 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -44,7 +41,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -52,7 +49,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -60,7 +57,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java index 132012d4c3877..973730324cc8e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -44,7 +41,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java index d3ed2075e9a46..bdba8c46a91be 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -44,7 +41,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java index f317fef485ea9..ae4eaf6295f7f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -44,7 +41,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java index 1ed41a0f80c79..f35cf4746e52c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -44,7 +41,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -60,7 +57,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -68,7 +65,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 15b74f7ef8bff..16ed327afed80 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -45,7 +42,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java index 8bad0b69dc3ea..439814c48b16e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -45,7 +42,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -53,7 +50,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -61,7 +58,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -69,7 +66,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -77,7 +74,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -85,7 +82,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 67ee59963636b..cf76f8e58d065 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -18,26 +18,23 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -45,7 +42,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -53,7 +50,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -61,7 +58,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 220d40e83cbbe..4110989633b98 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java index 8acfe87f62c13..82448ec23687a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java @@ -18,31 +18,29 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -50,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -58,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -66,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -74,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -82,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -90,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 2dc9cb2ae2cd6..72101f74b6188 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -44,7 +41,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,7 +49,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index bcf23eb3cbc80..dfc2065188db9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -44,7 +41,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java index 83f536d2fa395..36eea1ddb7bfc 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -44,7 +41,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index ca08c6362ce17..3f8ac3d4a3fc5 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -47,7 +45,7 @@ public void testTypeHolderDefault() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public void numberItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +69,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +77,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 763bccefe43d5..e0a7a0d614ceb 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -47,7 +45,7 @@ public void testTypeHolderExample() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public void numberItemTest() { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -71,7 +69,7 @@ public void floatItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -79,7 +77,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -87,7 +85,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java index b3a76f61da539..5163783cfdc1d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,25 +18,22 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -44,7 +41,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -60,7 +57,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -68,7 +65,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -76,7 +73,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -84,7 +81,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -92,7 +89,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -100,7 +97,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java index f9790cd7c6bdf..3cfe59d203cd3 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -18,28 +18,26 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -47,7 +45,7 @@ public void testXmlItem() { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -55,7 +53,7 @@ public void attributeStringTest() { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -63,7 +61,7 @@ public void attributeNumberTest() { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -71,7 +69,7 @@ public void attributeIntegerTest() { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -79,7 +77,7 @@ public void attributeBooleanTest() { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -87,7 +85,7 @@ public void wrappedArrayTest() { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -95,7 +93,7 @@ public void nameStringTest() { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -103,7 +101,7 @@ public void nameNumberTest() { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -111,7 +109,7 @@ public void nameIntegerTest() { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -119,7 +117,7 @@ public void nameBooleanTest() { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -127,7 +125,7 @@ public void nameArrayTest() { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -135,7 +133,7 @@ public void nameWrappedArrayTest() { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -143,7 +141,7 @@ public void prefixStringTest() { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -151,7 +149,7 @@ public void prefixNumberTest() { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -159,7 +157,7 @@ public void prefixIntegerTest() { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -167,7 +165,7 @@ public void prefixBooleanTest() { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -175,7 +173,7 @@ public void prefixArrayTest() { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -183,7 +181,7 @@ public void prefixWrappedArrayTest() { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -191,7 +189,7 @@ public void namespaceStringTest() { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -199,7 +197,7 @@ public void namespaceNumberTest() { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -207,7 +205,7 @@ public void namespaceIntegerTest() { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -215,7 +213,7 @@ public void namespaceBooleanTest() { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -223,7 +221,7 @@ public void namespaceArrayTest() { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -231,7 +229,7 @@ public void namespaceWrappedArrayTest() { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -239,7 +237,7 @@ public void prefixNsStringTest() { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -247,7 +245,7 @@ public void prefixNsNumberTest() { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -255,7 +253,7 @@ public void prefixNsIntegerTest() { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -263,7 +261,7 @@ public void prefixNsBooleanTest() { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -271,7 +269,7 @@ public void prefixNsArrayTest() { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/vertx-no-nullable/build.gradle b/samples/client/petstore/java/vertx-no-nullable/build.gradle index 28ecdb66358ee..e486a82fb2798 100644 --- a/samples/client/petstore/java/vertx-no-nullable/build.gradle +++ b/samples/client/petstore/java/vertx-no-nullable/build.gradle @@ -33,7 +33,7 @@ ext { jackson_version = "2.17.1" jackson_databind_version = "2.17.1" vertx_version = "3.5.2" - junit_version = "4.13.2" + junit_version = "5.10.3" jakarta_annotation_version = "1.3.5" } @@ -47,6 +47,6 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/samples/client/petstore/java/vertx-no-nullable/pom.xml b/samples/client/petstore/java/vertx-no-nullable/pom.xml index 80bfe79d263ca..718027ec3d5f5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/pom.xml +++ b/samples/client/petstore/java/vertx-no-nullable/pom.xml @@ -249,8 +249,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -269,6 +269,6 @@ 2.17.1 0.2.6 1.3.5 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 35dca85fdf22a..7e9810667069c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -13,14 +13,14 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.UUID; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +31,8 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +41,16 @@ /** * API tests for AnotherFakeApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class AnotherFakeApiTest { private AnotherFakeApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new AnotherFakeApiImpl(); } - + /** * To test special tags * To test special tags and operation ID starting with number @@ -66,11 +60,11 @@ public void setupApiClient() { @Test public void call123testSpecialTagsTest(TestContext testContext) { Async async = testContext.async(); + UUID uuidTest = null; Client body = null; - api.call123testSpecialTags(body, result -> { + api.call123testSpecialTags(uuidTest, body, result -> { // TODO: test validations async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java index b907b722c290a..10ad680e364eb 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -24,11 +24,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -39,6 +38,8 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -47,24 +48,16 @@ /** * API tests for FakeApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class FakeApiTest { private FakeApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new FakeApiImpl(); } - + /** * creates an XmlItem * this route creates an XmlItem @@ -80,7 +73,6 @@ public void createXmlItemTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of outer boolean types @@ -96,7 +88,6 @@ public void fakeOuterBooleanSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of object with outer number type @@ -112,7 +103,6 @@ public void fakeOuterCompositeSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of outer number types @@ -128,7 +118,6 @@ public void fakeOuterNumberSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of outer string types @@ -144,7 +133,6 @@ public void fakeOuterStringSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * For this test, the body for this request much reference a schema named `File`. @@ -160,7 +148,6 @@ public void testBodyWithFileSchemaTest(TestContext testContext) { async.complete(); }); } - /** * * @@ -177,7 +164,6 @@ public void testBodyWithQueryParamsTest(TestContext testContext) { async.complete(); }); } - /** * To test \"client\" model * To test \"client\" model @@ -193,7 +179,6 @@ public void testClientModelTest(TestContext testContext) { async.complete(); }); } - /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -222,7 +207,6 @@ public void testEndpointParametersTest(TestContext testContext) { async.complete(); }); } - /** * To test enum parameters * To test enum parameters @@ -245,7 +229,6 @@ public void testEnumParametersTest(TestContext testContext) { async.complete(); }); } - /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -266,7 +249,6 @@ public void testGroupParametersTest(TestContext testContext) { async.complete(); }); } - /** * test inline additionalProperties * @@ -282,7 +264,6 @@ public void testInlineAdditionalPropertiesTest(TestContext testContext) { async.complete(); }); } - /** * test json serialization of form data * @@ -299,7 +280,6 @@ public void testJsonFormDataTest(TestContext testContext) { async.complete(); }); } - /** * * To test the collection format in query parameters @@ -319,5 +299,4 @@ public void testQueryParameterCollectionFormatTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 470100109e67d..64d937df0c4a4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +30,8 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +40,16 @@ /** * API tests for FakeClassnameTags123Api */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new FakeClassnameTags123ApiImpl(); } - + /** * To test class name in snake case * To test class name in snake case @@ -72,5 +65,4 @@ public void testClassnameTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java index a180bf869643b..ac1d4ba352c0f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -19,11 +19,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -34,6 +33,8 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -42,24 +43,16 @@ /** * API tests for PetApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new PetApiImpl(); } - + /** * Add a new pet to the store * @@ -75,7 +68,6 @@ public void addPetTest(TestContext testContext) { async.complete(); }); } - /** * Deletes a pet * @@ -92,7 +84,6 @@ public void deletePetTest(TestContext testContext) { async.complete(); }); } - /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -108,7 +99,6 @@ public void findPetsByStatusTest(TestContext testContext) { async.complete(); }); } - /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -124,7 +114,6 @@ public void findPetsByTagsTest(TestContext testContext) { async.complete(); }); } - /** * Find pet by ID * Returns a single pet @@ -140,7 +129,6 @@ public void getPetByIdTest(TestContext testContext) { async.complete(); }); } - /** * Update an existing pet * @@ -156,7 +144,6 @@ public void updatePetTest(TestContext testContext) { async.complete(); }); } - /** * Updates a pet in the store with form data * @@ -174,7 +161,6 @@ public void updatePetWithFormTest(TestContext testContext) { async.complete(); }); } - /** * uploads an image * @@ -186,13 +172,12 @@ public void uploadFileTest(TestContext testContext) { Async async = testContext.async(); Long petId = null; String additionalMetadata = null; - AsyncFile file = null; - api.uploadFile(petId, additionalMetadata, file, result -> { + AsyncFile _file = null; + api.uploadFile(petId, additionalMetadata, _file, result -> { // TODO: test validations async.complete(); }); } - /** * uploads an image (required) * @@ -210,5 +195,4 @@ public void uploadFileWithRequiredFileTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java index 5581be91dc8da..c33d57cc669a3 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +30,8 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +40,16 @@ /** * API tests for StoreApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new StoreApiImpl(); } - + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -72,7 +65,6 @@ public void deleteOrderTest(TestContext testContext) { async.complete(); }); } - /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -87,7 +79,6 @@ public void getInventoryTest(TestContext testContext) { async.complete(); }); } - /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -103,7 +94,6 @@ public void getOrderByIdTest(TestContext testContext) { async.complete(); }); } - /** * Place an order for a pet * @@ -119,5 +109,4 @@ public void placeOrderTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java index b5724cd092609..446a53ee192d9 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -12,15 +12,15 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +31,8 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +41,16 @@ /** * API tests for UserApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new UserApiImpl(); } - + /** * Create user * This can only be done by the logged in user. @@ -72,7 +66,6 @@ public void createUserTest(TestContext testContext) { async.complete(); }); } - /** * Creates list of users with given input array * @@ -88,7 +81,6 @@ public void createUsersWithArrayInputTest(TestContext testContext) { async.complete(); }); } - /** * Creates list of users with given input array * @@ -104,7 +96,6 @@ public void createUsersWithListInputTest(TestContext testContext) { async.complete(); }); } - /** * Delete user * This can only be done by the logged in user. @@ -120,7 +111,6 @@ public void deleteUserTest(TestContext testContext) { async.complete(); }); } - /** * Get user by user name * @@ -136,7 +126,6 @@ public void getUserByNameTest(TestContext testContext) { async.complete(); }); } - /** * Logs user into the system * @@ -153,7 +142,6 @@ public void loginUserTest(TestContext testContext) { async.complete(); }); } - /** * Logs out current logged in user session * @@ -168,7 +156,6 @@ public void logoutUserTest(TestContext testContext) { async.complete(); }); } - /** * Updated user * This can only be done by the logged in user. @@ -185,5 +172,4 @@ public void updateUserTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 0ef36c6a64c0b..faacb289c17e7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -18,26 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -45,7 +42,7 @@ public void testAdditionalPropertiesAnyType() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 49ebece62c2d8..b506ff7ae92a9 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -18,27 +18,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesArray() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 1113d5dd466ab..ba65ffedc14f6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -18,26 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -45,7 +42,7 @@ public void testAdditionalPropertiesBoolean() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 0217e6cd5dcd4..72854079e5ed4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -18,28 +18,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -47,7 +44,7 @@ public void testAdditionalPropertiesClass() { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -55,7 +52,7 @@ public void mapStringTest() { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -63,7 +60,7 @@ public void mapNumberTest() { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -71,7 +68,7 @@ public void mapIntegerTest() { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -79,7 +76,7 @@ public void mapBooleanTest() { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -87,7 +84,7 @@ public void mapArrayIntegerTest() { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -95,7 +92,7 @@ public void mapArrayAnytypeTest() { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -103,7 +100,7 @@ public void mapMapStringTest() { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -111,7 +108,7 @@ public void mapMapAnytypeTest() { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -119,7 +116,7 @@ public void anytype1Test() { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -127,7 +124,7 @@ public void anytype2Test() { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 815f57427863f..916c2c2bcb3db 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -18,26 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -45,7 +42,7 @@ public void testAdditionalPropertiesInteger() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 20d1c6199d245..a099245eec5b1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -18,27 +18,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -46,7 +43,7 @@ public void testAdditionalPropertiesNumber() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3a863bdf2db8d..d47c9a37d1fef 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -18,26 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -45,7 +42,7 @@ public void testAdditionalPropertiesObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 8ab8d9c52a9c3..3820dd2e23ceb 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -18,26 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -45,7 +42,7 @@ public void testAdditionalPropertiesString() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java index 3475d2be3123e..24776d3cb515a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -13,6 +13,7 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -20,27 +21,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -48,7 +43,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -56,7 +51,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 928e2973997f8..6bbe877044db5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -18,27 +18,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -46,7 +44,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 0c02796dc7979..eaf908bb1ab79 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -18,27 +18,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -46,7 +44,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java index bc5ac744672d6..99c6bcf536016 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -18,27 +18,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -46,7 +44,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -54,7 +52,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -62,7 +60,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/BigCatTest.java index 765bd1505128f..20bc4e0d4247a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -44,7 +44,7 @@ public void testBigCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -68,7 +68,7 @@ public void declawedTest() { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java index ffa72405fa860..a0217acd1f202 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -43,7 +40,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -51,7 +48,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -59,7 +56,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -67,7 +64,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -75,7 +72,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -83,7 +80,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java index 02f70ea913e06..1b389a075be0d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java @@ -13,6 +13,7 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -20,27 +21,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.CatAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -48,7 +44,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -56,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -64,7 +60,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java index 7f149cec85441..22fcbd7f3ccb9 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -43,7 +40,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java index afac01e835cb7..6ef5c744fbcbb 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -43,7 +40,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java index cf90750a9114a..8028f11bc2b96 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -43,7 +40,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java index 2903f6657e0f5..b2a12ab4c5e09 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java @@ -13,6 +13,7 @@ package org.openapitools.client.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -20,26 +21,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.DogAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -47,7 +44,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -63,7 +60,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 3130e2a5a0573..4a755b0d44251 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -18,26 +18,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -45,7 +43,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -53,7 +51,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd2c..48aa1a737fce7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java index eb783880536e1..b06e3eb195d93 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -18,25 +18,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -44,7 +41,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -52,7 +49,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -60,7 +57,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -68,7 +65,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -76,7 +73,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index c3c78aa3aa531..0048cb2c74977 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -18,42 +18,41 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java index 0e626ca0f4404..acd1cec8712ba 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -18,29 +18,26 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -48,7 +45,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -56,7 +53,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -64,7 +61,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -72,7 +69,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -80,7 +77,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -88,7 +85,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -96,7 +93,7 @@ public void _doubleTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -104,7 +101,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -112,7 +109,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -120,7 +117,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -128,7 +125,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -136,7 +133,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -144,7 +141,7 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -152,7 +149,7 @@ public void passwordTest() { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index e28f7d7441bd7..908f0aff6ed71 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -43,7 +40,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -51,7 +48,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java index 8d1b64dfce775..3752c5ba31fdc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -18,27 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -46,7 +42,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -54,7 +50,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -62,7 +58,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -70,7 +66,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index ea6eee23f8824..0f47e193af8d6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -18,30 +18,26 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -49,7 +45,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -57,7 +53,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -65,7 +61,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 20dee01ae5da4..5743b70142b84 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -43,7 +40,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -51,7 +48,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 5dfb76f406a7b..436e4abd59e3c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -43,7 +40,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -51,7 +48,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -59,7 +56,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java index 5b3fde28d4b4d..f128d7b9ac2e7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -43,7 +40,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java index 36755ee2bd6a0..92273f48d2396 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -43,7 +40,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java index a1517b158a59f..1c5337654cd45 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -43,7 +40,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java index d54b90ad166ea..1a6aa18fa20da 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -43,7 +40,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -51,7 +48,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -59,7 +56,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -67,7 +64,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 4238632f54b8d..8623386a5e95e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -18,25 +18,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -44,7 +41,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java index 007f1aaea8a17..670c2535646bf 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,25 +18,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -44,7 +41,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -60,7 +57,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -68,7 +65,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -76,7 +73,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -84,7 +81,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 527a5df91af9f..870a977da9449 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -18,25 +18,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -44,7 +41,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -52,7 +49,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -60,7 +57,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf0a..0333ee657a0f2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java index 865e589be8485..2e4303f1e4b54 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java @@ -18,30 +18,29 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -49,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -57,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -65,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -73,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -81,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -89,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 5d460c3c6979d..c56da4290fa9c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -43,7 +40,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -51,7 +48,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index da6a64c20f6bf..9501cf722d66a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -43,7 +40,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java index 51852d800581c..dc9cf9742efa5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -43,7 +40,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 16918aa98d992..7ee75c3573150 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -18,27 +18,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -46,7 +44,7 @@ public void testTypeHolderDefault() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -54,7 +52,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -62,7 +60,7 @@ public void numberItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -70,7 +68,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -78,7 +76,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 53d531b37eae7..5c77882f50079 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -18,27 +18,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -46,7 +44,7 @@ public void testTypeHolderExample() { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -54,7 +52,7 @@ public void stringItemTest() { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -62,7 +60,7 @@ public void numberItemTest() { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -70,7 +68,7 @@ public void floatItemTest() { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -78,7 +76,7 @@ public void integerItemTest() { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -86,7 +84,7 @@ public void boolItemTest() { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java index 335a8f560bbf6..69d274133b976 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -43,7 +40,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,7 +48,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -59,7 +56,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -67,7 +64,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -75,7 +72,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -83,7 +80,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -91,7 +88,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -99,7 +96,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java index d988813dbb27b..d2e45fadf56c6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -18,27 +18,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -46,7 +44,7 @@ public void testXmlItem() { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -54,7 +52,7 @@ public void attributeStringTest() { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -62,7 +60,7 @@ public void attributeNumberTest() { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -70,7 +68,7 @@ public void attributeIntegerTest() { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -78,7 +76,7 @@ public void attributeBooleanTest() { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -86,7 +84,7 @@ public void wrappedArrayTest() { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -94,7 +92,7 @@ public void nameStringTest() { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -102,7 +100,7 @@ public void nameNumberTest() { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -110,7 +108,7 @@ public void nameIntegerTest() { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -118,7 +116,7 @@ public void nameBooleanTest() { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -126,7 +124,7 @@ public void nameArrayTest() { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -134,7 +132,7 @@ public void nameWrappedArrayTest() { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -142,7 +140,7 @@ public void prefixStringTest() { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -150,7 +148,7 @@ public void prefixNumberTest() { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -158,7 +156,7 @@ public void prefixIntegerTest() { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -166,7 +164,7 @@ public void prefixBooleanTest() { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -174,7 +172,7 @@ public void prefixArrayTest() { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -182,7 +180,7 @@ public void prefixWrappedArrayTest() { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -190,7 +188,7 @@ public void namespaceStringTest() { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -198,7 +196,7 @@ public void namespaceNumberTest() { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -206,7 +204,7 @@ public void namespaceIntegerTest() { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -214,7 +212,7 @@ public void namespaceBooleanTest() { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -222,7 +220,7 @@ public void namespaceArrayTest() { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -230,7 +228,7 @@ public void namespaceWrappedArrayTest() { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -238,7 +236,7 @@ public void prefixNsStringTest() { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -246,7 +244,7 @@ public void prefixNsNumberTest() { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -254,7 +252,7 @@ public void prefixNsIntegerTest() { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -262,7 +260,7 @@ public void prefixNsBooleanTest() { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -270,7 +268,7 @@ public void prefixNsArrayTest() { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index e3e1ea26d5555..f39d9ce699f87 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -33,7 +33,7 @@ ext { jackson_version = "2.17.1" jackson_databind_version = "2.17.1" vertx_version = "3.5.2" - junit_version = "4.13.2" + junit_version = "5.10.3" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" } @@ -49,6 +49,6 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index eeb074ccb8f4d..bb041a21bbc10 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -254,8 +254,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -274,6 +274,6 @@ 2.17.1 0.2.6 1.3.5 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 6573a5438c807..249eceb90ae3b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -41,24 +40,16 @@ /** * API tests for AnotherFakeApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class AnotherFakeApiTest { private AnotherFakeApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new AnotherFakeApiImpl(); } - + /** * To test special tags * To test special tags and operation ID starting with number @@ -74,5 +65,4 @@ public void call123testSpecialTagsTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/DefaultApiTest.java index 3a0c37e3c7db8..84ffe45ce619f 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -41,24 +40,16 @@ /** * API tests for DefaultApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class DefaultApiTest { private DefaultApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new DefaultApiImpl(); } - + /** * * @@ -73,5 +64,4 @@ public void fooGetTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java index 4fa25e25e50ba..2004d38036713 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -14,6 +14,7 @@ import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; import org.openapitools.client.model.Client; import org.openapitools.client.model.EnumClass; import org.openapitools.client.model.FakeBigDecimalMap200Response; @@ -24,15 +25,15 @@ import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -53,24 +54,16 @@ /** * API tests for FakeApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class FakeApiTest { private FakeApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new FakeApiImpl(); } - + /** * * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys @@ -85,7 +78,6 @@ public void fakeBigDecimalMapTest(TestContext testContext) { async.complete(); }); } - /** * Health check endpoint * @@ -100,7 +92,6 @@ public void fakeHealthGetTest(TestContext testContext) { async.complete(); }); } - /** * test http signature authentication * @@ -118,7 +109,6 @@ public void fakeHttpSignatureTestTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of outer boolean types @@ -134,7 +124,6 @@ public void fakeOuterBooleanSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of object with outer number type @@ -150,7 +139,6 @@ public void fakeOuterCompositeSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of outer number types @@ -166,7 +154,6 @@ public void fakeOuterNumberSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of outer string types @@ -182,7 +169,6 @@ public void fakeOuterStringSerializeTest(TestContext testContext) { async.complete(); }); } - /** * * Test serialization of enum (int) properties with examples @@ -198,7 +184,21 @@ public void fakePropertyEnumIntegerSerializeTest(TestContext testContext) { async.complete(); }); } - + /** + * test referenced additionalProperties + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testAdditionalPropertiesReferenceTest(TestContext testContext) { + Async async = testContext.async(); + Map requestBody = null; + api.testAdditionalPropertiesReference(requestBody, result -> { + // TODO: test validations + async.complete(); + }); + } /** * * For this test, the body has to be a binary file. @@ -214,7 +214,6 @@ public void testBodyWithBinaryTest(TestContext testContext) { async.complete(); }); } - /** * * For this test, the body for this request must reference a schema named `File`. @@ -230,7 +229,6 @@ public void testBodyWithFileSchemaTest(TestContext testContext) { async.complete(); }); } - /** * * @@ -247,7 +245,6 @@ public void testBodyWithQueryParamsTest(TestContext testContext) { async.complete(); }); } - /** * To test \"client\" model * To test \"client\" model @@ -263,7 +260,6 @@ public void testClientModelTest(TestContext testContext) { async.complete(); }); } - /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -292,7 +288,6 @@ public void testEndpointParametersTest(TestContext testContext) { async.complete(); }); } - /** * To test enum parameters * To test enum parameters @@ -316,7 +311,6 @@ public void testEnumParametersTest(TestContext testContext) { async.complete(); }); } - /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -337,7 +331,6 @@ public void testGroupParametersTest(TestContext testContext) { async.complete(); }); } - /** * test inline additionalProperties * @@ -353,7 +346,21 @@ public void testInlineAdditionalPropertiesTest(TestContext testContext) { async.complete(); }); } - + /** + * test inline free-form additionalProperties + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest(TestContext testContext) { + Async async = testContext.async(); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, result -> { + // TODO: test validations + async.complete(); + }); + } /** * test json serialization of form data * @@ -370,7 +377,21 @@ public void testJsonFormDataTest(TestContext testContext) { async.complete(); }); } - + /** + * test nullable parent property + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testNullableTest(TestContext testContext) { + Async async = testContext.async(); + ChildWithNullable childWithNullable = null; + api.testNullable(childWithNullable, result -> { + // TODO: test validations + async.complete(); + }); + } /** * * To test the collection format in query parameters @@ -392,5 +413,19 @@ public void testQueryParameterCollectionFormatTest(TestContext testContext) { async.complete(); }); } - + /** + * test referenced string map + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testStringMapReferenceTest(TestContext testContext) { + Async async = testContext.async(); + Map requestBody = null; + api.testStringMapReference(requestBody, result -> { + // TODO: test validations + async.complete(); + }); + } } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 47a43e0440571..692c23f6bd274 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -41,24 +40,16 @@ /** * API tests for FakeClassnameTags123Api */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new FakeClassnameTags123ApiImpl(); } - + /** * To test class name in snake case * To test class name in snake case @@ -74,5 +65,4 @@ public void testClassnameTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java index 0f640e564d3e6..18a10252a46cd 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -19,11 +19,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -44,24 +43,16 @@ /** * API tests for PetApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new PetApiImpl(); } - + /** * Add a new pet to the store * @@ -77,7 +68,6 @@ public void addPetTest(TestContext testContext) { async.complete(); }); } - /** * Deletes a pet * @@ -94,7 +84,6 @@ public void deletePetTest(TestContext testContext) { async.complete(); }); } - /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -110,7 +99,6 @@ public void findPetsByStatusTest(TestContext testContext) { async.complete(); }); } - /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -126,7 +114,6 @@ public void findPetsByTagsTest(TestContext testContext) { async.complete(); }); } - /** * Find pet by ID * Returns a single pet @@ -142,7 +129,6 @@ public void getPetByIdTest(TestContext testContext) { async.complete(); }); } - /** * Update an existing pet * @@ -158,7 +144,6 @@ public void updatePetTest(TestContext testContext) { async.complete(); }); } - /** * Updates a pet in the store with form data * @@ -176,7 +161,6 @@ public void updatePetWithFormTest(TestContext testContext) { async.complete(); }); } - /** * uploads an image * @@ -194,7 +178,6 @@ public void uploadFileTest(TestContext testContext) { async.complete(); }); } - /** * uploads an image (required) * @@ -212,5 +195,4 @@ public void uploadFileWithRequiredFileTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java index d95bd4fe8221d..757b3a802cc14 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -41,24 +40,16 @@ /** * API tests for StoreApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new StoreApiImpl(); } - + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -74,7 +65,6 @@ public void deleteOrderTest(TestContext testContext) { async.complete(); }); } - /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -89,7 +79,6 @@ public void getInventoryTest(TestContext testContext) { async.complete(); }); } - /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -105,7 +94,6 @@ public void getOrderByIdTest(TestContext testContext) { async.complete(); }); } - /** * Place an order for a pet * @@ -121,5 +109,4 @@ public void placeOrderTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java index 166e90ee69550..debaeec310f6e 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -17,11 +17,10 @@ import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -42,24 +41,16 @@ /** * API tests for UserApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new UserApiImpl(); } - + /** * Create user * This can only be done by the logged in user. @@ -75,7 +66,6 @@ public void createUserTest(TestContext testContext) { async.complete(); }); } - /** * Creates list of users with given input array * @@ -91,7 +81,6 @@ public void createUsersWithArrayInputTest(TestContext testContext) { async.complete(); }); } - /** * Creates list of users with given input array * @@ -107,7 +96,6 @@ public void createUsersWithListInputTest(TestContext testContext) { async.complete(); }); } - /** * Delete user * This can only be done by the logged in user. @@ -123,7 +111,6 @@ public void deleteUserTest(TestContext testContext) { async.complete(); }); } - /** * Get user by user name * @@ -139,7 +126,6 @@ public void getUserByNameTest(TestContext testContext) { async.complete(); }); } - /** * Logs user into the system * @@ -156,7 +142,6 @@ public void loginUserTest(TestContext testContext) { async.complete(); }); } - /** * Logs out current logged in user session * @@ -171,7 +156,6 @@ public void logoutUserTest(TestContext testContext) { async.complete(); }); } - /** * Updated user * This can only be done by the logged in user. @@ -188,5 +172,4 @@ public void updateUserTest(TestContext testContext) { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 29bc5ae969488..6bdecfe07c922 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -42,7 +42,7 @@ public void testAdditionalPropertiesClass() { * Test the property 'mapProperty' */ @Test - public void mapPropertyTest() { + void mapPropertyTest() { // TODO: test mapProperty } @@ -50,7 +50,7 @@ public void mapPropertyTest() { * Test the property 'mapOfMapProperty' */ @Test - public void mapOfMapPropertyTest() { + void mapOfMapPropertyTest() { // TODO: test mapOfMapProperty } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index dad0e9235de6b..f4b06d323d639 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AllOfWithSingleRef */ -public class AllOfWithSingleRefTest { +class AllOfWithSingleRefTest { private final AllOfWithSingleRef model = new AllOfWithSingleRef(); /** * Model tests for AllOfWithSingleRef */ @Test - public void testAllOfWithSingleRef() { + void testAllOfWithSingleRef() { // TODO: test AllOfWithSingleRef } @@ -41,7 +41,7 @@ public void testAllOfWithSingleRef() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -49,7 +49,7 @@ public void usernameTest() { * Test the property 'singleRefType' */ @Test - public void singleRefTypeTest() { + void singleRefTypeTest() { // TODO: test singleRefType } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AnimalTest.java index da5609b5489df..24776d3cb515a 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -43,7 +43,7 @@ public void testAnimal() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -51,7 +51,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index cbc199f15753b..6bbe877044db5 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -22,21 +22,21 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -44,7 +44,7 @@ public void testArrayOfArrayOfNumberOnly() { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 762f9d6dc3343..eaf908bb1ab79 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -22,21 +22,21 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -44,7 +44,7 @@ public void testArrayOfNumberOnly() { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 20dc34a8c5175..99c6bcf536016 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -22,21 +22,21 @@ import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -44,7 +44,7 @@ public void testArrayTest() { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -52,7 +52,7 @@ public void arrayOfStringTest() { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -60,7 +60,7 @@ public void arrayArrayOfIntegerTest() { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 4fd3728ab8975..a0217acd1f202 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -40,7 +40,7 @@ public void testCapitalization() { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -48,7 +48,7 @@ public void smallCamelTest() { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -56,7 +56,7 @@ public void capitalCamelTest() { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -64,7 +64,7 @@ public void smallSnakeTest() { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -72,7 +72,7 @@ public void capitalSnakeTest() { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -80,7 +80,7 @@ public void scAETHFlowPointsTest() { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CatTest.java index d591bdd30ef7f..1b389a075be0d 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -44,7 +44,7 @@ public void testCat() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public void colorTest() { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CategoryTest.java index 12de38c0c08d9..22fcbd7f3ccb9 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -40,7 +40,7 @@ public void testCategory() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java index 2616181bec30d..a89d26497bc35 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -23,21 +23,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ParentWithNullable; import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ChildWithNullable */ -public class ChildWithNullableTest { +class ChildWithNullableTest { private final ChildWithNullable model = new ChildWithNullable(); /** * Model tests for ChildWithNullable */ @Test - public void testChildWithNullable() { + void testChildWithNullable() { // TODO: test ChildWithNullable } @@ -45,7 +45,7 @@ public void testChildWithNullable() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -53,7 +53,7 @@ public void typeTest() { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } @@ -61,7 +61,7 @@ public void nullablePropertyTest() { * Test the property 'otherProperty' */ @Test - public void otherPropertyTest() { + void otherPropertyTest() { // TODO: test otherProperty } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClassModelTest.java index d1936d85e8159..6ef5c744fbcbb 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -40,7 +40,7 @@ public void testClassModel() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClientTest.java index 7aa0f5859ff17..8028f11bc2b96 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -40,7 +40,7 @@ public void testClient() { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index 65fd3cc0b7609..b04c2097b2091 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for DeprecatedObject */ -public class DeprecatedObjectTest { +class DeprecatedObjectTest { private final DeprecatedObject model = new DeprecatedObject(); /** * Model tests for DeprecatedObject */ @Test - public void testDeprecatedObject() { + void testDeprecatedObject() { // TODO: test DeprecatedObject } @@ -40,7 +40,7 @@ public void testDeprecatedObject() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DogTest.java index 744c8a406fe83..b2a12ab4c5e09 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -44,7 +44,7 @@ public void testDog() { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public void classNameTest() { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public void colorTest() { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 694e4196138b2..4a755b0d44251 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -21,21 +21,21 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -43,7 +43,7 @@ public void testEnumArrays() { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -51,7 +51,7 @@ public void justSymbolTest() { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumClassTest.java index 3f50e1bfb9ef6..48aa1a737fce7 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.java index 0a1fd0f4268b5..1e65944cbdc90 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -26,21 +26,21 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -48,7 +48,7 @@ public void testEnumTest() { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -56,7 +56,7 @@ public void enumStringTest() { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -64,7 +64,7 @@ public void enumStringRequiredTest() { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -72,7 +72,7 @@ public void enumIntegerTest() { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -80,7 +80,7 @@ public void enumNumberTest() { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } @@ -88,7 +88,7 @@ public void outerEnumTest() { * Test the property 'outerEnumInteger' */ @Test - public void outerEnumIntegerTest() { + void outerEnumIntegerTest() { // TODO: test outerEnumInteger } @@ -96,7 +96,7 @@ public void outerEnumIntegerTest() { * Test the property 'outerEnumDefaultValue' */ @Test - public void outerEnumDefaultValueTest() { + void outerEnumDefaultValueTest() { // TODO: test outerEnumDefaultValue } @@ -104,7 +104,7 @@ public void outerEnumDefaultValueTest() { * Test the property 'outerEnumIntegerDefaultValue' */ @Test - public void outerEnumIntegerDefaultValueTest() { + void outerEnumIntegerDefaultValueTest() { // TODO: test outerEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be696..3250ad91974ce 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -21,21 +21,21 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response */ -public class FakeBigDecimalMap200ResponseTest { +class FakeBigDecimalMap200ResponseTest { private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); /** * Model tests for FakeBigDecimalMap200Response */ @Test - public void testFakeBigDecimalMap200Response() { + void testFakeBigDecimalMap200Response() { // TODO: test FakeBigDecimalMap200Response } @@ -43,7 +43,7 @@ public void testFakeBigDecimalMap200Response() { * Test the property 'someId' */ @Test - public void someIdTest() { + void someIdTest() { // TODO: test someId } @@ -51,7 +51,7 @@ public void someIdTest() { * Test the property 'someMap' */ @Test - public void someMapTest() { + void someMapTest() { // TODO: test someMap } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index fb8827a1e88b4..0048cb2c74977 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -22,21 +22,21 @@ import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -44,7 +44,7 @@ public void testFileSchemaTestClass() { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -52,7 +52,7 @@ public void _fileTest() { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index cd15af86ee936..81bc69c9a7b40 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FooGetDefaultResponse */ -public class FooGetDefaultResponseTest { +class FooGetDefaultResponseTest { private final FooGetDefaultResponse model = new FooGetDefaultResponse(); /** * Model tests for FooGetDefaultResponse */ @Test - public void testFooGetDefaultResponse() { + void testFooGetDefaultResponse() { // TODO: test FooGetDefaultResponse } @@ -41,7 +41,7 @@ public void testFooGetDefaultResponse() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooTest.java index 2a92367019b80..a9e2c8c126e12 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Foo */ -public class FooTest { +class FooTest { private final Foo model = new Foo(); /** * Model tests for Foo */ @Test - public void testFoo() { + void testFoo() { // TODO: test Foo } @@ -40,7 +40,7 @@ public void testFoo() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FormatTestTest.java index 137d96ba0f4fa..1d42701a45401 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,21 +23,21 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -45,7 +45,7 @@ public void testFormatTest() { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -53,7 +53,7 @@ public void integerTest() { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -61,7 +61,7 @@ public void int32Test() { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -69,7 +69,7 @@ public void int64Test() { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -77,7 +77,7 @@ public void numberTest() { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -85,7 +85,7 @@ public void _floatTest() { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -93,7 +93,7 @@ public void _doubleTest() { * Test the property 'decimal' */ @Test - public void decimalTest() { + void decimalTest() { // TODO: test decimal } @@ -101,7 +101,7 @@ public void decimalTest() { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -109,7 +109,7 @@ public void stringTest() { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -117,7 +117,7 @@ public void _byteTest() { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -125,7 +125,7 @@ public void binaryTest() { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -133,7 +133,7 @@ public void dateTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -141,7 +141,7 @@ public void dateTimeTest() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -149,7 +149,7 @@ public void uuidTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -157,7 +157,7 @@ public void passwordTest() { * Test the property 'patternWithDigits' */ @Test - public void patternWithDigitsTest() { + void patternWithDigitsTest() { // TODO: test patternWithDigits } @@ -165,7 +165,7 @@ public void patternWithDigitsTest() { * Test the property 'patternWithDigitsAndDelimiter' */ @Test - public void patternWithDigitsAndDelimiterTest() { + void patternWithDigitsAndDelimiterTest() { // TODO: test patternWithDigitsAndDelimiter } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index bf777b061ccd4..908f0aff6ed71 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -40,7 +40,7 @@ public void testHasOnlyReadOnly() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -48,7 +48,7 @@ public void barTest() { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index e96ffaa18f472..0f45c2fcd5ba5 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HealthCheckResult */ -public class HealthCheckResultTest { +class HealthCheckResultTest { private final HealthCheckResult model = new HealthCheckResult(); /** * Model tests for HealthCheckResult */ @Test - public void testHealthCheckResult() { + void testHealthCheckResult() { // TODO: test HealthCheckResult } @@ -44,7 +44,7 @@ public void testHealthCheckResult() { * Test the property 'nullableMessage' */ @Test - public void nullableMessageTest() { + void nullableMessageTest() { // TODO: test nullableMessage } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MapTestTest.java index 50e909f038119..3752c5ba31fdc 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -42,7 +42,7 @@ public void testMapTest() { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -50,7 +50,7 @@ public void mapMapOfStringTest() { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -58,7 +58,7 @@ public void mapOfEnumStringTest() { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -66,7 +66,7 @@ public void directMapTest() { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b16858dc17e2c..0f47e193af8d6 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,21 +23,21 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -45,7 +45,7 @@ public void testMixedPropertiesAndAdditionalPropertiesClass() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -53,7 +53,7 @@ public void uuidTest() { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -61,7 +61,7 @@ public void dateTimeTest() { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dd90f6799d3ed..5743b70142b84 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -40,7 +40,7 @@ public void testModel200Response() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -48,7 +48,7 @@ public void nameTest() { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index e63f2ae5e9ca3..436e4abd59e3c 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -40,7 +40,7 @@ public void testModelApiResponse() { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -48,7 +48,7 @@ public void codeTest() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -56,7 +56,7 @@ public void typeTest() { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java index 264249edc1c04..f128d7b9ac2e7 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -40,7 +40,7 @@ public void testModelFile() { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java index 81fd2dcc6a6a7..92273f48d2396 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -40,7 +40,7 @@ public void testModelList() { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 5840d4f8f0c92..1c5337654cd45 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -40,7 +40,7 @@ public void testModelReturn() { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NameTest.java index 9280c1715390a..1a6aa18fa20da 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -40,7 +40,7 @@ public void testName() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -48,7 +48,7 @@ public void nameTest() { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -56,7 +56,7 @@ public void snakeCaseTest() { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -64,7 +64,7 @@ public void propertyTest() { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java index c79c6366f838f..d960ef76e5c3b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -30,21 +30,21 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NullableClass */ -public class NullableClassTest { +class NullableClassTest { private final NullableClass model = new NullableClass(); /** * Model tests for NullableClass */ @Test - public void testNullableClass() { + void testNullableClass() { // TODO: test NullableClass } @@ -52,7 +52,7 @@ public void testNullableClass() { * Test the property 'integerProp' */ @Test - public void integerPropTest() { + void integerPropTest() { // TODO: test integerProp } @@ -60,7 +60,7 @@ public void integerPropTest() { * Test the property 'numberProp' */ @Test - public void numberPropTest() { + void numberPropTest() { // TODO: test numberProp } @@ -68,7 +68,7 @@ public void numberPropTest() { * Test the property 'booleanProp' */ @Test - public void booleanPropTest() { + void booleanPropTest() { // TODO: test booleanProp } @@ -76,7 +76,7 @@ public void booleanPropTest() { * Test the property 'stringProp' */ @Test - public void stringPropTest() { + void stringPropTest() { // TODO: test stringProp } @@ -84,7 +84,7 @@ public void stringPropTest() { * Test the property 'dateProp' */ @Test - public void datePropTest() { + void datePropTest() { // TODO: test dateProp } @@ -92,7 +92,7 @@ public void datePropTest() { * Test the property 'datetimeProp' */ @Test - public void datetimePropTest() { + void datetimePropTest() { // TODO: test datetimeProp } @@ -100,7 +100,7 @@ public void datetimePropTest() { * Test the property 'arrayNullableProp' */ @Test - public void arrayNullablePropTest() { + void arrayNullablePropTest() { // TODO: test arrayNullableProp } @@ -108,7 +108,7 @@ public void arrayNullablePropTest() { * Test the property 'arrayAndItemsNullableProp' */ @Test - public void arrayAndItemsNullablePropTest() { + void arrayAndItemsNullablePropTest() { // TODO: test arrayAndItemsNullableProp } @@ -116,7 +116,7 @@ public void arrayAndItemsNullablePropTest() { * Test the property 'arrayItemsNullable' */ @Test - public void arrayItemsNullableTest() { + void arrayItemsNullableTest() { // TODO: test arrayItemsNullable } @@ -124,7 +124,7 @@ public void arrayItemsNullableTest() { * Test the property 'objectNullableProp' */ @Test - public void objectNullablePropTest() { + void objectNullablePropTest() { // TODO: test objectNullableProp } @@ -132,7 +132,7 @@ public void objectNullablePropTest() { * Test the property 'objectAndItemsNullableProp' */ @Test - public void objectAndItemsNullablePropTest() { + void objectAndItemsNullablePropTest() { // TODO: test objectAndItemsNullableProp } @@ -140,7 +140,7 @@ public void objectAndItemsNullablePropTest() { * Test the property 'objectItemsNullable' */ @Test - public void objectItemsNullableTest() { + void objectItemsNullableTest() { // TODO: test objectItemsNullable } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 63b5bc0440e5e..8623386a5e95e 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -41,7 +41,7 @@ public void testNumberOnly() { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index 4203b62f784c5..aa755cf8cb481 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -23,21 +23,21 @@ import java.util.Arrays; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ObjectWithDeprecatedFields */ -public class ObjectWithDeprecatedFieldsTest { +class ObjectWithDeprecatedFieldsTest { private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); /** * Model tests for ObjectWithDeprecatedFields */ @Test - public void testObjectWithDeprecatedFields() { + void testObjectWithDeprecatedFields() { // TODO: test ObjectWithDeprecatedFields } @@ -45,7 +45,7 @@ public void testObjectWithDeprecatedFields() { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -53,7 +53,7 @@ public void uuidTest() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -61,7 +61,7 @@ public void idTest() { * Test the property 'deprecatedRef' */ @Test - public void deprecatedRefTest() { + void deprecatedRefTest() { // TODO: test deprecatedRef } @@ -69,7 +69,7 @@ public void deprecatedRefTest() { * Test the property 'bars' */ @Test - public void barsTest() { + void barsTest() { // TODO: test bars } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OrderTest.java index e0fbb529af697..670c2535646bf 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -41,7 +41,7 @@ public void testOrder() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +49,7 @@ public void idTest() { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -57,7 +57,7 @@ public void petIdTest() { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -65,7 +65,7 @@ public void quantityTest() { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -73,7 +73,7 @@ public void shipDateTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -81,7 +81,7 @@ public void statusTest() { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 840cf65c8d011..870a977da9449 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -41,7 +41,7 @@ public void testOuterComposite() { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -49,7 +49,7 @@ public void myNumberTest() { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -57,7 +57,7 @@ public void myStringTest() { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 5b9bae28ec6ce..d818b23c7d53f 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumDefaultValue */ -public class OuterEnumDefaultValueTest { +class OuterEnumDefaultValueTest { /** * Model tests for OuterEnumDefaultValue */ @Test - public void testOuterEnumDefaultValue() { + void testOuterEnumDefaultValue() { // TODO: test OuterEnumDefaultValue } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index 731acbf905fde..1d7b3338bca20 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumIntegerDefaultValue */ -public class OuterEnumIntegerDefaultValueTest { +class OuterEnumIntegerDefaultValueTest { /** * Model tests for OuterEnumIntegerDefaultValue */ @Test - public void testOuterEnumIntegerDefaultValue() { + void testOuterEnumIntegerDefaultValue() { // TODO: test OuterEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 234945cec0f10..cacda46a76f45 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumInteger */ -public class OuterEnumIntegerTest { +class OuterEnumIntegerTest { /** * Model tests for OuterEnumInteger */ @Test - public void testOuterEnumInteger() { + void testOuterEnumInteger() { // TODO: test OuterEnumInteger } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumTest.java index b312b11a09ebc..0333ee657a0f2 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 964d1281b2143..ac7169192a50f 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterObjectWithEnumProperty */ -public class OuterObjectWithEnumPropertyTest { +class OuterObjectWithEnumPropertyTest { private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); /** * Model tests for OuterObjectWithEnumProperty */ @Test - public void testOuterObjectWithEnumProperty() { + void testOuterObjectWithEnumProperty() { // TODO: test OuterObjectWithEnumProperty } @@ -41,7 +41,7 @@ public void testOuterObjectWithEnumProperty() { * Test the property 'value' */ @Test - public void valueTest() { + void valueTest() { // TODO: test value } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java index bdd46008b13da..2e4de5618065a 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -25,21 +25,21 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ParentWithNullable */ -public class ParentWithNullableTest { +class ParentWithNullableTest { private final ParentWithNullable model = new ParentWithNullable(); /** * Model tests for ParentWithNullable */ @Test - public void testParentWithNullable() { + void testParentWithNullable() { // TODO: test ParentWithNullable } @@ -47,7 +47,7 @@ public void testParentWithNullable() { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -55,7 +55,7 @@ public void typeTest() { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/PetTest.java index ca23198fbf181..2e4303f1e4b54 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/PetTest.java @@ -26,21 +26,21 @@ import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public void testPet() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public void idTest() { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public void categoryTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public void nameTest() { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public void photoUrlsTest() { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public void tagsTest() { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index b356d6993c534..c56da4290fa9c 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -40,7 +40,7 @@ public void testReadOnlyFirst() { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -48,7 +48,7 @@ public void barTest() { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 920d02c930c83..476e4ca161b4a 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SingleRefType */ -public class SingleRefTypeTest { +class SingleRefTypeTest { /** * Model tests for SingleRefType */ @Test - public void testSingleRefType() { + void testSingleRefType() { // TODO: test SingleRefType } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 8eb0b1bd26946..9501cf722d66a 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -40,7 +40,7 @@ public void testSpecialModelName() { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TagTest.java index 6dc0868167c5b..dc9cf9742efa5 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -40,7 +40,7 @@ public void testTag() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public void idTest() { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 819a1e7fa9df8..edb986ca550f0 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ -public class TestInlineFreeformAdditionalPropertiesRequestTest { +class TestInlineFreeformAdditionalPropertiesRequestTest { private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ @Test - public void testTestInlineFreeformAdditionalPropertiesRequest() { + void testTestInlineFreeformAdditionalPropertiesRequest() { // TODO: test TestInlineFreeformAdditionalPropertiesRequest } @@ -42,7 +42,7 @@ public void testTestInlineFreeformAdditionalPropertiesRequest() { * Test the property 'someProperty' */ @Test - public void somePropertyTest() { + void somePropertyTest() { // TODO: test someProperty } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/UserTest.java index b029d279409c3..69d274133b976 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -40,7 +40,7 @@ public void testUser() { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public void idTest() { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -56,7 +56,7 @@ public void usernameTest() { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -64,7 +64,7 @@ public void firstNameTest() { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -72,7 +72,7 @@ public void lastNameTest() { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -80,7 +80,7 @@ public void emailTest() { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -88,7 +88,7 @@ public void passwordTest() { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -96,7 +96,7 @@ public void phoneTest() { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml b/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml index bc01aa5e3a0cf..cc13daea0bfb0 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml @@ -198,9 +198,9 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 4.13.2 1.4.14 - 3.3.0 + 3.5.9 2.17.1 - 1.3.5 + 1.3.5 UTF-8 diff --git a/samples/client/petstore/jaxrs-cxf-client/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index f124304c98c8f..edf9249f8cd08 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/pom.xml @@ -198,9 +198,9 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 4.13.2 1.4.14 - 3.3.0 + 3.5.9 2.17.1 - 1.3.5 + 1.3.5 UTF-8 diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 6ea4e930c6c23..1da41b886ac5a 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index cbd86808f1e94..a7d222512aa2f 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index cf1470cbff2b7..557527ac07db6 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 6bc911742a14f..ba16885da8c0c 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index e0b2095ca18d6..84d4782589581 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index fa771a986f242..ed66cc0457011 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 6ea4e930c6c23..1da41b886ac5a 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index cbd86808f1e94..a7d222512aa2f 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index e49bdfc048994..25adfbd2e077f 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 1b7f870840fd7..ac0ae8c1a15c6 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index e0b2095ca18d6..84d4782589581 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index fa771a986f242..ed66cc0457011 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 6ea4e930c6c23..1da41b886ac5a 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index cbd86808f1e94..a7d222512aa2f 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index e49bdfc048994..25adfbd2e077f 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 3d75f9221363c..5d23b6fba1da4 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index e0b2095ca18d6..84d4782589581 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index fa771a986f242..ed66cc0457011 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt index 6ea4e930c6c23..1da41b886ac5a 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index cbd86808f1e94..a7d222512aa2f 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt index e49bdfc048994..25adfbd2e077f 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 1b7f870840fd7..ac0ae8c1a15c6 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index e0b2095ca18d6..84d4782589581 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt index fa771a986f242..ed66cc0457011 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt index 6ea4e930c6c23..1da41b886ac5a 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index cbd86808f1e94..a7d222512aa2f 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt index e49bdfc048994..25adfbd2e077f 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 1b7f870840fd7..ac0ae8c1a15c6 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index e0b2095ca18d6..84d4782589581 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt index fa771a986f242..ed66cc0457011 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt index 6ea4e930c6c23..1da41b886ac5a 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index cbd86808f1e94..a7d222512aa2f 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt index e49bdfc048994..25adfbd2e077f 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 1b7f870840fd7..ac0ae8c1a15c6 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index e0b2095ca18d6..84d4782589581 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt index fa771a986f242..ed66cc0457011 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt index f96af7e336bf2..4a68d1a3ebd2b 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -28,10 +28,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index b74debaeb5d35..2583efc725f93 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -29,13 +29,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt index d278f0361d737..c9c227da18e0f 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -32,23 +32,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt index eb0640bb63ef9..43bacb547ed8b 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -34,23 +34,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt index d3240c8392db6..7a2db5f932961 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -28,10 +28,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt index e440c6022658d..6e28ef27d09e7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -34,29 +34,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index f96af7e336bf2..4a68d1a3ebd2b 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -28,10 +28,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index b74debaeb5d35..2583efc725f93 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -29,13 +29,13 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index d278f0361d737..c9c227da18e0f 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -32,23 +32,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index eb0640bb63ef9..43bacb547ed8b 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -34,23 +34,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index d3240c8392db6..7a2db5f932961 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -28,10 +28,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index e440c6022658d..6e28ef27d09e7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -34,29 +34,29 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 28571edbcd8a3..d855082fa406a 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import java.io.Serializable data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) : Serializable { diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 21de1ba349ce9..bf611b66b9310 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import java.io.Serializable data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) : Serializable { diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index 513964005f678..8918e30e9f81a 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import java.io.Serializable data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) : Serializable { diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index a6727ad1b9a12..e991db289fb2b 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import java.io.Serializable data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index acd4ef2b910cf..fe5730a01d36f 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import java.io.Serializable data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) : Serializable { diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index a40d077360d45..204111b94469b 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import java.io.Serializable data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) : Serializable { diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php index 875e0fb422b4a..bffc807b9a2f7 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -65,7 +65,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response headerr * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php index aafd4547e7177..abae8cf44acb8 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php @@ -48,7 +48,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected ?array $responseHeaders; @@ -64,10 +64,10 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as stdClass or string + * @param string[][]|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string */ - public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], mixed $responseBody = null) + public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -77,7 +77,7 @@ public function __construct(string $message = "", int $code = 0, ?array $respons /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders(): ?array { diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index ab9bde48483b2..23af1e3f501b3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -65,7 +65,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) @@ -78,7 +78,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/samples/client/petstore/php/psr-18/lib/ApiException.php b/samples/client/petstore/php/psr-18/lib/ApiException.php index 9fb8a86ad3b26..43644da922243 100644 --- a/samples/client/petstore/php/psr-18/lib/ApiException.php +++ b/samples/client/petstore/php/psr-18/lib/ApiException.php @@ -53,7 +53,7 @@ class ApiException extends RequestException /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -81,7 +81,7 @@ public function __construct( /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES new file mode 100644 index 0000000000000..1e29c70aedaa4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES @@ -0,0 +1,8 @@ +apis/DefaultApi.ts +apis/index.ts +index.ts +models/TestA.ts +models/TestB.ts +models/TestResponse.ts +models/index.ts +runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/DefaultApi.ts new file mode 100644 index 0000000000000..3383adf93dfd5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/DefaultApi.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + TestResponse, +} from '../models/index'; +import { + TestResponseFromJSON, + TestResponseToJSON, +} from '../models/index'; + +/** + * + */ +export class DefaultApi extends runtime.BaseAPI { + + /** + */ + async testRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/test`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TestResponseFromJSON(jsonValue)); + } + + /** + */ + async test(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.testRaw(initOverrides); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/index.ts new file mode 100644 index 0000000000000..69c44c00fa0d9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/index.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './DefaultApi'; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/index.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/index.ts new file mode 100644 index 0000000000000..bebe8bbbe2066 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestA.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestA.ts new file mode 100644 index 0000000000000..3b54d32cb5753 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestA.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TestA + */ +export interface TestA { + /** + * + * @type {string} + * @memberof TestA + */ + foo: string; +} + +/** + * Check if a given object implements the TestA interface. + */ +export function instanceOfTestA(value: object): value is TestA { + if (!('foo' in value) || value['foo'] === undefined) return false; + return true; +} + +export function TestAFromJSON(json: any): TestA { + return TestAFromJSONTyped(json, false); +} + +export function TestAFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestA { + if (json == null) { + return json; + } + return { + + 'foo': json['foo'], + }; +} + +export function TestAToJSON(value?: TestA | null): any { + if (value == null) { + return value; + } + return { + + 'foo': value['foo'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestB.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestB.ts new file mode 100644 index 0000000000000..d40209b76d456 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestB.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TestB + */ +export interface TestB { + /** + * + * @type {string} + * @memberof TestB + */ + bar: string; +} + +/** + * Check if a given object implements the TestB interface. + */ +export function instanceOfTestB(value: object): value is TestB { + if (!('bar' in value) || value['bar'] === undefined) return false; + return true; +} + +export function TestBFromJSON(json: any): TestB { + return TestBFromJSONTyped(json, false); +} + +export function TestBFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestB { + if (json == null) { + return json; + } + return { + + 'bar': json['bar'], + }; +} + +export function TestBToJSON(value?: TestB | null): any { + if (value == null) { + return value; + } + return { + + 'bar': value['bar'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestResponse.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestResponse.ts new file mode 100644 index 0000000000000..d37db87e324a1 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestResponse.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { TestA } from './TestA'; +import { + instanceOfTestA, + TestAFromJSON, + TestAFromJSONTyped, + TestAToJSON, +} from './TestA'; +import type { TestB } from './TestB'; +import { + instanceOfTestB, + TestBFromJSON, + TestBFromJSONTyped, + TestBToJSON, +} from './TestB'; + +/** + * @type TestResponse + * + * @export + */ +export type TestResponse = TestA | TestB; + +export function TestResponseFromJSON(json: any): TestResponse { + return TestResponseFromJSONTyped(json, false); +} + +export function TestResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestResponse { + if (json == null) { + return json; + } + if (instanceOfTestA(json)) { + return TestAFromJSONTyped(json, true); + } + if (instanceOfTestB(json)) { + return TestBFromJSONTyped(json, true); + } + + return {} as any; +} + +export function TestResponseToJSON(value?: TestResponse | null): any { + if (value == null) { + return value; + } + + if (instanceOfTestA(value)) { + return TestAToJSON(value as TestA); + } + if (instanceOfTestB(value)) { + return TestBToJSON(value as TestB); + } + + return {}; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/index.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/index.ts new file mode 100644 index 0000000000000..8da6963476f24 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './TestA'; +export * from './TestB'; +export * from './TestResponse'; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts new file mode 100644 index 0000000000000..9ccdf70373528 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts @@ -0,0 +1,426 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost:3000".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 59c5a4721c25d..801f0425adbec 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -208,7 +208,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -228,7 +228,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -248,7 +248,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -269,7 +269,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -290,7 +290,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -327,7 +327,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -343,7 +343,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -359,7 +359,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -375,7 +375,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -397,7 +397,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -413,7 +413,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -429,7 +429,7 @@ public ApiClient setBearerToken(String bearerToken) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -451,7 +451,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -463,7 +463,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -483,7 +483,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -505,7 +505,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -529,7 +529,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -551,7 +551,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -574,7 +574,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -595,7 +595,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java index d3def47a36cb0..a912297d21586 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -179,7 +179,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -199,7 +199,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -220,7 +220,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -241,7 +241,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -278,7 +278,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -294,7 +294,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -310,7 +310,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -326,7 +326,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -348,7 +348,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -364,7 +364,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -380,7 +380,7 @@ public ApiClient setBearerToken(String bearerToken) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -402,7 +402,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -414,7 +414,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -434,7 +434,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -456,7 +456,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -480,7 +480,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -502,7 +502,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -525,7 +525,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -546,7 +546,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java index f0088bf572bf7..62bd4c8ef14f9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java @@ -177,7 +177,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -197,7 +197,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -218,7 +218,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -239,7 +239,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -260,7 +260,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -305,7 +305,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -321,7 +321,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -375,7 +375,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -391,7 +391,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public ApiClient setBearerToken(String bearerToken) { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -424,7 +424,7 @@ public ApiClient setAccessToken(String accessToken) { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public ApiClient setOauthCredentials(String clientId, String clientSecret) { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -457,7 +457,7 @@ public ApiClient setOauthCredentialsForPublicClient(String clientId) { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public ApiClient setOauthPasswordFlow(String username, String password) { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public ApiClient setOauthAuthorizationCodeFlow(String code) { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public ApiClient setOauthScope(String scope) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -527,7 +527,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -539,7 +539,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -559,7 +559,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -581,7 +581,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -605,7 +605,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -627,7 +627,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -650,7 +650,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -671,7 +671,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java index f0088bf572bf7..62bd4c8ef14f9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -177,7 +177,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -197,7 +197,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -218,7 +218,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -239,7 +239,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -260,7 +260,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -305,7 +305,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -321,7 +321,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -375,7 +375,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -391,7 +391,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public ApiClient setBearerToken(String bearerToken) { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -424,7 +424,7 @@ public ApiClient setAccessToken(String accessToken) { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public ApiClient setOauthCredentials(String clientId, String clientSecret) { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -457,7 +457,7 @@ public ApiClient setOauthCredentialsForPublicClient(String clientId) { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public ApiClient setOauthPasswordFlow(String username, String password) { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public ApiClient setOauthAuthorizationCodeFlow(String code) { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public ApiClient setOauthScope(String scope) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -527,7 +527,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -539,7 +539,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -559,7 +559,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -581,7 +581,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -605,7 +605,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -627,7 +627,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -650,7 +650,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -671,7 +671,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 4ee92950064f5..0d607da88761d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -275,7 +275,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -295,7 +295,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -316,7 +316,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -337,7 +337,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -358,7 +358,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -403,7 +403,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -419,7 +419,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -435,7 +435,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -451,7 +451,7 @@ public ApiClient setApiKey(String apiKey) { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -473,7 +473,7 @@ public ApiClient configureApiKeys(Map secrets) { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public ApiClient setBearerToken(String bearerToken) { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -522,7 +522,7 @@ public ApiClient setAccessToken(String accessToken) { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -538,7 +538,7 @@ public ApiClient setOauthCredentials(String clientId, String clientSecret) { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -555,7 +555,7 @@ public ApiClient setOauthCredentialsForPublicClient(String clientId) { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -571,7 +571,7 @@ public ApiClient setOauthPasswordFlow(String username, String password) { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -587,7 +587,7 @@ public ApiClient setOauthAuthorizationCodeFlow(String code) { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -603,7 +603,7 @@ public ApiClient setOauthScope(String scope) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -625,7 +625,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -637,7 +637,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -657,7 +657,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -679,7 +679,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -703,7 +703,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -725,7 +725,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -748,7 +748,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -769,7 +769,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index 302e5dac53c66..db57dd1827b63 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -15,6 +15,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -66,6 +67,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -341,6 +343,7 @@ def sanitize_for_serialization(self, obj): If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -366,6 +369,8 @@ def sanitize_for_serialization(self, obj): ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -457,6 +462,8 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 9ab0756d53b4f..cb831d0de8135 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -15,6 +15,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -66,6 +67,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -338,6 +340,7 @@ def sanitize_for_serialization(self, obj): If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -363,6 +366,8 @@ def sanitize_for_serialization(self, obj): ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -454,6 +459,8 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/openapi3/client/petstore/python/tests/test_api_client.py b/samples/openapi3/client/petstore/python/tests/test_api_client.py index e80bc13529631..b444f326c675b 100644 --- a/samples/openapi3/client/petstore/python/tests/test_api_client.py +++ b/samples/openapi3/client/petstore/python/tests/test_api_client.py @@ -10,6 +10,7 @@ """ import unittest +from decimal import Decimal from enum import Enum from dateutil.parser import parse @@ -180,6 +181,11 @@ def test_sanitize_for_serialization_datetime(self): result = self.api_client.sanitize_for_serialization(data) self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") + def test_sanitize_for_serialization_decimal(self): + data = Decimal("1.0") + result = self.api_client.sanitize_for_serialization(data) + self.assertEquals(result, "1.0") + def test_sanitize_for_serialization_list_enum(self): class EnumSerialization(int, Enum): NUMBER_0 = 0 diff --git a/samples/openapi3/client/petstore/python/tests/test_deserialization.py b/samples/openapi3/client/petstore/python/tests/test_deserialization.py index 8fd654e4bb744..11b2955015ac5 100644 --- a/samples/openapi3/client/petstore/python/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests/test_deserialization.py @@ -14,6 +14,7 @@ import time import unittest import datetime +from decimal import Decimal import pytest as pytest @@ -130,6 +131,15 @@ def test_deserialize_datetime(self): deserialized = self.deserialize(response, "datetime", 'application/json') self.assertTrue(isinstance(deserialized, datetime.datetime)) + def test_deserialize_decimal(self): + """ deserialize decimal """ + data = 1.1 + response = json.dumps(data) + + deserialized = self.deserialize(response, "decimal", 'application/json') + self.assertTrue(isinstance(deserialized, Decimal)) + self.assertEqual(deserialized, Decimal(1.1)) + def test_deserialize_pet(self): """ deserialize pet """ data = { diff --git a/samples/server/petstore/aspnetcore-3.1/README.md b/samples/server/petstore/aspnetcore-3.1/README.md index cb9541519eae4..5da4721474e6b 100644 --- a/samples/server/petstore/aspnetcore-3.1/README.md +++ b/samples/server/petstore/aspnetcore-3.1/README.md @@ -1,4 +1,4 @@ -# Org.OpenAPITools - ASP.NET Core 3.1 Server +# Org.OpenAPITools - ASP.NET Core 8.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. diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile index 9fe18ee2ba3c9..c24f45dbc5a47 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile @@ -1,13 +1,13 @@ #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.1-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:8.0-buster-slim AS base WORKDIR /app EXPOSE 80 EXPOSE 443 # Build container -FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:8.0-buster AS build # Copy the code into the container WORKDIR /src diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs index b684e16a2d927..0adda89acc04d 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs @@ -84,7 +84,7 @@ public void ConfigureServices(IServiceCollection services) c.SwaggerDoc("1.0.0", new OpenApiInfo { Title = "OpenAPI Petstore", - Description = "OpenAPI Petstore (ASP.NET Core 3.1)", + Description = "OpenAPI Petstore (ASP.NET Core 8.0)", TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), Contact = new OpenApiContact { diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/FILES new file mode 100644 index 0000000000000..5813de3b53b50 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/FILES @@ -0,0 +1,38 @@ +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/DefaultApi.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/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.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-8.0-NewtonsoftFalse/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/Org.OpenAPITools.sln new file mode 100644 index 0000000000000..c2bc387642026 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +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-8.0-NewtonsoftFalse/README.md b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/README.md new file mode 100644 index 0000000000000..5da4721474e6b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.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-8.0-NewtonsoftFalse/build.bat b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.bat new file mode 100644 index 0000000000000..cd65518e42877 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.bat @@ -0,0 +1,9 @@ +:: 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-8.0-NewtonsoftFalse/build.sh b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.sh new file mode 100644 index 0000000000000..afbeddb83782c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.sh @@ -0,0 +1,8 @@ +#!/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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/.gitignore new file mode 100644 index 0000000000000..1ee53850b84cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 0000000000000..315555e2a4403 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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.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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 0000000000000..bfbe6290f235b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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.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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 0000000000000..3d7fbb77b0d56 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * 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 DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 0000000000000..6dd12a5fd682d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,73 @@ +/* + * 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 nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //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(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 0000000000000..d4230ca5a4c5b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 (Name = "api_key")]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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 0000000000000..2c52f026791db --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 0000000000000..5a0951513f3d5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 0000000000000..cdd3d463721ae --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 0000000000000..c24f45dbc5a47 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#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:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 0000000000000..97ae99c9295a5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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.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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 0000000000000..9eccd5c317f65 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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.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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 0000000000000..18796da30fcbc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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.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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 0000000000000..6172a1b27e9e8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,146 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 0000000000000..9362efa8367f5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,152 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 0000000000000..01639d12eed75 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,124 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 0000000000000..11eac79c5415a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,139 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 0000000000000..c08f6b036d993 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,124 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 0000000000000..cbf41566ae184 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,223 @@ +/* + * 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=true)] + 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.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(); + + 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 0000000000000..8b9f57ddc852d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,228 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 0000000000000..0a40e7f333ea5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,138 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 0000000000000..8777bf97e8d07 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,42 @@ +/* + * 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 +{ + /// + /// Gets or Sets TestEnum + /// + + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 0000000000000..18d3b5347c20e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,138 @@ +/* + * 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 TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { 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 TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).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((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// 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 (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 0000000000000..49dd6ebe2125d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,223 @@ +/* + * 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 0000000000000..122f58cabe4a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 0000000000000..9cc715ffd9fbb --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,26 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Program.cs new file mode 100644 index 0000000000000..00ed16ed67589 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 0000000000000..99cfeea4b9190 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 0000000000000..d2700aa1da794 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,150 @@ +/* + * 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 8.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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 0000000000000..e203e9407e74a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 0000000000000..def9159a7d940 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 0000000000000..6a0b78471a33c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# 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-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 0000000000000..f3318bc90a111 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 0000000000000..b47dce3d2c68b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable 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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object" + } ] + }, + "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" + } + }, + "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/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/FILES new file mode 100644 index 0000000000000..5813de3b53b50 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/FILES @@ -0,0 +1,38 @@ +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/DefaultApi.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/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.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-8.0-nullableReferenceTypes/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/Org.OpenAPITools.sln new file mode 100644 index 0000000000000..c2bc387642026 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +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-8.0-nullableReferenceTypes/README.md b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/README.md new file mode 100644 index 0000000000000..5da4721474e6b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.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-8.0-nullableReferenceTypes/build.bat b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.bat new file mode 100644 index 0000000000000..cd65518e42877 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.bat @@ -0,0 +1,9 @@ +:: 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-8.0-nullableReferenceTypes/build.sh b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.sh new file mode 100644 index 0000000000000..afbeddb83782c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.sh @@ -0,0 +1,8 @@ +#!/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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/.gitignore new file mode 100644 index 0000000000000..1ee53850b84cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## 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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 0000000000000..23d737e9bf00e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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.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 (parameter.Name != null && 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 && parameter.Name != null) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 0000000000000..bfbe6290f235b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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.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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 0000000000000..beabdde2fb10a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 0000000000000..a0f2bd3b2315a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,73 @@ +/* + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //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(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 0000000000000..fae01d29a624b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 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 + /// 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 + ? JsonConvert.DeserializeObject(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 (Name = "api_key")]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 + ? 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")] + [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 + ? 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 (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 + ? 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 + /// 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 + ? JsonConvert.DeserializeObject(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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 0000000000000..b925426c761d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 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 (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 + ? JsonConvert.DeserializeObject>(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 + ? 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")] + [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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 0000000000000..6d7094c81a9d2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 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")] + [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 + ? 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 (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 + ? 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")] + [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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 0000000000000..32303e7a4104d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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 + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 0000000000000..c24f45dbc5a47 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#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:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 0000000000000..97ae99c9295a5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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.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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 0000000000000..9eccd5c317f65 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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.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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 0000000000000..18796da30fcbc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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.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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 0000000000000..c9da013dc71d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [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() + { + 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((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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 0000000000000..638c131371066 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 0000000000000..710b6a34d82ea --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [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() + { + 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((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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 0000000000000..e9718bd5ca05a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 0000000000000..5ea23a2f881f4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [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() + { + 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((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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 0000000000000..626ad7c4e84e3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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=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=true)] + 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=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() + { + 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.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(); + + 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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 0000000000000..69a963a25f247 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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=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 + [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=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() + { + 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/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 0000000000000..4d7834b4c52db --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 0000000000000..10227a2a2c40f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 0000000000000..c07abecc09aad --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string? Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string? NullableName { 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 TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).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((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// 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 (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 0000000000000..4d07fc1ef74ab --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 0000000000000..122f58cabe4a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 0000000000000..734cc7dbef410 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,28 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + annotations + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Program.cs new file mode 100644 index 0000000000000..00ed16ed67589 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 0000000000000..99cfeea4b9190 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 0000000000000..0adda89acc04d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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; +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()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + 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 8.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(); + }); + 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.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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 0000000000000..e203e9407e74a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 0000000000000..def9159a7d940 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 0000000000000..6a0b78471a33c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# 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-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 0000000000000..f3318bc90a111 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 0000000000000..b47dce3d2c68b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable 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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object" + } ] + }, + "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" + } + }, + "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/aspnetcore-8.0-pocoModels/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/FILES new file mode 100644 index 0000000000000..5813de3b53b50 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/FILES @@ -0,0 +1,38 @@ +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/DefaultApi.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/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.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-8.0-pocoModels/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-pocoModels/Org.OpenAPITools.sln new file mode 100644 index 0000000000000..c2bc387642026 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +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-8.0-pocoModels/README.md b/samples/server/petstore/aspnetcore-8.0-pocoModels/README.md new file mode 100644 index 0000000000000..5da4721474e6b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.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-8.0-pocoModels/build.bat b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.bat new file mode 100644 index 0000000000000..cd65518e42877 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.bat @@ -0,0 +1,9 @@ +:: 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-8.0-pocoModels/build.sh b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.sh new file mode 100644 index 0000000000000..afbeddb83782c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.sh @@ -0,0 +1,8 @@ +#!/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-8.0-pocoModels/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/.gitignore new file mode 100644 index 0000000000000..1ee53850b84cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## 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-8.0-pocoModels/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 0000000000000..315555e2a4403 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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.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-8.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 0000000000000..bfbe6290f235b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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.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-8.0-pocoModels/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 0000000000000..beabdde2fb10a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 0000000000000..a0f2bd3b2315a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,73 @@ +/* + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //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(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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-8.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 0000000000000..7dded4e0f16a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 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 + /// 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 + ? JsonConvert.DeserializeObject(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 (Name = "api_key")]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 + ? 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")] + [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 + ? 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 (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 + ? 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 + /// 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 + ? JsonConvert.DeserializeObject(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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 0000000000000..b925426c761d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 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 (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 + ? JsonConvert.DeserializeObject>(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 + ? 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")] + [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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 0000000000000..6d7094c81a9d2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 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")] + [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 + ? 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 (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 + ? 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")] + [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-8.0-pocoModels/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 0000000000000..7d1a4ed4ffbf4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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 + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 0000000000000..c24f45dbc5a47 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#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:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.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-8.0-pocoModels/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 0000000000000..97ae99c9295a5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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.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-8.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 0000000000000..9eccd5c317f65 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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.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-8.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 0000000000000..18796da30fcbc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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.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-8.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 0000000000000..c7a6ae09eaaed --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,51 @@ +/* + * 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 JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [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 + { + /// + /// 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"; + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 0000000000000..223b4a4d6561e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,48 @@ +/* + * 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 + { + /// + /// 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; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 0000000000000..537c0f7f7145e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,36 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 0000000000000..a453e45e11512 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,43 @@ +/* + * 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 + { + /// + /// 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; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 0000000000000..f1a5269523394 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,36 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 0000000000000..7a68506eaa480 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,96 @@ +/* + * 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 + { + /// + /// 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=true)] + 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=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool Complete { get; set; } = false; + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 0000000000000..fa3ddfa5110fa --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,99 @@ +/* + * 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 + { + /// + /// 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 + [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=true)] + public StatusEnum Status { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 0000000000000..8dfa88aa9da7c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,42 @@ +/* + * 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 + { + /// + /// 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; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 0000000000000..10227a2a2c40f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 0000000000000..f2b9c2ebe4770 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,42 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public partial class TestNullable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 0000000000000..fb756914eb5f0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,79 @@ +/* + * 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 + { + /// + /// 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; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 0000000000000..122f58cabe4a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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-8.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 0000000000000..745c764b50182 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,27 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Program.cs new file mode 100644 index 0000000000000..00ed16ed67589 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +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-8.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 0000000000000..99cfeea4b9190 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$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-8.0-pocoModels/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 0000000000000..0adda89acc04d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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; +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()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + 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 8.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(); + }); + 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.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-8.0-pocoModels/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 0000000000000..e203e9407e74a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 0000000000000..def9159a7d940 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 0000000000000..6a0b78471a33c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# 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-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 0000000000000..f3318bc90a111 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 0000000000000..b47dce3d2c68b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable 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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object" + } ] + }, + "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" + } + }, + "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/aspnetcore-8.0-project4Models/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/FILES new file mode 100644 index 0000000000000..2f0226d29bc8a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/FILES @@ -0,0 +1,40 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools.Models/.gitignore +src/Org.OpenAPITools.Models/Animal.cs +src/Org.OpenAPITools.Models/ApiResponse.cs +src/Org.OpenAPITools.Models/Cat.cs +src/Org.OpenAPITools.Models/Category.cs +src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools.Models/Dog.cs +src/Org.OpenAPITools.Models/Order.cs +src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj +src/Org.OpenAPITools.Models/Pet.cs +src/Org.OpenAPITools.Models/Tag.cs +src/Org.OpenAPITools.Models/TestEnum.cs +src/Org.OpenAPITools.Models/TestNullable.cs +src/Org.OpenAPITools.Models/User.cs +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/DefaultApi.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/Dockerfile +src/Org.OpenAPITools/Filters/BasePathFilter.cs +src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.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-8.0-project4Models/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-project4Models/Org.OpenAPITools.sln new file mode 100644 index 0000000000000..d229ac688debc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/Org.OpenAPITools.sln @@ -0,0 +1,28 @@ + +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 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Models", "src\Org.OpenAPITools.Models\Org.OpenAPITools.Models.csproj", "{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}" +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 + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/README.md b/samples/server/petstore/aspnetcore-8.0-project4Models/README.md new file mode 100644 index 0000000000000..5da4721474e6b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.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-8.0-project4Models/build.bat b/samples/server/petstore/aspnetcore-8.0-project4Models/build.bat new file mode 100644 index 0000000000000..cd65518e42877 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/build.bat @@ -0,0 +1,9 @@ +:: 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-8.0-project4Models/build.sh b/samples/server/petstore/aspnetcore-8.0-project4Models/build.sh new file mode 100644 index 0000000000000..afbeddb83782c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/build.sh @@ -0,0 +1,8 @@ +#!/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-8.0-project4Models/src/Org.OpenAPITools.Models/.gitignore b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/.gitignore new file mode 100644 index 0000000000000..1ee53850b84cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/.gitignore @@ -0,0 +1,362 @@ +## 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-8.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs new file mode 100644 index 0000000000000..4b04346e358f8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [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() + { + 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((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-8.0-project4Models/src/Org.OpenAPITools.Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/ApiResponse.cs new file mode 100644 index 0000000000000..2358b07fa7d4b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs new file mode 100644 index 0000000000000..ef5b1be3efb4d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [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() + { + 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((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-8.0-project4Models/src/Org.OpenAPITools.Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Category.cs new file mode 100644 index 0000000000000..7898abbb9ff69 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs new file mode 100644 index 0000000000000..7d1a4ed4ffbf4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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 + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs new file mode 100644 index 0000000000000..2dd6a7f43628c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [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() + { + 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((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-8.0-project4Models/src/Org.OpenAPITools.Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Order.cs new file mode 100644 index 0000000000000..5076e34732ae1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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=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=true)] + 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=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() + { + 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.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(); + + 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-8.0-project4Models/src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj new file mode 100644 index 0000000000000..4ac779e720a31 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj @@ -0,0 +1,23 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Library + Org.OpenAPITools.Models + Org.OpenAPITools.Models + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs new file mode 100644 index 0000000000000..31a57ea77355f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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=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 + [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=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() + { + 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/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Tag.cs new file mode 100644 index 0000000000000..84ccb02359ba9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestEnum.cs new file mode 100644 index 0000000000000..10227a2a2c40f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs new file mode 100644 index 0000000000000..8db75f2dafd6c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { 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 TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).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((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// 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 (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/User.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/User.cs new file mode 100644 index 0000000000000..9155e7309fc37 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/.gitignore new file mode 100644 index 0000000000000..1ee53850b84cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## 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-8.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 0000000000000..315555e2a4403 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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.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-8.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 0000000000000..bfbe6290f235b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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.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-8.0-project4Models/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 0000000000000..beabdde2fb10a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 0000000000000..a0f2bd3b2315a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,73 @@ +/* + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //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(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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-8.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 0000000000000..7dded4e0f16a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 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 + /// 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 + ? JsonConvert.DeserializeObject(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 (Name = "api_key")]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 + ? 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")] + [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 + ? 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 (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 + ? 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 + /// 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 + ? JsonConvert.DeserializeObject(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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 0000000000000..b925426c761d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 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 (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 + ? JsonConvert.DeserializeObject>(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 + ? 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")] + [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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 0000000000000..6d7094c81a9d2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 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")] + [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 + ? 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 (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 + ? 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")] + [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-8.0-project4Models/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 0000000000000..c24f45dbc5a47 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#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:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.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-8.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 0000000000000..97ae99c9295a5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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.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-8.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 0000000000000..9eccd5c317f65 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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.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-8.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 0000000000000..18796da30fcbc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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.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-8.0-project4Models/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 0000000000000..122f58cabe4a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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-8.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 0000000000000..ffc93a97da389 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,27 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Program.cs new file mode 100644 index 0000000000000..00ed16ed67589 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +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-8.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 0000000000000..99cfeea4b9190 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$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-8.0-project4Models/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 0000000000000..0adda89acc04d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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; +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()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + 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 8.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(); + }); + 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.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-8.0-project4Models/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 0000000000000..e203e9407e74a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 0000000000000..def9159a7d940 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 0000000000000..6a0b78471a33c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# 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-8.0-project4Models/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 0000000000000..f3318bc90a111 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 0000000000000..b47dce3d2c68b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable 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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object" + } ] + }, + "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" + } + }, + "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/aspnetcore-8.0-useSwashBuckle/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/FILES new file mode 100644 index 0000000000000..8da23f0cd0907 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/FILES @@ -0,0 +1,28 @@ +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/DefaultApi.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/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/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/Org.OpenAPITools.sln new file mode 100644 index 0000000000000..c2bc387642026 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +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-8.0-useSwashBuckle/README.md b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/README.md new file mode 100644 index 0000000000000..9a7702f697981 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/README.md @@ -0,0 +1,43 @@ +# Org.OpenAPITools - ASP.NET Core 8.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 +``` diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.bat b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.bat new file mode 100644 index 0000000000000..cd65518e42877 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.bat @@ -0,0 +1,9 @@ +:: 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-8.0-useSwashBuckle/build.sh b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.sh new file mode 100644 index 0000000000000..afbeddb83782c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.sh @@ -0,0 +1,8 @@ +#!/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-8.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore new file mode 100644 index 0000000000000..1ee53850b84cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## 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-8.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 0000000000000..315555e2a4403 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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.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-8.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 0000000000000..bfbe6290f235b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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.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-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 0000000000000..7ef97038061ee --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,38 @@ +/* + * 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 Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + public abstract IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 0000000000000..d1cc02582f7b0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,48 @@ +/* + * 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 Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(TestNullable))] + public abstract IActionResult FakeNullableExampleTest(); + + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + public abstract IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 0000000000000..20656c81638c0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,136 @@ +/* + * 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 Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract 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] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult AddPet([FromBody]Pet pet); + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + public abstract IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(List))] + public abstract IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(List))] + [Obsolete] + public abstract IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult UpdatePet([FromBody]Pet pet); + + /// + /// 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] + public abstract IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(ApiResponse))] + public abstract IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 0000000000000..3ec0d549c4a13 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,79 @@ +/* + * 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 Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract 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] + public abstract IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(Dictionary))] + public abstract IActionResult GetInventory(); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(Order))] + public abstract IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(Order))] + public abstract IActionResult PlaceOrder([FromBody]Order order); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 0000000000000..2de74542f7956 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,129 @@ +/* + * 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 Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract 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] + public abstract IActionResult CreateUser([FromBody]User user); + + /// + /// 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] + public abstract IActionResult CreateUsersWithArrayInput([FromBody]List user); + + /// + /// 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] + public abstract IActionResult CreateUsersWithListInput([FromBody]List user); + + /// + /// 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] + public abstract IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(User))] + public abstract IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username); + + /// + /// 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] + [ProducesResponseType(statusCode: 200, type: typeof(string))] + public abstract 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); + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + public abstract IActionResult LogoutUser(); + + /// + /// 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] + public abstract IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 0000000000000..7d1a4ed4ffbf4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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 + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 0000000000000..18796da30fcbc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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.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-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 0000000000000..9dcb10746c9ef --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,138 @@ +/* + * 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 JsonSubTypes; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + public 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() + { + 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((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-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 0000000000000..4963d2e9b8e39 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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 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() + { + 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/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 0000000000000..916049da141d3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public 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() + { + 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((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-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 0000000000000..67a508071a748 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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 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() + { + 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/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 0000000000000..22dae6cd3d758 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public 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() + { + 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((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-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 0000000000000..5b3d6c1aaac86 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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 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=true)] + 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=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() + { + 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.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(); + + 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-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 0000000000000..0b638a66b1464 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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 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 + [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=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() + { + 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/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 0000000000000..a9e492ebddf74 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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 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() + { + 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/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 0000000000000..10227a2a2c40f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 0000000000000..d61290a27c674 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { 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 TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).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((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// 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 (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 0000000000000..ab41cb3843af6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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 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() + { + 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/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 0000000000000..122f58cabe4a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 0000000000000..9fa884cf93075 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,26 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Library + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec new file mode 100644 index 0000000000000..b1d83a359618d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -0,0 +1,20 @@ + + + + $id$ + 1.0.0 + OpenAPI Library + OpenAPI + OpenAPI + https://www.apache.org/licenses/LICENSE-2.0.html + + false + A library generated from a OpenAPI doc + Summary of changes made in this release of the package. + No Copyright + Org.OpenAPITools + + diff --git a/samples/server/petstore/aspnetcore-8.0/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/aspnetcore-8.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/FILES new file mode 100644 index 0000000000000..5813de3b53b50 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/FILES @@ -0,0 +1,38 @@ +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/DefaultApi.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/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.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-8.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0/Org.OpenAPITools.sln new file mode 100644 index 0000000000000..c2bc387642026 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +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-8.0/README.md b/samples/server/petstore/aspnetcore-8.0/README.md new file mode 100644 index 0000000000000..5da4721474e6b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.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-8.0/build.bat b/samples/server/petstore/aspnetcore-8.0/build.bat new file mode 100644 index 0000000000000..cd65518e42877 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/build.bat @@ -0,0 +1,9 @@ +:: 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-8.0/build.sh b/samples/server/petstore/aspnetcore-8.0/build.sh new file mode 100644 index 0000000000000..afbeddb83782c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/build.sh @@ -0,0 +1,8 @@ +#!/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-8.0/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/.gitignore new file mode 100644 index 0000000000000..1ee53850b84cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## 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-8.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 0000000000000..315555e2a4403 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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.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-8.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 0000000000000..bfbe6290f235b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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.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-8.0/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 0000000000000..beabdde2fb10a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 0000000000000..a0f2bd3b2315a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,73 @@ +/* + * 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 Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //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(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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-8.0/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 0000000000000..7dded4e0f16a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 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 + /// 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 + ? JsonConvert.DeserializeObject(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 (Name = "api_key")]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 + ? 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")] + [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 + ? 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 (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 + ? 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 + /// 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 + ? JsonConvert.DeserializeObject(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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 0000000000000..b925426c761d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 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 (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 + ? JsonConvert.DeserializeObject>(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 + ? 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")] + [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 + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 0000000000000..6d7094c81a9d2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 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")] + [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 + ? 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 (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 + ? 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")] + [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-8.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 0000000000000..7d1a4ed4ffbf4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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 + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 0000000000000..c24f45dbc5a47 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#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:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.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-8.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 0000000000000..97ae99c9295a5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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.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-8.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 0000000000000..9eccd5c317f65 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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.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-8.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 0000000000000..18796da30fcbc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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.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-8.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 0000000000000..4b04346e358f8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [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() + { + 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((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-8.0/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 0000000000000..2358b07fa7d4b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 0000000000000..ef5b1be3efb4d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [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() + { + 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((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-8.0/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 0000000000000..7898abbb9ff69 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 0000000000000..2dd6a7f43628c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// + /// + [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() + { + 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((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-8.0/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 0000000000000..5076e34732ae1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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=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=true)] + 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=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() + { + 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.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(); + + 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-8.0/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 0000000000000..31a57ea77355f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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=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 + [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=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() + { + 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/aspnetcore-8.0/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 0000000000000..84ccb02359ba9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 0000000000000..10227a2a2c40f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 0000000000000..8db75f2dafd6c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { 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 TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).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((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// 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 (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 0000000000000..9155e7309fc37 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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=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() + { + 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/aspnetcore-8.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 0000000000000..122f58cabe4a2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +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-8.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 0000000000000..745c764b50182 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,27 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Program.cs new file mode 100644 index 0000000000000..00ed16ed67589 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +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-8.0/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 0000000000000..99cfeea4b9190 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$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-8.0/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 0000000000000..0adda89acc04d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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; +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()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + 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 8.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(); + }); + 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.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-8.0/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 0000000000000..e203e9407e74a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 0000000000000..def9159a7d940 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 0000000000000..6a0b78471a33c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# 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-8.0/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 0000000000000..f3318bc90a111 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 0000000000000..b47dce3d2c68b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable 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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object" + } ] + }, + "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" + } + }, + "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/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 44fe2b0a0a2a2..5f7750b96b9ed 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index eba1aaaac3611..9e61cf651455e 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -228,9 +228,9 @@ for this project used jakarta.validation-api --> 4.13.2 1.4.14 2.0.2 - 3.3.0 + 3.5.9 2.17.1 - 1.3.5 + 1.3.5 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index b235fff6710ab..eba9703eb6965 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -228,9 +228,9 @@ for this project used jakarta.validation-api --> 4.13.2 1.4.14 2.0.2 - 3.3.0 + 3.5.9 2.17.1 - 1.3.5 + 1.3.5 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 8ccaf25c779d7..8d20bbb7f1f63 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -228,9 +228,9 @@ for this project used jakarta.validation-api --> 4.13.2 1.4.14 2.0.2 - 3.3.0 + 3.5.9 2.17.1 - 1.3.5 + 1.3.5 UTF-8 diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator-ignore b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/FILES new file mode 100644 index 0000000000000..c02ae2405be01 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/FILES @@ -0,0 +1,23 @@ +README.md +build.gradle.kts +pom.xml +settings.gradle +src/main/kotlin/org/openapitools/Application.kt +src/main/kotlin/org/openapitools/api/ApiUtil.kt +src/main/kotlin/org/openapitools/api/Exceptions.kt +src/main/kotlin/org/openapitools/api/PetApi.kt +src/main/kotlin/org/openapitools/api/PetApiController.kt +src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +src/main/kotlin/org/openapitools/api/StoreApi.kt +src/main/kotlin/org/openapitools/api/StoreApiController.kt +src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +src/main/kotlin/org/openapitools/api/UserApi.kt +src/main/kotlin/org/openapitools/api/UserApiController.kt +src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +src/main/kotlin/org/openapitools/model/Category.kt +src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +src/main/kotlin/org/openapitools/model/Order.kt +src/main/kotlin/org/openapitools/model/Pet.kt +src/main/kotlin/org/openapitools/model/Tag.kt +src/main/kotlin/org/openapitools/model/User.kt +src/main/resources/application.yaml diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/README.md b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/README.md new file mode 100644 index 0000000000000..b6865a0811356 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/README.md @@ -0,0 +1,21 @@ +# openAPIPetstore + +This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). + +## Getting Started + +This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in. + +By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl). + +To build the project using maven, run: +```bash +mvn package && java -jar target/openapi-spring-1.0.0.jar +``` + +To build the project using gradle, run: +```bash +gradle build && java -jar build/libs/openapi-spring-1.0.0.jar +``` + +If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/) diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/build.gradle.kts b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/build.gradle.kts new file mode 100644 index 0000000000000..aed068708def4 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/build.gradle.kts @@ -0,0 +1,43 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +group = "org.openapitools" +version = "1.0.0" +java.sourceCompatibility = JavaVersion.VERSION_17 + +repositories { + mavenCentral() + maven { url = uri("https://repo.spring.io/milestone") } +} + +tasks.withType { + kotlinOptions.jvmTarget = "17" +} + +plugins { + val kotlinVersion = "1.7.10" + id("org.jetbrains.kotlin.jvm") version kotlinVersion + id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion + id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion + id("org.springframework.boot") version "3.0.2" + id("io.spring.dependency-management") version "1.0.14.RELEASE" +} + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation("org.springframework.boot:spring-boot-starter-web") + implementation("io.swagger.core.v3:swagger-annotations:2.2.0") + + implementation("com.google.code.findbugs:jsr305:3.0.2") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin") + implementation("jakarta.validation:jakarta.validation-api") + implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") + + testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") + testImplementation("org.springframework.boot:spring-boot-starter-test") { + exclude(module = "junit") + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml new file mode 100644 index 0000000000000..77ec696451895 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml @@ -0,0 +1,149 @@ + + 4.0.0 + org.openapitools + openapi-spring + jar + openapi-spring + 1.0.0 + + 2.2.15 + 3.0.2 + 2.1.0 + 1.7.10 + + 1.7.10 + UTF-8 + + + org.springframework.boot + spring-boot-starter-parent + 3.1.3 + + + + repository.spring.milestone + Spring Milestone Repository + https://repo.spring.io/milestone + + + + + spring-milestones + https://repo.spring.io/milestone + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + spring + + 17 + + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} + + + org.springframework.boot + spring-boot-starter-web + + + + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations.version} + + + + + com.google.code.findbugs + jsr305 + ${findbugs-jsr305.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + jakarta.validation + jakarta.validation-api + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation.version} + provided + + + org.jetbrains.kotlin + kotlin-test-junit5 + ${kotlin-test-junit5.version} + test + + + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/settings.gradle b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/settings.gradle new file mode 100644 index 0000000000000..14844905cd401 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/settings.gradle @@ -0,0 +1,15 @@ +pluginManagement { + repositories { + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } + gradlePluginPortal() + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.springframework.boot") { + useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") + } + } + } +} +rootProject.name = "openapi-spring" diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/Application.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/Application.kt new file mode 100644 index 0000000000000..2fe6de62479e9 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/Application.kt @@ -0,0 +1,13 @@ +package org.openapitools + +import org.springframework.boot.runApplication +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan + +@SpringBootApplication +@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"]) +class Application + +fun main(args: Array) { + runApplication(*args) +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 0000000000000..03344e13b4745 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package org.openapitools.api + +import org.springframework.web.context.request.NativeWebRequest + +import jakarta.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res?.characterEncoding = "UTF-8" + res?.addHeader("Content-Type", contentType) + res?.writer?.print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt new file mode 100644 index 0000000000000..117161bf65b15 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -0,0 +1,29 @@ +package org.openapitools.api + +import org.springframework.http.HttpStatus +import org.springframework.web.bind.annotation.ControllerAdvice +import org.springframework.web.bind.annotation.ExceptionHandler +import jakarta.servlet.http.HttpServletResponse +import jakarta.validation.ConstraintViolationException + +// TODO Extend ApiException for custom exception handling, e.g. the below NotFound exception +sealed class ApiException(msg: String, val code: Int) : Exception(msg) + +class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) + + +@ControllerAdvice +class DefaultExceptionHandler { + + @ExceptionHandler(value = [ApiException::class]) + fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = + response.sendError(ex.code, ex.message) + + @ExceptionHandler(value = [NotImplementedError::class]) + fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + + @ExceptionHandler(value = [ConstraintViolationException::class]) + fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt new file mode 100644 index 0000000000000..e737193c65a11 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -0,0 +1,205 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.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.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:/v2}") +interface PetApi { + + fun getDelegate(): PetApiDelegate + + @Operation( + tags = ["pet",], + summary = "Add a new pet to the store", + operationId = "addPet", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]), + ApiResponse(responseCode = "405", description = "Invalid input") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/pet"], + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) + fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { + return getDelegate().addPet(pet) + } + + @Operation( + tags = ["pet",], + summary = "Deletes a pet", + operationId = "deletePet", + description = """""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid pet value") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.DELETE], + value = ["/pet/{petId}"] + ) + fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?): ResponseEntity { + return getDelegate().deletePet(petId, apiKey) + } + + @Operation( + tags = ["pet",], + summary = "Finds Pets by status", + operationId = "findPetsByStatus", + description = """Multiple status values can be provided with comma separated strings""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]), + ApiResponse(responseCode = "400", description = "Invalid status value") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"] + ) + fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List): ResponseEntity> { + return getDelegate().findPetsByStatus(status) + } + + @Operation( + tags = ["pet",], + summary = "Finds Pets by tags", + operationId = "findPetsByTags", + description = """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]), + ApiResponse(responseCode = "400", description = "Invalid tag value") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"] + ) + fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List): ResponseEntity> { + return getDelegate().findPetsByTags(tags) + } + + @Operation( + tags = ["pet",], + summary = "Find pet by ID", + operationId = "getPetById", + description = """Returns a single pet""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(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"] + ) + fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long): ResponseEntity { + return getDelegate().getPetById(petId) + } + + @Operation( + tags = ["pet",], + summary = "Update an existing pet", + operationId = "updatePet", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]), + 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"], + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) + fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { + return getDelegate().updatePet(pet) + } + + @Operation( + tags = ["pet",], + summary = "Updates a pet in the store with form data", + operationId = "updatePetWithForm", + description = """""", + 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"] + ) + fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity { + return getDelegate().updatePetWithForm(petId, name, status) + } + + @Operation( + tags = ["pet",], + summary = "uploads an image", + operationId = "uploadFile", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(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"] + ) + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + return getDelegate().uploadFile(petId, additionalMetadata, file) + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiController.kt new file mode 100644 index 0000000000000..23bddf52df00c --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -0,0 +1,14 @@ +package org.openapitools.api + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import java.util.Optional + +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") +@Controller +class PetApiController( + private val delegate: PetApiDelegate +) : PetApi { + + override fun getDelegate(): PetApiDelegate = delegate +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt new file mode 100644 index 0000000000000..4bdc9193b0d43 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -0,0 +1,74 @@ +package org.openapitools.api + +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.core.io.Resource + +import java.util.Optional + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") +interface PetApiDelegate { + + fun getRequest(): Optional = Optional.empty() + + /** + * @see PetApi#addPet + */ + fun addPet(pet: Pet): ResponseEntity + + + /** + * @see PetApi#deletePet + */ + fun deletePet(petId: kotlin.Long, + apiKey: kotlin.String?): ResponseEntity + + + /** + * @see PetApi#findPetsByStatus + */ + fun findPetsByStatus(status: kotlin.collections.List): ResponseEntity> + + + /** + * @see PetApi#findPetsByTags + */ + fun findPetsByTags(tags: kotlin.collections.List): ResponseEntity> + + + /** + * @see PetApi#getPetById + */ + fun getPetById(petId: kotlin.Long): ResponseEntity + + + /** + * @see PetApi#updatePet + */ + fun updatePet(pet: Pet): ResponseEntity + + + /** + * @see PetApi#updatePetWithForm + */ + fun updatePetWithForm(petId: kotlin.Long, + name: kotlin.String?, + status: kotlin.String?): ResponseEntity + + + /** + * @see PetApi#uploadFile + */ + fun uploadFile(petId: kotlin.Long, + additionalMetadata: kotlin.String?, + file: Resource?): ResponseEntity + +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt new file mode 100644 index 0000000000000..b4c58bd7cbd4a --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -0,0 +1,119 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package org.openapitools.api + +import org.openapitools.model.Order +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:/v2}") +interface StoreApi { + + fun getDelegate(): StoreApiDelegate + + @Operation( + tags = ["store",], + summary = "Delete purchase order by ID", + operationId = "deleteOrder", + description = """For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + ApiResponse(responseCode = "404", description = "Order not found") + ] + ) + @RequestMapping( + method = [RequestMethod.DELETE], + value = ["/store/order/{orderId}"] + ) + fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String): ResponseEntity { + return getDelegate().deleteOrder(orderId) + } + + @Operation( + tags = ["store",], + summary = "Returns pet inventories by status", + operationId = "getInventory", + description = """Returns a map of status codes to quantities""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = kotlin.collections.Map::class))]) + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/store/inventory"], + produces = ["application/json"] + ) + fun getInventory(): ResponseEntity> { + return getDelegate().getInventory() + } + + @Operation( + tags = ["store",], + summary = "Find purchase order by ID", + operationId = "getOrderById", + description = """For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(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/{orderId}"], + produces = ["application/xml", "application/json"] + ) + fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long): ResponseEntity { + return getDelegate().getOrderById(orderId) + } + + @Operation( + tags = ["store",], + summary = "Place an order for a pet", + operationId = "placeOrder", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Order::class))]), + ApiResponse(responseCode = "400", description = "Invalid Order") + ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"] + ) + fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order): ResponseEntity { + return getDelegate().placeOrder(order) + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiController.kt new file mode 100644 index 0000000000000..1117b5b3ac349 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -0,0 +1,14 @@ +package org.openapitools.api + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import java.util.Optional + +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") +@Controller +class StoreApiController( + private val delegate: StoreApiDelegate +) : StoreApi { + + override fun getDelegate(): StoreApiDelegate = delegate +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt new file mode 100644 index 0000000000000..3343e0dc02784 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -0,0 +1,44 @@ +package org.openapitools.api + +import org.openapitools.model.Order +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.core.io.Resource + +import java.util.Optional + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") +interface StoreApiDelegate { + + fun getRequest(): Optional = Optional.empty() + + /** + * @see StoreApi#deleteOrder + */ + fun deleteOrder(orderId: kotlin.String): ResponseEntity + + + /** + * @see StoreApi#getInventory + */ + fun getInventory(): ResponseEntity> + + + /** + * @see StoreApi#getOrderById + */ + fun getOrderById(orderId: kotlin.Long): ResponseEntity + + + /** + * @see StoreApi#placeOrder + */ + fun placeOrder(order: Order): ResponseEntity + +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt new file mode 100644 index 0000000000000..1f7ae722ea283 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -0,0 +1,195 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package org.openapitools.api + +import org.openapitools.model.User +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:/v2}") +interface UserApi { + + fun getDelegate(): UserApiDelegate + + @Operation( + tags = ["user",], + summary = "Create user", + operationId = "createUser", + description = """This can only be done by the logged in user.""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/user"], + consumes = ["application/json"] + ) + fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User): ResponseEntity { + return getDelegate().createUser(user) + } + + @Operation( + tags = ["user",], + summary = "Creates list of users with given input array", + operationId = "createUsersWithArrayInput", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/user/createWithArray"], + consumes = ["application/json"] + ) + fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { + return getDelegate().createUsersWithArrayInput(user) + } + + @Operation( + tags = ["user",], + summary = "Creates list of users with given input array", + operationId = "createUsersWithListInput", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/user/createWithList"], + consumes = ["application/json"] + ) + fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { + return getDelegate().createUsersWithListInput(user) + } + + @Operation( + tags = ["user",], + summary = "Delete user", + operationId = "deleteUser", + description = """This can only be done by the logged in user.""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid username supplied"), + ApiResponse(responseCode = "404", description = "User not found") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.DELETE], + value = ["/user/{username}"] + ) + fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { + return getDelegate().deleteUser(username) + } + + @Operation( + tags = ["user",], + summary = "Get user by user name", + operationId = "getUserByName", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(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"] + ) + fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { + return getDelegate().getUserByName(username) + } + + @Operation( + tags = ["user",], + summary = "Logs user into the system", + operationId = "loginUser", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = kotlin.String::class))]), + ApiResponse(responseCode = "400", description = "Invalid username/password supplied") + ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/user/login"], + produces = ["application/xml", "application/json"] + ) + fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity { + return getDelegate().loginUser(username, password) + } + + @Operation( + tags = ["user",], + summary = "Logs out current logged in user session", + operationId = "logoutUser", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/user/logout"] + ) + fun logoutUser(): ResponseEntity { + return getDelegate().logoutUser() + } + + @Operation( + tags = ["user",], + summary = "Updated user", + operationId = "updateUser", + description = """This can only be done by the logged in user.""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid user supplied"), + ApiResponse(responseCode = "404", description = "User not found") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.PUT], + value = ["/user/{username}"], + consumes = ["application/json"] + ) + fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User): ResponseEntity { + return getDelegate().updateUser(username, user) + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiController.kt new file mode 100644 index 0000000000000..229c17008f8de --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -0,0 +1,14 @@ +package org.openapitools.api + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import java.util.Optional + +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") +@Controller +class UserApiController( + private val delegate: UserApiDelegate +) : UserApi { + + override fun getDelegate(): UserApiDelegate = delegate +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt new file mode 100644 index 0000000000000..8276fd4055293 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -0,0 +1,70 @@ +package org.openapitools.api + +import org.openapitools.model.User +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.core.io.Resource + +import java.util.Optional + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") +interface UserApiDelegate { + + fun getRequest(): Optional = Optional.empty() + + /** + * @see UserApi#createUser + */ + fun createUser(user: User): ResponseEntity + + + /** + * @see UserApi#createUsersWithArrayInput + */ + fun createUsersWithArrayInput(user: kotlin.collections.List): ResponseEntity + + + /** + * @see UserApi#createUsersWithListInput + */ + fun createUsersWithListInput(user: kotlin.collections.List): ResponseEntity + + + /** + * @see UserApi#deleteUser + */ + fun deleteUser(username: kotlin.String): ResponseEntity + + + /** + * @see UserApi#getUserByName + */ + fun getUserByName(username: kotlin.String): ResponseEntity + + + /** + * @see UserApi#loginUser + */ + fun loginUser(username: kotlin.String, + password: kotlin.String): ResponseEntity + + + /** + * @see UserApi#logoutUser + */ + fun logoutUser(): ResponseEntity + + + /** + * @see UserApi#updateUser + */ + fun updateUser(username: kotlin.String, + user: User): ResponseEntity + +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Category.kt new file mode 100644 index 0000000000000..615e56c9b85ae --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Category.kt @@ -0,0 +1,32 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * A category for a pet + * @param id + * @param name + */ +data class Category( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Schema(example = "null", description = "") + @get:JsonProperty("name") val name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt new file mode 100644 index 0000000000000..338a2d0f46ece --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -0,0 +1,35 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +data class ModelApiResponse( + + @Schema(example = "null", description = "") + @get:JsonProperty("code") val code: kotlin.Int? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("type") val type: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("message") val message: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt new file mode 100644 index 0000000000000..1ffd604abebd0 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt @@ -0,0 +1,59 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +data class Order( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, + + @Schema(example = "null", description = "Order Status") + @get:JsonProperty("status") val status: Order.Status? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false +) { + + /** + * Order Status + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + + @JsonProperty("placed") placed("placed"), + @JsonProperty("approved") approved("approved"), + @JsonProperty("delivered") delivered("delivered") + } + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt new file mode 100644 index 0000000000000..3073f0ea9ee44 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt @@ -0,0 +1,64 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import org.openapitools.model.Category +import org.openapitools.model.Tag +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * 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( + + @Schema(example = "doggie", required = true, description = "") + @get:JsonProperty("name", required = true) val name: kotlin.String, + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("category") val category: Category? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, + + @Schema(example = "null", description = "pet status in the store") + @Deprecated(message = "") + @get:JsonProperty("status") val status: Pet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + + @JsonProperty("available") available("available"), + @JsonProperty("pending") pending("pending"), + @JsonProperty("sold") sold("sold") + } + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Tag.kt new file mode 100644 index 0000000000000..a4357f8358e31 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Tag.kt @@ -0,0 +1,31 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * A tag for a pet + * @param id + * @param name + */ +data class Tag( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("name") val name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/User.kt new file mode 100644 index 0000000000000..74a1c1056afc2 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/User.kt @@ -0,0 +1,55 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * 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( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("username") val username: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("email") val email: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("password") val password: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("phone") val phone: kotlin.String? = null, + + @Schema(example = "null", description = "User Status") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/resources/application.yaml b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/resources/application.yaml new file mode 100644 index 0000000000000..8e2ebcde976d9 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/resources/application.yaml @@ -0,0 +1,10 @@ +spring: + application: + name: openAPIPetstore + + jackson: + serialization: + WRITE_DATES_AS_TIMESTAMPS: false + +server: + port: 8080 diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index f93350173ebd8..5479b06dcb339 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -15,6 +15,7 @@ import io.swagger.v3.oas.annotations.security.* import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity +import org.springframework.http.server.reactive.ServerHttpRequest import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated @@ -57,8 +58,8 @@ interface PetApi { produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) - fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { - return getDelegate().addPet(pet) + fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().addPet(pet, serverHttpRequest) } @Operation( @@ -75,8 +76,8 @@ interface PetApi { method = [RequestMethod.DELETE], value = ["/pet/{petId}"] ) - fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?): ResponseEntity { - return getDelegate().deletePet(petId, apiKey) + fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().deletePet(petId, apiKey, serverHttpRequest) } @Operation( @@ -95,8 +96,8 @@ interface PetApi { value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"] ) - fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List): ResponseEntity> { - return getDelegate().findPetsByStatus(status) + fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity> { + return getDelegate().findPetsByStatus(status, serverHttpRequest) } @Operation( @@ -115,8 +116,8 @@ interface PetApi { value = ["/pet/findByTags"], produces = ["application/xml", "application/json"] ) - fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List): ResponseEntity> { - return getDelegate().findPetsByTags(tags) + fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity> { + return getDelegate().findPetsByTags(tags, serverHttpRequest) } @Operation( @@ -136,8 +137,8 @@ interface PetApi { value = ["/pet/{petId}"], produces = ["application/xml", "application/json"] ) - fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long): ResponseEntity { - return getDelegate().getPetById(petId) + fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().getPetById(petId, serverHttpRequest) } @Operation( @@ -159,8 +160,8 @@ interface PetApi { produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) - fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { - return getDelegate().updatePet(pet) + fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().updatePet(pet, serverHttpRequest) } @Operation( @@ -178,8 +179,8 @@ interface PetApi { value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"] ) - fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity { - return getDelegate().updatePetWithForm(petId, name, status) + fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().updatePetWithForm(petId, name, status, serverHttpRequest) } @Operation( @@ -198,7 +199,7 @@ interface PetApi { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { - return getDelegate().uploadFile(petId, additionalMetadata, file) + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().uploadFile(petId, additionalMetadata, file, serverHttpRequest) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt index 576d437419dbd..8578dfe43c12d 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -7,7 +7,7 @@ import java.util.Optional @javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") @Controller class PetApiController( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: PetApiDelegate? + delegate: PetApiDelegate? ) : PetApi { private lateinit var delegate: PetApiDelegate diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt index 25381eb447f07..b147b13bcdc90 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -7,6 +7,7 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional @@ -22,7 +23,8 @@ interface PetApiDelegate { /** * @see PetApi#addPet */ - fun addPet(pet: Pet): ResponseEntity { + fun addPet(pet: Pet, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -44,7 +46,8 @@ interface PetApiDelegate { * @see PetApi#deletePet */ fun deletePet(petId: kotlin.Long, - apiKey: kotlin.String?): ResponseEntity { + apiKey: kotlin.String?, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -53,7 +56,8 @@ interface PetApiDelegate { /** * @see PetApi#findPetsByStatus */ - fun findPetsByStatus(status: kotlin.collections.List): ResponseEntity> { + fun findPetsByStatus(status: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity> { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -74,7 +78,8 @@ interface PetApiDelegate { /** * @see PetApi#findPetsByTags */ - fun findPetsByTags(tags: kotlin.collections.List): ResponseEntity> { + fun findPetsByTags(tags: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity> { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -95,7 +100,8 @@ interface PetApiDelegate { /** * @see PetApi#getPetById */ - fun getPetById(petId: kotlin.Long): ResponseEntity { + fun getPetById(petId: kotlin.Long, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -116,7 +122,8 @@ interface PetApiDelegate { /** * @see PetApi#updatePet */ - fun updatePet(pet: Pet): ResponseEntity { + fun updatePet(pet: Pet, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -139,7 +146,8 @@ interface PetApiDelegate { */ fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, - status: kotlin.String?): ResponseEntity { + status: kotlin.String?, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -150,7 +158,8 @@ interface PetApiDelegate { */ fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, - file: Resource?): ResponseEntity { + file: Resource?, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 307de99db937b..21ad6956d8757 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -14,6 +14,7 @@ import io.swagger.v3.oas.annotations.security.* import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity +import org.springframework.http.server.reactive.ServerHttpRequest import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated @@ -53,8 +54,8 @@ interface StoreApi { method = [RequestMethod.DELETE], value = ["/store/order/{orderId}"] ) - fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String): ResponseEntity { - return getDelegate().deleteOrder(orderId) + fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().deleteOrder(orderId, serverHttpRequest) } @Operation( @@ -72,8 +73,8 @@ interface StoreApi { value = ["/store/inventory"], produces = ["application/json"] ) - fun getInventory(): ResponseEntity> { - return getDelegate().getInventory() + fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity> { + return getDelegate().getInventory(serverHttpRequest) } @Operation( @@ -92,8 +93,8 @@ interface StoreApi { value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"] ) - fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long): ResponseEntity { - return getDelegate().getOrderById(orderId) + fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().getOrderById(orderId, serverHttpRequest) } @Operation( @@ -112,7 +113,7 @@ interface StoreApi { produces = ["application/xml", "application/json"], consumes = ["application/json"] ) - fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order): ResponseEntity { - return getDelegate().placeOrder(order) + fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().placeOrder(order, serverHttpRequest) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 0ee9f769801c2..247268d809bba 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -7,7 +7,7 @@ import java.util.Optional @javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") @Controller class StoreApiController( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: StoreApiDelegate? + delegate: StoreApiDelegate? ) : StoreApi { private lateinit var delegate: StoreApiDelegate diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt index 26ae5451b6bb5..9d3283b9eeb4f 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -6,6 +6,7 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional @@ -21,7 +22,8 @@ interface StoreApiDelegate { /** * @see StoreApi#deleteOrder */ - fun deleteOrder(orderId: kotlin.String): ResponseEntity { + fun deleteOrder(orderId: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -30,7 +32,7 @@ interface StoreApiDelegate { /** * @see StoreApi#getInventory */ - fun getInventory(): ResponseEntity> { + fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity> { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -39,7 +41,8 @@ interface StoreApiDelegate { /** * @see StoreApi#getOrderById */ - fun getOrderById(orderId: kotlin.Long): ResponseEntity { + fun getOrderById(orderId: kotlin.Long, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -60,7 +63,8 @@ interface StoreApiDelegate { /** * @see StoreApi#placeOrder */ - fun placeOrder(order: Order): ResponseEntity { + fun placeOrder(order: Order, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index bfd9e9cac5b16..15715a17ecf01 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -14,6 +14,7 @@ import io.swagger.v3.oas.annotations.security.* import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity +import org.springframework.http.server.reactive.ServerHttpRequest import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated @@ -54,8 +55,8 @@ interface UserApi { value = ["/user"], consumes = ["application/json"] ) - fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User): ResponseEntity { - return getDelegate().createUser(user) + fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().createUser(user, serverHttpRequest) } @Operation( @@ -73,8 +74,8 @@ interface UserApi { value = ["/user/createWithArray"], consumes = ["application/json"] ) - fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { - return getDelegate().createUsersWithArrayInput(user) + fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().createUsersWithArrayInput(user, serverHttpRequest) } @Operation( @@ -92,8 +93,8 @@ interface UserApi { value = ["/user/createWithList"], consumes = ["application/json"] ) - fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { - return getDelegate().createUsersWithListInput(user) + fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().createUsersWithListInput(user, serverHttpRequest) } @Operation( @@ -111,8 +112,8 @@ interface UserApi { method = [RequestMethod.DELETE], value = ["/user/{username}"] ) - fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { - return getDelegate().deleteUser(username) + fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().deleteUser(username, serverHttpRequest) } @Operation( @@ -131,8 +132,8 @@ interface UserApi { value = ["/user/{username}"], produces = ["application/xml", "application/json"] ) - fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { - return getDelegate().getUserByName(username) + fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().getUserByName(username, serverHttpRequest) } @Operation( @@ -150,8 +151,8 @@ interface UserApi { value = ["/user/login"], produces = ["application/xml", "application/json"] ) - fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity { - return getDelegate().loginUser(username, password) + fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().loginUser(username, password, serverHttpRequest) } @Operation( @@ -168,8 +169,8 @@ interface UserApi { method = [RequestMethod.GET], value = ["/user/logout"] ) - fun logoutUser(): ResponseEntity { - return getDelegate().logoutUser() + fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().logoutUser(serverHttpRequest) } @Operation( @@ -188,7 +189,7 @@ interface UserApi { value = ["/user/{username}"], consumes = ["application/json"] ) - fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User): ResponseEntity { - return getDelegate().updateUser(username, user) + fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().updateUser(username, user, serverHttpRequest) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt index 684f54129f365..ac522dbb82bf3 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -7,7 +7,7 @@ import java.util.Optional @javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 7.8.0-SNAPSHOT") @Controller class UserApiController( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: UserApiDelegate? + delegate: UserApiDelegate? ) : UserApi { private lateinit var delegate: UserApiDelegate diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt index 94f261b5ed090..9d192c573719b 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -6,6 +6,7 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional @@ -21,7 +22,8 @@ interface UserApiDelegate { /** * @see UserApi#createUser */ - fun createUser(user: User): ResponseEntity { + fun createUser(user: User, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -30,7 +32,8 @@ interface UserApiDelegate { /** * @see UserApi#createUsersWithArrayInput */ - fun createUsersWithArrayInput(user: kotlin.collections.List): ResponseEntity { + fun createUsersWithArrayInput(user: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -39,7 +42,8 @@ interface UserApiDelegate { /** * @see UserApi#createUsersWithListInput */ - fun createUsersWithListInput(user: kotlin.collections.List): ResponseEntity { + fun createUsersWithListInput(user: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -48,7 +52,8 @@ interface UserApiDelegate { /** * @see UserApi#deleteUser */ - fun deleteUser(username: kotlin.String): ResponseEntity { + fun deleteUser(username: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -57,7 +62,8 @@ interface UserApiDelegate { /** * @see UserApi#getUserByName */ - fun getUserByName(username: kotlin.String): ResponseEntity { + fun getUserByName(username: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -79,7 +85,8 @@ interface UserApiDelegate { * @see UserApi#loginUser */ fun loginUser(username: kotlin.String, - password: kotlin.String): ResponseEntity { + password: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -88,7 +95,7 @@ interface UserApiDelegate { /** * @see UserApi#logoutUser */ - fun logoutUser(): ResponseEntity { + fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -98,7 +105,8 @@ interface UserApiDelegate { * @see UserApi#updateUser */ fun updateUser(username: kotlin.String, - user: User): ResponseEntity { + user: User, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator-ignore b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator-ignore new file mode 100644 index 0000000000000..7484ee590a389 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/FILES new file mode 100644 index 0000000000000..0afcf84b1ed1f --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/FILES @@ -0,0 +1,14 @@ +README.md +build.gradle.kts +pom.xml +settings.gradle +src/main/kotlin/org/openapitools/Application.kt +src/main/kotlin/org/openapitools/HomeController.kt +src/main/kotlin/org/openapitools/SpringDocConfiguration.kt +src/main/kotlin/org/openapitools/api/ApiUtil.kt +src/main/kotlin/org/openapitools/api/Exceptions.kt +src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt +src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt +src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt +src/main/resources/application.yaml +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/VERSION new file mode 100644 index 0000000000000..6116b14d2c59f --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/README.md b/samples/server/petstore/kotlin-springboot-multipart-request-model/README.md new file mode 100644 index 0000000000000..15d74ea2ce250 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/README.md @@ -0,0 +1,21 @@ +# multipartFileTest + +This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). + +## Getting Started + +This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in. + +By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl). + +To build the project using maven, run: +```bash +mvn package && java -jar target/openapi-spring-1.0.0.jar +``` + +To build the project using gradle, run: +```bash +gradle build && java -jar build/libs/openapi-spring-1.0.0.jar +``` + +If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/) diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/build.gradle.kts b/samples/server/petstore/kotlin-springboot-multipart-request-model/build.gradle.kts new file mode 100644 index 0000000000000..45a8ef30f3efe --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/build.gradle.kts @@ -0,0 +1,50 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:2.6.7") + } +} + +group = "org.openapitools" +version = "1.0.0" + +repositories { + mavenCentral() +} + +tasks.withType { + kotlinOptions.jvmTarget = "1.8" +} + +plugins { + val kotlinVersion = "1.6.21" + id("org.jetbrains.kotlin.jvm") version kotlinVersion + id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion + id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion + id("org.springframework.boot") version "2.6.7" + id("io.spring.dependency-management") version "1.0.11.RELEASE" +} + +dependencies { + compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + compile("org.jetbrains.kotlin:kotlin-reflect") + compile("org.springframework.boot:spring-boot-starter-web") + compile("org.springdoc:springdoc-openapi-ui:1.6.8") + + compile("com.google.code.findbugs:jsr305:3.0.2") + compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") + compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") + compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") + compile("com.fasterxml.jackson.module:jackson-module-kotlin") + compile("jakarta.validation:jakarta.validation-api") + compile("jakarta.annotation:jakarta.annotation-api:2.1.0") + + testCompile("org.jetbrains.kotlin:kotlin-test-junit5") + testCompile("org.springframework.boot:spring-boot-starter-test") { + exclude(module = "junit") + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml b/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml new file mode 100644 index 0000000000000..a44254101c246 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml @@ -0,0 +1,136 @@ + + 4.0.0 + org.openapitools + openapi-spring + jar + openapi-spring + 1.0.0 + + 1.6.8 + 3.0.2 + 2.1.0 + 1.6.21 + + 1.6.21 + UTF-8 + + + org.springframework.boot + spring-boot-starter-parent + 2.7.15 + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + spring + + 1.8 + + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springdoc + springdoc-openapi-ui + ${springdoc-openapi.version} + + + + + com.google.code.findbugs + jsr305 + ${findbugs-jsr305.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + jakarta.validation + jakarta.validation-api + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation.version} + provided + + + org.jetbrains.kotlin + kotlin-test-junit5 + ${kotlin-test-junit5.version} + test + + + diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/settings.gradle b/samples/server/petstore/kotlin-springboot-multipart-request-model/settings.gradle new file mode 100644 index 0000000000000..14844905cd401 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/settings.gradle @@ -0,0 +1,15 @@ +pluginManagement { + repositories { + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } + gradlePluginPortal() + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.springframework.boot") { + useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") + } + } + } +} +rootProject.name = "openapi-spring" diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/Application.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/Application.kt new file mode 100644 index 0000000000000..2fe6de62479e9 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/Application.kt @@ -0,0 +1,13 @@ +package org.openapitools + +import org.springframework.boot.runApplication +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan + +@SpringBootApplication +@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"]) +class Application + +fun main(args: Array) { + runApplication(*args) +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/HomeController.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/HomeController.kt new file mode 100644 index 0000000000000..0b75544d7a1ea --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/HomeController.kt @@ -0,0 +1,17 @@ +package org.openapitools + +import org.springframework.context.annotation.Bean +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.ResponseBody +import org.springframework.web.bind.annotation.GetMapping + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +class HomeController { + + @RequestMapping("/") + fun index(): String = "redirect:swagger-ui.html" +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/SpringDocConfiguration.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/SpringDocConfiguration.kt new file mode 100644 index 0000000000000..2e11661edd000 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/SpringDocConfiguration.kt @@ -0,0 +1,26 @@ +package org.openapitools + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +import io.swagger.v3.oas.models.OpenAPI +import io.swagger.v3.oas.models.info.Info +import io.swagger.v3.oas.models.info.Contact +import io.swagger.v3.oas.models.info.License +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.security.SecurityScheme + +@Configuration +class SpringDocConfiguration { + + @Bean + fun apiInfo(): OpenAPI { + return OpenAPI() + .info( + Info() + .title("MultipartFile test") + .description("No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)") + .version("1.0.0") + ) + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 0000000000000..88e892d0f49af --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package org.openapitools.api + +import org.springframework.web.context.request.NativeWebRequest + +import javax.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res?.characterEncoding = "UTF-8" + res?.addHeader("Content-Type", contentType) + res?.writer?.print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt new file mode 100644 index 0000000000000..44190af7a019c --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -0,0 +1,29 @@ +package org.openapitools.api + +import org.springframework.http.HttpStatus +import org.springframework.web.bind.annotation.ControllerAdvice +import org.springframework.web.bind.annotation.ExceptionHandler +import javax.servlet.http.HttpServletResponse +import javax.validation.ConstraintViolationException + +// TODO Extend ApiException for custom exception handling, e.g. the below NotFound exception +sealed class ApiException(msg: String, val code: Int) : Exception(msg) + +class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) + + +@ControllerAdvice +class DefaultExceptionHandler { + + @ExceptionHandler(value = [ApiException::class]) + fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = + response.sendError(ex.code, ex.message) + + @ExceptionHandler(value = [NotImplementedError::class]) + fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + + @ExceptionHandler(value = [ConstraintViolationException::class]) + fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt new file mode 100644 index 0000000000000..a2b304ac2f293 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt @@ -0,0 +1,52 @@ +package org.openapitools.api + +import org.openapitools.model.MultipartMixedRequestMarker +import org.openapitools.model.MultipartMixedStatus +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:}") +class MultipartMixedApiController() { + + @Operation( + summary = "", + operationId = "multipartMixed", + description = """Mixed MultipartFile test""", + responses = [ + ApiResponse(responseCode = "204", description = "Successful operation") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/multipart-mixed"], + consumes = ["multipart/form-data"] + ) + fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.core.io.Resource,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity { + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt new file mode 100644 index 0000000000000..1a8f989c91743 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt @@ -0,0 +1,27 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * additional object + * @param name + */ +data class MultipartMixedRequestMarker( + + @Schema(example = "null", description = "") + @get:JsonProperty("name") val name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt new file mode 100644 index 0000000000000..ed53fb8b4b487 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt @@ -0,0 +1,27 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonValue +import com.fasterxml.jackson.annotation.JsonProperty +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** +* additional field as Enum +* Values: ALLOWED,IN_PROGRESS,REJECTED +*/ +enum class MultipartMixedStatus(val value: kotlin.String) { + + @JsonProperty("ALLOWED") ALLOWED("ALLOWED"), + @JsonProperty("IN_PROGRESS") IN_PROGRESS("IN_PROGRESS"), + @JsonProperty("REJECTED") REJECTED("REJECTED") +} + diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/application.yaml b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/application.yaml new file mode 100644 index 0000000000000..51bc6d3fb4a41 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/application.yaml @@ -0,0 +1,10 @@ +spring: + application: + name: multipartFileTest + + jackson: + serialization: + WRITE_DATES_AS_TIMESTAMPS: false + +server: + port: 8080 diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/openapi.yaml new file mode 100644 index 0000000000000..4511aa31f498f --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/openapi.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.1 +info: + title: MultipartFile test + version: 1.0.0 +servers: +- url: / +paths: + /multipart-mixed: + post: + description: Mixed MultipartFile test + operationId: multipartMixed + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/multipartMixed_request' + responses: + "204": + description: Successful operation + tags: + - multipart +components: + schemas: + MultipartMixedStatus: + description: additional field as Enum + enum: + - ALLOWED + - IN_PROGRESS + - REJECTED + example: REJECTED + type: string + multipartMixed_request_marker: + description: additional object + properties: + name: + type: string + type: object + multipartMixed_request: + properties: + status: + $ref: '#/components/schemas/MultipartMixedStatus' + marker: + $ref: '#/components/schemas/multipartMixed_request_marker' + file: + description: a file + format: binary + type: string + required: + - file + - status + type: object diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/test/kotlin/org/openapitools/api/MultipartMixedApiTest.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/test/kotlin/org/openapitools/api/MultipartMixedApiTest.kt new file mode 100644 index 0000000000000..6330073d74392 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/test/kotlin/org/openapitools/api/MultipartMixedApiTest.kt @@ -0,0 +1,27 @@ +package org.openapitools.api + +import org.openapitools.model.MultipartMixedRequestMarker +import org.openapitools.model.MultipartMixedStatus +import org.junit.jupiter.api.Test +import org.springframework.http.ResponseEntity + +class MultipartMixedApiTest { + + private val api: MultipartMixedApiController = MultipartMixedApiController() + + /** + * To test MultipartMixedApiController.multipartMixed + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun multipartMixedTest() { + val status: MultipartMixedStatus = TODO() + val file: org.springframework.core.io.Resource = TODO() + val marker: MultipartMixedRequestMarker? = TODO() + val response: ResponseEntity = api.multipartMixed(status, file, marker) + + // TODO: test validations + } +} diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py index eb90fbbfbb020..d9ee44de69005 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py @@ -14,6 +14,7 @@ Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -46,4 +47,6 @@ async def fake_query_param_default( no_default: str = Query(None, description="no default value", alias="noDefault"), ) -> None: """""" - return BaseFakeApi.subclasses[0]().fake_query_param_default(has_default, no_default) + if not BaseFakeApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseFakeApi.subclasses[0]().fake_query_param_default(has_default, no_default) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py index 6191845177f95..5af08fcbd8e90 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py @@ -10,7 +10,7 @@ class BaseFakeApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BaseFakeApi.subclasses = BaseFakeApi.subclasses + (cls,) - def fake_query_param_default( + async def fake_query_param_default( self, has_default: str, no_default: str, diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py index 1229ceeed197c..70feda075f287 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py @@ -14,6 +14,7 @@ Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -50,7 +51,9 @@ async def add_pet( ), ) -> Pet: """""" - return BasePetApi.subclasses[0]().add_pet(pet) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().add_pet(pet) @router.delete( @@ -70,7 +73,9 @@ async def delete_pet( ), ) -> None: """""" - return BasePetApi.subclasses[0]().delete_pet(petId, api_key) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().delete_pet(petId, api_key) @router.get( @@ -90,7 +95,9 @@ async def find_pets_by_status( ), ) -> List[Pet]: """Multiple status values can be provided with comma separated strings""" - return BasePetApi.subclasses[0]().find_pets_by_status(status) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().find_pets_by_status(status) @router.get( @@ -110,7 +117,9 @@ async def find_pets_by_tags( ), ) -> List[Pet]: """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.""" - return BasePetApi.subclasses[0]().find_pets_by_tags(tags) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().find_pets_by_tags(tags) @router.get( @@ -131,7 +140,9 @@ async def get_pet_by_id( ), ) -> Pet: """Returns a single pet""" - return BasePetApi.subclasses[0]().get_pet_by_id(petId) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().get_pet_by_id(petId) @router.put( @@ -153,7 +164,9 @@ async def update_pet( ), ) -> Pet: """""" - return BasePetApi.subclasses[0]().update_pet(pet) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().update_pet(pet) @router.post( @@ -174,7 +187,9 @@ async def update_pet_with_form( ), ) -> None: """""" - return BasePetApi.subclasses[0]().update_pet_with_form(petId, name, status) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().update_pet_with_form(petId, name, status) @router.post( @@ -195,4 +210,6 @@ async def upload_file( ), ) -> ApiResponse: """""" - return BasePetApi.subclasses[0]().upload_file(petId, additional_metadata, file) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().upload_file(petId, additional_metadata, file) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py index e8dfbc4f5c790..db77ff6c6a361 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py @@ -12,7 +12,7 @@ class BasePetApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BasePetApi.subclasses = BasePetApi.subclasses + (cls,) - def add_pet( + async def add_pet( self, pet: Pet, ) -> Pet: @@ -20,7 +20,7 @@ def add_pet( ... - def delete_pet( + async def delete_pet( self, petId: int, api_key: str, @@ -29,7 +29,7 @@ def delete_pet( ... - def find_pets_by_status( + async def find_pets_by_status( self, status: List[str], ) -> List[Pet]: @@ -37,7 +37,7 @@ def find_pets_by_status( ... - def find_pets_by_tags( + async def find_pets_by_tags( self, tags: List[str], ) -> List[Pet]: @@ -45,7 +45,7 @@ def find_pets_by_tags( ... - def get_pet_by_id( + async def get_pet_by_id( self, petId: int, ) -> Pet: @@ -53,7 +53,7 @@ def get_pet_by_id( ... - def update_pet( + async def update_pet( self, pet: Pet, ) -> Pet: @@ -61,7 +61,7 @@ def update_pet( ... - def update_pet_with_form( + async def update_pet_with_form( self, petId: int, name: str, @@ -71,7 +71,7 @@ def update_pet_with_form( ... - def upload_file( + async def upload_file( self, petId: int, additional_metadata: str, diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py index b583c10a625b1..8f492e32ceff9 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py @@ -14,6 +14,7 @@ Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -46,7 +47,9 @@ async def delete_order( orderId: str = Path(..., description="ID of the order that needs to be deleted"), ) -> None: """For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors""" - return BaseStoreApi.subclasses[0]().delete_order(orderId) + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().delete_order(orderId) @router.get( @@ -64,7 +67,9 @@ async def get_inventory( ), ) -> Dict[str, int]: """Returns a map of status codes to quantities""" - return BaseStoreApi.subclasses[0]().get_inventory() + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().get_inventory() @router.get( @@ -82,7 +87,9 @@ async def get_order_by_id( orderId: int = Path(..., description="ID of pet that needs to be fetched", ge=1, le=5), ) -> Order: """For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions""" - return BaseStoreApi.subclasses[0]().get_order_by_id(orderId) + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().get_order_by_id(orderId) @router.post( @@ -99,4 +106,6 @@ async def place_order( order: Order = Body(None, description="order placed for purchasing the pet"), ) -> Order: """""" - return BaseStoreApi.subclasses[0]().place_order(order) + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().place_order(order) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py index f4436a6f07ea2..40c01de8b9419 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py @@ -11,7 +11,7 @@ class BaseStoreApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BaseStoreApi.subclasses = BaseStoreApi.subclasses + (cls,) - def delete_order( + async def delete_order( self, orderId: str, ) -> None: @@ -19,14 +19,14 @@ def delete_order( ... - def get_inventory( + async def get_inventory( self, ) -> Dict[str, int]: """Returns a map of status codes to quantities""" ... - def get_order_by_id( + async def get_order_by_id( self, orderId: int, ) -> Order: @@ -34,7 +34,7 @@ def get_order_by_id( ... - def place_order( + async def place_order( self, order: Order, ) -> Order: diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py index 1ee291c2a02b5..f09f127ba51a2 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py @@ -14,6 +14,7 @@ Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -48,7 +49,9 @@ async def create_user( ), ) -> None: """This can only be done by the logged in user.""" - return BaseUserApi.subclasses[0]().create_user(user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().create_user(user) @router.post( @@ -67,7 +70,9 @@ async def create_users_with_array_input( ), ) -> None: """""" - return BaseUserApi.subclasses[0]().create_users_with_array_input(user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().create_users_with_array_input(user) @router.post( @@ -86,7 +91,9 @@ async def create_users_with_list_input( ), ) -> None: """""" - return BaseUserApi.subclasses[0]().create_users_with_list_input(user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().create_users_with_list_input(user) @router.delete( @@ -106,7 +113,9 @@ async def delete_user( ), ) -> None: """This can only be done by the logged in user.""" - return BaseUserApi.subclasses[0]().delete_user(username) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().delete_user(username) @router.get( @@ -124,7 +133,9 @@ async def get_user_by_name( username: str = Path(..., description="The name that needs to be fetched. Use user1 for testing."), ) -> User: """""" - return BaseUserApi.subclasses[0]().get_user_by_name(username) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().get_user_by_name(username) @router.get( @@ -142,7 +153,9 @@ async def login_user( password: str = Query(None, description="The password for login in clear text", alias="password"), ) -> str: """""" - return BaseUserApi.subclasses[0]().login_user(username, password) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().login_user(username, password) @router.get( @@ -160,7 +173,9 @@ async def logout_user( ), ) -> None: """""" - return BaseUserApi.subclasses[0]().logout_user() + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().logout_user() @router.put( @@ -181,4 +196,6 @@ async def update_user( ), ) -> None: """This can only be done by the logged in user.""" - return BaseUserApi.subclasses[0]().update_user(username, user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().update_user(username, user) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py index ee3314e7fa6ba..b260864f1ca62 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py @@ -11,7 +11,7 @@ class BaseUserApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BaseUserApi.subclasses = BaseUserApi.subclasses + (cls,) - def create_user( + async def create_user( self, user: User, ) -> None: @@ -19,7 +19,7 @@ def create_user( ... - def create_users_with_array_input( + async def create_users_with_array_input( self, user: List[User], ) -> None: @@ -27,7 +27,7 @@ def create_users_with_array_input( ... - def create_users_with_list_input( + async def create_users_with_list_input( self, user: List[User], ) -> None: @@ -35,7 +35,7 @@ def create_users_with_list_input( ... - def delete_user( + async def delete_user( self, username: str, ) -> None: @@ -43,7 +43,7 @@ def delete_user( ... - def get_user_by_name( + async def get_user_by_name( self, username: str, ) -> User: @@ -51,7 +51,7 @@ def get_user_by_name( ... - def login_user( + async def login_user( self, username: str, password: str, @@ -60,14 +60,14 @@ def login_user( ... - def logout_user( + async def logout_user( self, ) -> None: """""" ... - def update_user( + async def update_user( self, username: str, user: User,