forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.1.x
This commit is contained in:
19
README.md
19
README.md
@@ -77,9 +77,9 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
|||||||
|
|
||||||
| | Languages/Frameworks |
|
| | Languages/Frameworks |
|
||||||
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.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), **k6**, **Kotlin**, **Lua**, **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** (rust, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, Rxjs) |
|
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0), **C++** (cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.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), **k6**, **Kotlin**, **Lua**, **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), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) |
|
||||||
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **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/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
|
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **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/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
|
||||||
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc** |
|
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
|
||||||
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
|
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
|
||||||
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer** |
|
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer** |
|
||||||
|
|
||||||
@@ -450,10 +450,10 @@ To get a list of PHP specified options (which can be passed to the generator wit
|
|||||||
You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) as follows:
|
You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) as follows:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./bin/java-petstore-okhttp-gson.sh
|
./bin/generate-samples.sh ./bin/configs/java-okhttp-gson.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
(On Windows, run `.\bin\windows\java-petstore-okhttp-gson.bat` instead)
|
(On Windows, please install [GIT Bash for Windows](https://gitforwindows.org/) to run the command above)
|
||||||
|
|
||||||
This script uses the default library, which is `okhttp-gson`. It will run the generator with this command:
|
This script uses the default library, which is `okhttp-gson`. It will run the generator with this command:
|
||||||
|
|
||||||
@@ -461,6 +461,8 @@ This script uses the default library, which is `okhttp-gson`. It will run the ge
|
|||||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
|
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
|
||||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
|
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
|
||||||
-g java \
|
-g java \
|
||||||
|
-t modules/openapi-generator/src/main/resources/Java \
|
||||||
|
--additional-properties artifactId=petstore-okhttp-gson,hideGenerationTimestamp:true \
|
||||||
-o samples/client/petstore/java/okhttp-gson
|
-o samples/client/petstore/java/okhttp-gson
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -526,13 +528,7 @@ cd samples/client/petstore/java/okhttp-gson
|
|||||||
mvn package
|
mvn package
|
||||||
```
|
```
|
||||||
|
|
||||||
Other languages have petstore samples, too:
|
Other generators have [samples](https://github.com/OpenAPITools/openapi-generator/tree/master/samples) too.
|
||||||
|
|
||||||
- [Swift5](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/swift5)
|
|
||||||
- [Ruby](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/ruby)
|
|
||||||
- [Kotlin](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/kotlin)
|
|
||||||
|
|
||||||
... and more.
|
|
||||||
|
|
||||||
### [3.1 - Customization](#table-of-contents)
|
### [3.1 - Customization](#table-of-contents)
|
||||||
|
|
||||||
@@ -808,6 +804,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
|||||||
- 2020-10-31 - [[B2] OpenAPI Specification으로 타입-세이프하게 API 개발하기: 희망편 VS 절망편](https://www.youtube.com/watch?v=J4JHLESAiFk) by 최태건 at [FEConf 2020](https://2020.feconf.kr/)
|
- 2020-10-31 - [[B2] OpenAPI Specification으로 타입-세이프하게 API 개발하기: 희망편 VS 절망편](https://www.youtube.com/watch?v=J4JHLESAiFk) by 최태건 at [FEConf 2020](https://2020.feconf.kr/)
|
||||||
- 2020-11-05 - [Automated REST-Api Code Generation: Wie IT-Systeme miteinander sprechen](https://www.massiveart.com/blog/automated-rest-api-code-generation-wie-it-systeme-miteinander-sprechen) by Stefan Rottensteiner at [MASSIVE ART Blog](https://www.massiveart.com/blog)
|
- 2020-11-05 - [Automated REST-Api Code Generation: Wie IT-Systeme miteinander sprechen](https://www.massiveart.com/blog/automated-rest-api-code-generation-wie-it-systeme-miteinander-sprechen) by Stefan Rottensteiner at [MASSIVE ART Blog](https://www.massiveart.com/blog)
|
||||||
- 2020-12-01 - [OpenAPI GeneratorでGoのAPIサーバー/クライアントコードを自動生成する](https://qiita.com/saki-engineering/items/b20d8b6074c4da9664a5) by [@saki-engineering](https://qiita.com/saki-engineering)
|
- 2020-12-01 - [OpenAPI GeneratorでGoのAPIサーバー/クライアントコードを自動生成する](https://qiita.com/saki-engineering/items/b20d8b6074c4da9664a5) by [@saki-engineering](https://qiita.com/saki-engineering)
|
||||||
|
- 2020-12-04 - [Scaling the Test Coverage of OpenAPI Generator for 30+ Programming Languages](https://www.youtube.com/watch?v=7Lke9dHRqT0) by [William Cheng](https://github.com/wing328) at [Open Source Summit Japan + Automotive Linux Summit 2020](https://events.linuxfoundation.org/archive/2020/open-source-summit-japan/) ([Slides](https://speakerdeck.com/wing328/scaling-the-test-coverage-of-openapi-generator-for-30-plus-programming-languages))
|
||||||
- 2020-12-09 - [プロジェクトにOpenAPI Generatorで自動生成された型付きAPI Clientを導入した話](https://qiita.com/yoshifujiT/items/905c18700ede23f40840) by [@yoshifujiT](https://github.com/yoshifujiT)
|
- 2020-12-09 - [プロジェクトにOpenAPI Generatorで自動生成された型付きAPI Clientを導入した話](https://qiita.com/yoshifujiT/items/905c18700ede23f40840) by [@yoshifujiT](https://github.com/yoshifujiT)
|
||||||
- 2020-12-15 - [Next.js + NestJS + GraphQLで変化に追従するフロントエンドへ 〜 ショッピングクーポンの事例紹介](https://techblog.yahoo.co.jp/entry/2020121530052952/) by [小倉 陸](https://github.com/ogugu9) at [Yahoo! JAPAN Tech Blog](https://techblog.yahoo.co.jp/)
|
- 2020-12-15 - [Next.js + NestJS + GraphQLで変化に追従するフロントエンドへ 〜 ショッピングクーポンの事例紹介](https://techblog.yahoo.co.jp/entry/2020121530052952/) by [小倉 陸](https://github.com/ogugu9) at [Yahoo! JAPAN Tech Blog](https://techblog.yahoo.co.jp/)
|
||||||
- 2021-01-08 - [Hello, New API – Part 1](https://www.nginx.com/blog/hello-new-api-part-1/) by [Jeremy Schulman](https://www.nginx.com/people/jeremy-schulman/) at [Major League Baseball](https://www.mlb.com)
|
- 2021-01-08 - [Hello, New API – Part 1](https://www.nginx.com/blog/hello-new-api-part-1/) by [Jeremy Schulman](https://www.nginx.com/people/jeremy-schulman/) at [Major League Baseball](https://www.mlb.com)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
generatorName: typescript-nestjs
|
generatorName: typescript-nestjs
|
||||||
outputDir: samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default
|
outputDir: samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/typescript-nestjs
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
nestVersion: 6.0.0
|
nestVersion: 6.0.0
|
||||||
"npmName": "@openapitools/typescript-nestjs-petstore"
|
"npmName": "@openapitools/typescript-nestjs-petstore"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
# csharp-netcore test files and image for upload
|
# csharp-netcore test files and image for upload
|
||||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
|
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
|
||||||
sha256: b74ef9eefa4b41fd3233e083fe2355babf25a77f9073d28e1aa81ae2e0a5f1d0
|
sha256: aceebba316148a2a803a15ef4e13bbd0b0a1b8d15006cd88adb9b39a620ee451
|
||||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
|
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
|
||||||
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Our tooling supports the following types of configuration:
|
|||||||
|
|
||||||
## Tool-specific Declarations
|
## Tool-specific Declarations
|
||||||
|
|
||||||
The READMEs for the [CLI](https://openapi-generator.tech/docs/usage#generate), [Gradle Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin), [Maven Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin), and [SBT Plugin](https://github.com/OpenAPITools/sbt-openapi-generator/blob/master/README.md) may have top-level or tooling specific options which appear to duplicate 'config options' or 'global properties'. Each may also expose user-facing properties slightly differently from the other tools. This may occur due to:
|
The READMEs for the [CLI](https://openapi-generator.tech/docs/usage#generate), [Gradle Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin), [Maven Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin), and [SBT Plugin](https://github.com/OpenAPITools/sbt-openapi-generator/blob/master/README.md) may have top-level or tooling specific options which appear to duplicate 'config options' or 'global properties'. Each may also expose user-facing properties slightly differently from the other tools. This may occur due to:
|
||||||
|
|
||||||
* Conventions used by the underlying tooling
|
* Conventions used by the underlying tooling
|
||||||
* Limitations in underlying frameworks which define how properties must be declared
|
* Limitations in underlying frameworks which define how properties must be declared
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ The following generators are available:
|
|||||||
* [java-pkmst](generators/java-pkmst.md)
|
* [java-pkmst](generators/java-pkmst.md)
|
||||||
* [java-play-framework](generators/java-play-framework.md)
|
* [java-play-framework](generators/java-play-framework.md)
|
||||||
* [java-undertow-server](generators/java-undertow-server.md)
|
* [java-undertow-server](generators/java-undertow-server.md)
|
||||||
* [java-vertx](generators/java-vertx.md)
|
* [java-vertx (deprecated)](generators/java-vertx.md)
|
||||||
* [java-vertx-web (beta)](generators/java-vertx-web.md)
|
* [java-vertx-web (beta)](generators/java-vertx-web.md)
|
||||||
* [jaxrs-cxf](generators/jaxrs-cxf.md)
|
* [jaxrs-cxf](generators/jaxrs-cxf.md)
|
||||||
* [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi.md)
|
* [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi.md)
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
| Type/Alias | Instantiated By |
|
| Type/Alias | Instantiated By |
|
||||||
| ---------- | --------------- |
|
| ---------- | --------------- |
|
||||||
|array|List|
|
|
||||||
|map|Map|
|
|
||||||
|
|
||||||
|
|
||||||
## LANGUAGE PRIMITIVES
|
## LANGUAGE PRIMITIVES
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
| Type/Alias | Instantiated By |
|
| Type/Alias | Instantiated By |
|
||||||
| ---------- | --------------- |
|
| ---------- | --------------- |
|
||||||
|array|List|
|
|
||||||
|map|Map|
|
|
||||||
|
|
||||||
|
|
||||||
## LANGUAGE PRIMITIVES
|
## LANGUAGE PRIMITIVES
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
| Type/Alias | Instantiated By |
|
| Type/Alias | Instantiated By |
|
||||||
| ---------- | --------------- |
|
| ---------- | --------------- |
|
||||||
|array|List|
|
|
||||||
|map|Map|
|
|
||||||
|
|
||||||
|
|
||||||
## LANGUAGE PRIMITIVES
|
## LANGUAGE PRIMITIVES
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
| Type/Alias | Imports |
|
| Type/Alias | Imports |
|
||||||
| ---------- | ------- |
|
| ---------- | ------- |
|
||||||
|BigDecimal|java.math.BigDecimal|
|
|BigDecimal|java.math.BigDecimal|
|
||||||
|Date|java.util.Date|
|
|Date|java.time.LocalDate|
|
||||||
|DateTime|java.time.LocalDateTime|
|
|DateTime|java.time.OffsetDateTime|
|
||||||
|File|java.io.File|
|
|File|java.io.File|
|
||||||
|LocalDate|java.time.LocalDate|
|
|LocalDate|java.time.LocalDate|
|
||||||
|LocalDateTime|java.time.LocalDateTime|
|
|LocalDateTime|java.time.LocalDateTime|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
| Type/Alias | Imports |
|
| Type/Alias | Imports |
|
||||||
| ---------- | ------- |
|
| ---------- | ------- |
|
||||||
|BigDecimal|java.math.BigDecimal|
|
|BigDecimal|java.math.BigDecimal|
|
||||||
|Date|java.util.Date|
|
|Date|java.time.LocalDate|
|
||||||
|DateTime|java.time.LocalDateTime|
|
|DateTime|java.time.OffsetDateTime|
|
||||||
|File|java.io.File|
|
|File|java.io.File|
|
||||||
|LocalDate|java.time.LocalDate|
|
|LocalDate|java.time.LocalDate|
|
||||||
|LocalDateTime|java.time.LocalDateTime|
|
|LocalDateTime|java.time.LocalDateTime|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
| Type/Alias | Imports |
|
| Type/Alias | Imports |
|
||||||
| ---------- | ------- |
|
| ---------- | ------- |
|
||||||
|BigDecimal|java.math.BigDecimal|
|
|BigDecimal|java.math.BigDecimal|
|
||||||
|Date|java.util.Date|
|
|Date|java.time.LocalDate|
|
||||||
|DateTime|java.time.LocalDateTime|
|
|DateTime|java.time.OffsetDateTime|
|
||||||
|File|java.io.File|
|
|File|java.io.File|
|
||||||
|LocalDate|java.time.LocalDate|
|
|LocalDate|java.time.LocalDate|
|
||||||
|LocalDateTime|java.time.LocalDateTime|
|
|LocalDateTime|java.time.LocalDateTime|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
| Type/Alias | Imports |
|
| Type/Alias | Imports |
|
||||||
| ---------- | ------- |
|
| ---------- | ------- |
|
||||||
|BigDecimal|java.math.BigDecimal|
|
|BigDecimal|java.math.BigDecimal|
|
||||||
|Date|java.util.Date|
|
|Date|java.time.LocalDate|
|
||||||
|DateTime|java.time.LocalDateTime|
|
|DateTime|java.time.OffsetDateTime|
|
||||||
|File|java.io.File|
|
|File|java.io.File|
|
||||||
|LocalDate|java.time.LocalDate|
|
|LocalDate|java.time.LocalDate|
|
||||||
|LocalDateTime|java.time.LocalDateTime|
|
|LocalDateTime|java.time.LocalDateTime|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
# RELEASE_VERSION
|
# RELEASE_VERSION
|
||||||
openApiGeneratorVersion=5.1.0-SNAPSHOT
|
openApiGeneratorVersion=5.1.0-SNAPSHOT
|
||||||
>>>>>>> origin/master
|
|
||||||
# /RELEASE_VERSION
|
# /RELEASE_VERSION
|
||||||
|
|
||||||
# BEGIN placeholders
|
# BEGIN placeholders
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
typeMapping.put("ByteArray", "kotlin.ByteArray");
|
typeMapping.put("ByteArray", "kotlin.ByteArray");
|
||||||
typeMapping.put("number", "java.math.BigDecimal");
|
typeMapping.put("number", "java.math.BigDecimal");
|
||||||
typeMapping.put("decimal", "java.math.BigDecimal");
|
typeMapping.put("decimal", "java.math.BigDecimal");
|
||||||
typeMapping.put("date-time", "java.time.LocalDateTime");
|
typeMapping.put("date-time", "java.time.OffsetDateTime");
|
||||||
typeMapping.put("date", "java.time.LocalDate");
|
typeMapping.put("date", "java.time.LocalDate");
|
||||||
typeMapping.put("file", "java.io.File");
|
typeMapping.put("file", "java.io.File");
|
||||||
typeMapping.put("array", "kotlin.Array");
|
typeMapping.put("array", "kotlin.Array");
|
||||||
@@ -163,7 +163,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
typeMapping.put("object", "kotlin.Any");
|
typeMapping.put("object", "kotlin.Any");
|
||||||
typeMapping.put("binary", "kotlin.ByteArray");
|
typeMapping.put("binary", "kotlin.ByteArray");
|
||||||
typeMapping.put("Date", "java.time.LocalDate");
|
typeMapping.put("Date", "java.time.LocalDate");
|
||||||
typeMapping.put("DateTime", "java.time.LocalDateTime");
|
typeMapping.put("DateTime", "java.time.OffsetDateTime");
|
||||||
|
|
||||||
instantiationTypes.put("array", "kotlin.collections.ArrayList");
|
instantiationTypes.put("array", "kotlin.collections.ArrayList");
|
||||||
instantiationTypes.put("list", "kotlin.collections.ArrayList");
|
instantiationTypes.put("list", "kotlin.collections.ArrayList");
|
||||||
@@ -174,9 +174,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
importMapping.put("UUID", "java.util.UUID");
|
importMapping.put("UUID", "java.util.UUID");
|
||||||
importMapping.put("URI", "java.net.URI");
|
importMapping.put("URI", "java.net.URI");
|
||||||
importMapping.put("File", "java.io.File");
|
importMapping.put("File", "java.io.File");
|
||||||
importMapping.put("Date", "java.util.Date");
|
importMapping.put("Date", "java.time.LocalDate");
|
||||||
importMapping.put("Timestamp", "java.sql.Timestamp");
|
importMapping.put("Timestamp", "java.sql.Timestamp");
|
||||||
importMapping.put("DateTime", "java.time.LocalDateTime");
|
importMapping.put("DateTime", "java.time.OffsetDateTime");
|
||||||
importMapping.put("LocalDateTime", "java.time.LocalDateTime");
|
importMapping.put("LocalDateTime", "java.time.LocalDateTime");
|
||||||
importMapping.put("LocalDate", "java.time.LocalDate");
|
importMapping.put("LocalDate", "java.time.LocalDate");
|
||||||
importMapping.put("LocalTime", "java.time.LocalTime");
|
importMapping.put("LocalTime", "java.time.LocalTime");
|
||||||
|
|||||||
@@ -141,14 +141,13 @@ public class DartClientCodegen extends DefaultCodegen {
|
|||||||
"double",
|
"double",
|
||||||
"dynamic"
|
"dynamic"
|
||||||
);
|
);
|
||||||
instantiationTypes.put("array", "List");
|
|
||||||
instantiationTypes.put("map", "Map");
|
|
||||||
|
|
||||||
typeMapping = new HashMap<>();
|
typeMapping = new HashMap<>();
|
||||||
typeMapping.put("Array", "List");
|
typeMapping.put("Array", "List");
|
||||||
typeMapping.put("array", "List");
|
typeMapping.put("array", "List");
|
||||||
typeMapping.put("map", "Map");
|
typeMapping.put("map", "Map");
|
||||||
typeMapping.put("List", "List");
|
typeMapping.put("List", "List");
|
||||||
|
typeMapping.put("set", "Set");
|
||||||
typeMapping.put("boolean", "bool");
|
typeMapping.put("boolean", "bool");
|
||||||
typeMapping.put("string", "String");
|
typeMapping.put("string", "String");
|
||||||
typeMapping.put("char", "String");
|
typeMapping.put("char", "String");
|
||||||
@@ -468,9 +467,10 @@ public class DartClientCodegen extends DefaultCodegen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toDefaultValue(Schema schema) {
|
public String toDefaultValue(Schema schema) {
|
||||||
if (ModelUtils.isMapSchema(schema)) {
|
if (ModelUtils.isMapSchema(schema) || ModelUtils.isSet(schema)) {
|
||||||
return "const {}";
|
return "const {}";
|
||||||
} else if (ModelUtils.isArraySchema(schema)) {
|
}
|
||||||
|
if (ModelUtils.isArraySchema(schema)) {
|
||||||
return "const []";
|
return "const []";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,7 +494,8 @@ public class DartClientCodegen extends DefaultCodegen {
|
|||||||
if (ModelUtils.isArraySchema(target)) {
|
if (ModelUtils.isArraySchema(target)) {
|
||||||
Schema<?> items = getSchemaItems((ArraySchema) schema);
|
Schema<?> items = getSchemaItems((ArraySchema) schema);
|
||||||
return getSchemaType(target) + "<" + getTypeDeclaration(items) + ">";
|
return getSchemaType(target) + "<" + getTypeDeclaration(items) + ">";
|
||||||
} else if (ModelUtils.isMapSchema(target)) {
|
}
|
||||||
|
if (ModelUtils.isMapSchema(target)) {
|
||||||
// Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines
|
// Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines
|
||||||
// additionalproperties: true
|
// additionalproperties: true
|
||||||
Schema<?> inner = getAdditionalProperties(target);
|
Schema<?> inner = getAdditionalProperties(target);
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ public class DartDioClientCodegen extends DartClientCodegen {
|
|||||||
public String toDefaultValue(Schema schema) {
|
public String toDefaultValue(Schema schema) {
|
||||||
if (schema.getDefault() != null) {
|
if (schema.getDefault() != null) {
|
||||||
if (ModelUtils.isArraySchema(schema)) {
|
if (ModelUtils.isArraySchema(schema)) {
|
||||||
|
if (ModelUtils.isSet(schema)) {
|
||||||
|
return "SetBuilder()";
|
||||||
|
}
|
||||||
return "ListBuilder()";
|
return "ListBuilder()";
|
||||||
}
|
}
|
||||||
if (ModelUtils.isMapSchema(schema)) {
|
if (ModelUtils.isMapSchema(schema)) {
|
||||||
@@ -318,6 +321,7 @@ public class DartDioClientCodegen extends DartClientCodegen {
|
|||||||
if (param.isContainer) {
|
if (param.isContainer) {
|
||||||
final Map<String, Object> serializer = new HashMap<>();
|
final Map<String, Object> serializer = new HashMap<>();
|
||||||
serializer.put("isArray", param.isArray);
|
serializer.put("isArray", param.isArray);
|
||||||
|
serializer.put("uniqueItems", param.uniqueItems);
|
||||||
serializer.put("isMap", param.isMap);
|
serializer.put("isMap", param.isMap);
|
||||||
serializer.put("baseType", param.baseType);
|
serializer.put("baseType", param.baseType);
|
||||||
serializers.add(serializer);
|
serializers.add(serializer);
|
||||||
@@ -347,7 +351,8 @@ public class DartDioClientCodegen extends DartClientCodegen {
|
|||||||
|
|
||||||
if (op.returnContainer != null) {
|
if (op.returnContainer != null) {
|
||||||
final Map<String, Object> serializer = new HashMap<>();
|
final Map<String, Object> serializer = new HashMap<>();
|
||||||
serializer.put("isArray", Objects.equals("array", op.returnContainer));
|
serializer.put("isArray", Objects.equals("array", op.returnContainer) || Objects.equals("set", op.returnContainer));
|
||||||
|
serializer.put("uniqueItems", op.uniqueItems);
|
||||||
serializer.put("isMap", Objects.equals("map", op.returnContainer));
|
serializer.put("isMap", Objects.equals("map", op.returnContainer));
|
||||||
serializer.put("baseType", op.returnBaseType);
|
serializer.put("baseType", op.returnBaseType);
|
||||||
serializers.add(serializer);
|
serializers.add(serializer);
|
||||||
|
|||||||
@@ -24,9 +24,14 @@ import io.swagger.v3.oas.models.PathItem.HttpMethod;
|
|||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
|
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||||
|
import org.openapitools.codegen.meta.Stability;
|
||||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||||
import org.openapitools.codegen.utils.URLPathUtils;
|
import org.openapitools.codegen.utils.URLPathUtils;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -37,6 +42,7 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class JavaVertXServerCodegen extends AbstractJavaCodegen {
|
public class JavaVertXServerCodegen extends AbstractJavaCodegen {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(JavaVertXServerCodegen.class);
|
||||||
|
|
||||||
protected String resourceFolder = "src/main/resources";
|
protected String resourceFolder = "src/main/resources";
|
||||||
protected String rootPackage = "org.openapitools.server.api";
|
protected String rootPackage = "org.openapitools.server.api";
|
||||||
@@ -61,6 +67,10 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen {
|
|||||||
|
|
||||||
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
|
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
|
||||||
|
|
||||||
|
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||||
|
.stability(Stability.DEPRECATED)
|
||||||
|
.build();
|
||||||
|
|
||||||
// set the output folder here
|
// set the output folder here
|
||||||
outputFolder = "generated-code" + File.separator + "javaVertXServer";
|
outputFolder = "generated-code" + File.separator + "javaVertXServer";
|
||||||
|
|
||||||
@@ -134,6 +144,8 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen {
|
|||||||
public void processOpts() {
|
public void processOpts() {
|
||||||
super.processOpts();
|
super.processOpts();
|
||||||
|
|
||||||
|
LOGGER.warn("IMPORTANT: This generator has been deprecated. Please use `java-vertx-web` instead");
|
||||||
|
|
||||||
apiTestTemplateFiles.clear();
|
apiTestTemplateFiles.clear();
|
||||||
|
|
||||||
importMapping.remove("JsonCreator");
|
importMapping.remove("JsonCreator");
|
||||||
|
|||||||
@@ -125,17 +125,9 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
|||||||
typeMapping.put("array", "kotlin.collections.List");
|
typeMapping.put("array", "kotlin.collections.List");
|
||||||
typeMapping.put("list", "kotlin.collections.List");
|
typeMapping.put("list", "kotlin.collections.List");
|
||||||
|
|
||||||
typeMapping.put("date", "java.time.LocalDate");
|
|
||||||
typeMapping.put("date-time", "java.time.OffsetDateTime");
|
|
||||||
typeMapping.put("Date", "java.time.LocalDate");
|
|
||||||
typeMapping.put("DateTime", "java.time.OffsetDateTime");
|
|
||||||
|
|
||||||
// use resource for file handling
|
// use resource for file handling
|
||||||
typeMapping.put("file", "org.springframework.core.io.Resource");
|
typeMapping.put("file", "org.springframework.core.io.Resource");
|
||||||
|
|
||||||
importMapping.put("Date", "java.time.LocalDate");
|
|
||||||
importMapping.put("DateTime", "java.time.OffsetDateTime");
|
|
||||||
|
|
||||||
addOption(TITLE, "server title name or client service name", title);
|
addOption(TITLE, "server title name or client service name", title);
|
||||||
addOption(BASE_PACKAGE, "base package (invokerPackage) for generated code", basePackage);
|
addOption(BASE_PACKAGE, "base package (invokerPackage) for generated code", basePackage);
|
||||||
addOption(SERVER_PORT, "configuration the port in which the sever is to run on", serverPort);
|
addOption(SERVER_PORT, "configuration the port in which the sever is to run on", serverPort);
|
||||||
|
|||||||
@@ -330,16 +330,16 @@
|
|||||||
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
|
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<gson-fire-version>1.8.4</gson-fire-version>
|
<gson-fire-version>1.8.5</gson-fire-version>
|
||||||
<swagger-core-version>1.5.24</swagger-core-version>
|
<swagger-core-version>1.6.2</swagger-core-version>
|
||||||
<okhttp-version>3.14.7</okhttp-version>
|
<okhttp-version>4.9.1</okhttp-version>
|
||||||
<gson-version>2.8.6</gson-version>
|
<gson-version>2.8.6</gson-version>
|
||||||
<commons-lang3-version>3.10</commons-lang3-version>
|
<commons-lang3-version>3.11</commons-lang3-version>
|
||||||
{{#joda}}
|
{{#joda}}
|
||||||
<jodatime-version>2.9.9</jodatime-version>
|
<jodatime-version>2.10.9</jodatime-version>
|
||||||
{{/joda}}
|
{{/joda}}
|
||||||
{{#threetenbp}}
|
{{#threetenbp}}
|
||||||
<threetenbp-version>1.4.3</threetenbp-version>
|
<threetenbp-version>1.5.0</threetenbp-version>
|
||||||
{{/threetenbp}}
|
{{/threetenbp}}
|
||||||
<javax-annotation-version>1.3.2</javax-annotation-version>
|
<javax-annotation-version>1.3.2</javax-annotation-version>
|
||||||
<junit-version>4.13.1</junit-version>
|
<junit-version>4.13.1</junit-version>
|
||||||
|
|||||||
@@ -472,6 +472,19 @@ namespace {{packageName}}.Client
|
|||||||
response = client.Execute<T>(req);
|
response = client.Execute<T>(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
|
if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
T instance = (T)Activator.CreateInstance(typeof(T));
|
||||||
|
MethodInfo method = typeof(T).GetMethod("FromJson");
|
||||||
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
|
response.Data = instance;
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
var result = ToApiResponse(response);
|
var result = ToApiResponse(response);
|
||||||
@@ -583,6 +596,10 @@ namespace {{packageName}}.Client
|
|||||||
method.Invoke(instance, new object[] { response.Content });
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
response.Data = instance;
|
response.Data = instance;
|
||||||
}
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,12 @@ import 'package:built_value/serializer.dart';
|
|||||||
{{/fullImports}}
|
{{/fullImports}}
|
||||||
|
|
||||||
class {{classname}} {
|
class {{classname}} {
|
||||||
final Dio _dio;
|
|
||||||
Serializers _serializers;
|
|
||||||
|
|
||||||
{{classname}}(this._dio, this._serializers);
|
final Dio _dio;
|
||||||
|
|
||||||
|
final Serializers _serializers;
|
||||||
|
|
||||||
|
const {{classname}}(this._dio, this._serializers);
|
||||||
|
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
/// {{{summary}}}
|
/// {{{summary}}}
|
||||||
@@ -69,7 +71,7 @@ class {{classname}} {
|
|||||||
|
|
||||||
{{#isContainer}}
|
{{#isContainer}}
|
||||||
{{#isArray}}
|
{{#isArray}}
|
||||||
const type = FullType(BuiltList, [FullType({{baseType}})]);
|
const type = FullType(Built{{#uniqueItems}}Built{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}, [FullType({{baseType}})]);
|
||||||
final serializedBody = _serializers.serialize({{paramName}}, specifiedType: type);
|
final serializedBody = _serializers.serialize({{paramName}}, specifiedType: type);
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
{{#isMap}}
|
{{#isMap}}
|
||||||
@@ -135,8 +137,7 @@ class {{classname}} {
|
|||||||
{{/returnTypeIsPrimitive}}
|
{{/returnTypeIsPrimitive}}
|
||||||
{{/returnSimpleType}}
|
{{/returnSimpleType}}
|
||||||
{{^returnSimpleType}}
|
{{^returnSimpleType}}
|
||||||
const collectionType = {{#isMap}}BuiltMap{{/isMap}}{{^isMap}}BuiltList{{/isMap}};
|
const type = FullType(Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{returnBaseType}}})]);
|
||||||
const type = FullType(collectionType, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{returnBaseType}}})]);
|
|
||||||
final data = _serializers.deserialize(
|
final data = _serializers.deserialize(
|
||||||
response.data is String
|
response.data is String
|
||||||
? jsonDecode(response.data as String)
|
? jsonDecode(response.data as String)
|
||||||
@@ -149,6 +150,7 @@ class {{classname}} {
|
|||||||
return Response<{{{returnType}}}>(
|
return Response<{{{returnType}}}>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
|
|||||||
@@ -10,31 +10,37 @@ import 'package:{{pubName}}/auth/oauth.dart';
|
|||||||
{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/api/{{classFilename}}.dart';
|
{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/api/{{classFilename}}.dart';
|
||||||
{{/apis}}{{/apiInfo}}
|
{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
|
final _defaultInterceptors = [
|
||||||
|
OAuthInterceptor(),
|
||||||
|
BasicAuthInterceptor(),
|
||||||
|
ApiKeyAuthInterceptor(),
|
||||||
|
];
|
||||||
|
|
||||||
class {{clientName}} {
|
class {{clientName}} {
|
||||||
|
|
||||||
Dio dio;
|
static const String basePath = r'{{{basePath}}}';
|
||||||
Serializers serializers;
|
|
||||||
String basePath = '{{{basePath}}}';
|
|
||||||
|
|
||||||
{{clientName}}({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
final Dio dio;
|
||||||
if (dio == null) {
|
|
||||||
BaseOptions options = new BaseOptions(
|
final Serializers serializers;
|
||||||
|
|
||||||
|
{{clientName}}({
|
||||||
|
Dio dio,
|
||||||
|
Serializers serializers,
|
||||||
|
String basePathOverride,
|
||||||
|
List<Interceptor> interceptors,
|
||||||
|
}) : this.serializers = serializers ?? standardSerializers,
|
||||||
|
this.dio = dio ??
|
||||||
|
Dio(BaseOptions(
|
||||||
baseUrl: basePathOverride ?? basePath,
|
baseUrl: basePathOverride ?? basePath,
|
||||||
connectTimeout: 5000,
|
connectTimeout: 5000,
|
||||||
receiveTimeout: 3000,
|
receiveTimeout: 3000,
|
||||||
);
|
)) {
|
||||||
this.dio = new Dio(options);
|
if (interceptors == null) {
|
||||||
}
|
this.dio.interceptors.addAll(_defaultInterceptors);
|
||||||
|
} else {
|
||||||
if (interceptors == null) {
|
this.dio.interceptors.addAll(interceptors);
|
||||||
this.dio.interceptors.addAll(_defaultInterceptors);
|
}
|
||||||
} else {
|
|
||||||
this.dio.interceptors.addAll(interceptors);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.serializers = serializers ?? standardSerializers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOAuthToken(String name, String token) {
|
void setOAuthToken(String name, String token) {
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import 'package:built_value/serializer.dart';
|
|||||||
import 'package:time_machine/time_machine.dart';
|
import 'package:time_machine/time_machine.dart';
|
||||||
|
|
||||||
class OffsetDateSerializer implements PrimitiveSerializer<OffsetDate> {
|
class OffsetDateSerializer implements PrimitiveSerializer<OffsetDate> {
|
||||||
|
|
||||||
|
const OffsetDateSerializer();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<Type> get types => BuiltList<Type>([OffsetDate]);
|
Iterable<Type> get types => BuiltList<Type>([OffsetDate]);
|
||||||
|
|
||||||
@@ -25,6 +28,9 @@ class OffsetDateSerializer implements PrimitiveSerializer<OffsetDate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class OffsetDateTimeSerializer implements PrimitiveSerializer<OffsetDateTime> {
|
class OffsetDateTimeSerializer implements PrimitiveSerializer<OffsetDateTime> {
|
||||||
|
|
||||||
|
const OffsetDateTimeSerializer();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<Type> get types => BuiltList<Type>([OffsetDateTime]);
|
Iterable<Type> get types => BuiltList<Type>([OffsetDateTime]);
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,16 @@ part 'serializers.g.dart';
|
|||||||
Serializers serializers = (_$serializers.toBuilder(){{#apiInfo}}{{#apis}}{{#serializers}}
|
Serializers serializers = (_$serializers.toBuilder(){{#apiInfo}}{{#apis}}{{#serializers}}
|
||||||
..addBuilderFactory(
|
..addBuilderFactory(
|
||||||
{{#isArray}}
|
{{#isArray}}
|
||||||
const FullType(BuiltList, [FullType({{baseType}})]),
|
const FullType(Built{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}, [FullType({{baseType}})]),
|
||||||
() => ListBuilder<{{baseType}}>(),
|
() => {{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}Builder<{{baseType}}>(),
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
{{#isMap}}
|
{{#isMap}}
|
||||||
const FullType(BuiltMap, [FullType(String), FullType({{baseType}})]),
|
const FullType(BuiltMap, [FullType(String), FullType({{baseType}})]),
|
||||||
() => MapBuilder<String, {{baseType}}>(),
|
() => MapBuilder<String, {{baseType}}>(),
|
||||||
{{/isMap}}
|
{{/isMap}}
|
||||||
){{/serializers}}{{/apis}}{{/apiInfo}}{{#timeMachine}}
|
){{/serializers}}{{/apis}}{{/apiInfo}}{{#timeMachine}}
|
||||||
..add(OffsetDateSerializer())
|
..add(const OffsetDateSerializer())
|
||||||
..add(OffsetDateTimeSerializer()){{/timeMachine}}
|
..add(const OffsetDateTimeSerializer()){{/timeMachine}}
|
||||||
..add(Iso8601DateTimeSerializer()))
|
..add(Iso8601DateTimeSerializer()))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@@ -187,8 +187,8 @@ class {{{classname}}} {
|
|||||||
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
||||||
{{#isArray}}
|
{{#isArray}}
|
||||||
return (apiClient.deserialize(_decodeBodyBytes(response), '{{{returnType}}}') as List)
|
return (apiClient.deserialize(_decodeBodyBytes(response), '{{{returnType}}}') as List)
|
||||||
.map((item) => item as {{{returnBaseType}}})
|
.cast<{{{returnBaseType}}}>()
|
||||||
.toList(growable: false);
|
.{{#uniqueItems}}toSet(){{/uniqueItems}}{{^uniqueItems}}toList(growable: false){{/uniqueItems}};
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
{{^isArray}}
|
{{^isArray}}
|
||||||
{{#isMap}}
|
{{#isMap}}
|
||||||
|
|||||||
@@ -194,6 +194,12 @@ class ApiClient {
|
|||||||
.map((v) => _deserialize(v, newTargetType, growable: growable))
|
.map((v) => _deserialize(v, newTargetType, growable: growable))
|
||||||
.toList(growable: true == growable);
|
.toList(growable: true == growable);
|
||||||
}
|
}
|
||||||
|
if (value is Set && (match = _regSet.firstMatch(targetType)) != null) {
|
||||||
|
final newTargetType = match[1];
|
||||||
|
return value
|
||||||
|
.map((v) => _deserialize(v, newTargetType, growable: growable))
|
||||||
|
.toSet();
|
||||||
|
}
|
||||||
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
|
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
|
||||||
final newTargetType = match[1];
|
final newTargetType = match[1];
|
||||||
return Map.fromIterables(
|
return Map.fromIterables(
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
|
|||||||
const _dateEpochMarker = 'epoch';
|
const _dateEpochMarker = 'epoch';
|
||||||
final _dateFormatter = DateFormat('yyyy-MM-dd');
|
final _dateFormatter = DateFormat('yyyy-MM-dd');
|
||||||
final _regList = RegExp(r'^List<(.*)>$');
|
final _regList = RegExp(r'^List<(.*)>$');
|
||||||
|
final _regSet = RegExp(r'^Set<(.*)>$');
|
||||||
final _regMap = RegExp(r'^Map<String,(.*)>$');
|
final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||||
|
|
||||||
ApiClient defaultApiClient = ApiClient();
|
ApiClient defaultApiClient = ApiClient();
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ class {{{classname}}} {
|
|||||||
{{^isEnum}}
|
{{^isEnum}}
|
||||||
{{{name}}}: json[r'{{{baseName}}}'] == null
|
{{{name}}}: json[r'{{{baseName}}}'] == null
|
||||||
? null
|
? null
|
||||||
: (json[r'{{{baseName}}}'] as List).cast<{{{items.datatype}}}>(),
|
: (json[r'{{{baseName}}}'] as {{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}).cast<{{{items.datatype}}}>(),
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
{{^isArray}}
|
{{^isArray}}
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ type HttpSignatureAuth struct {
|
|||||||
privateKey crypto.PrivateKey // The private key used to sign HTTP requests.
|
privateKey crypto.PrivateKey // The private key used to sign HTTP requests.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetPrivateKey accepts a private key string and sets it.
|
||||||
|
func (h *HttpSignatureAuth) SetPrivateKey(privateKey string) error {
|
||||||
|
return h.parsePrivateKey([]byte(privateKey))
|
||||||
|
}
|
||||||
|
|
||||||
// ContextWithValue validates the HttpSignatureAuth configuration parameters and returns a context
|
// ContextWithValue validates the HttpSignatureAuth configuration parameters and returns a context
|
||||||
// suitable for HTTP signature. An error is returned if the HttpSignatureAuth configuration parameters
|
// suitable for HTTP signature. An error is returned if the HttpSignatureAuth configuration parameters
|
||||||
// are invalid.
|
// are invalid.
|
||||||
@@ -123,7 +128,7 @@ func (h *HttpSignatureAuth) ContextWithValue(ctx context.Context) (context.Conte
|
|||||||
if h.KeyId == "" {
|
if h.KeyId == "" {
|
||||||
return nil, fmt.Errorf("Key ID must be specified")
|
return nil, fmt.Errorf("Key ID must be specified")
|
||||||
}
|
}
|
||||||
if h.PrivateKeyPath == "" {
|
if h.PrivateKeyPath == "" && h.privateKey == nil {
|
||||||
return nil, fmt.Errorf("Private key path must be specified")
|
return nil, fmt.Errorf("Private key path must be specified")
|
||||||
}
|
}
|
||||||
if _, ok := supportedSigningSchemes[h.SigningScheme]; !ok {
|
if _, ok := supportedSigningSchemes[h.SigningScheme]; !ok {
|
||||||
@@ -168,7 +173,11 @@ func (h *HttpSignatureAuth) GetPublicKey() (crypto.PublicKey, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// loadPrivateKey reads the private key from the file specified in the HttpSignatureAuth.
|
// loadPrivateKey reads the private key from the file specified in the HttpSignatureAuth.
|
||||||
|
// The key is loaded only when privateKey is not already set.
|
||||||
func (h *HttpSignatureAuth) loadPrivateKey() (err error) {
|
func (h *HttpSignatureAuth) loadPrivateKey() (err error) {
|
||||||
|
if h.privateKey != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
var file *os.File
|
var file *os.File
|
||||||
file, err = os.Open(h.PrivateKeyPath)
|
file, err = os.Open(h.PrivateKeyPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -182,12 +191,18 @@ func (h *HttpSignatureAuth) loadPrivateKey() (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
return h.parsePrivateKey(priv)
|
||||||
|
}
|
||||||
|
|
||||||
|
// parsePrivateKey decodes privateKey byte array to crypto.PrivateKey type.
|
||||||
|
func (h *HttpSignatureAuth) parsePrivateKey(priv []byte) error {
|
||||||
pemBlock, _ := pem.Decode(priv)
|
pemBlock, _ := pem.Decode(priv)
|
||||||
if pemBlock == nil {
|
if pemBlock == nil {
|
||||||
// No PEM data has been found.
|
// No PEM data has been found.
|
||||||
return fmt.Errorf("File '%s' does not contain PEM data", h.PrivateKeyPath)
|
return fmt.Errorf("File '%s' does not contain PEM data", h.PrivateKeyPath)
|
||||||
}
|
}
|
||||||
var privKey []byte
|
var privKey []byte
|
||||||
|
var err error
|
||||||
if x509.IsEncryptedPEMBlock(pemBlock) {
|
if x509.IsEncryptedPEMBlock(pemBlock) {
|
||||||
// The PEM data is encrypted.
|
// The PEM data is encrypted.
|
||||||
privKey, err = x509.DecryptPEMBlock(pemBlock, []byte(h.Passphrase))
|
privKey, err = x509.DecryptPEMBlock(pemBlock, []byte(h.Passphrase))
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package {{packageName}}.infrastructure
|
|||||||
|
|
||||||
{{#moshi}}
|
{{#moshi}}
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
{{^moshiCodeGen}}
|
{{^moshiCodeGen}}
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
{{/moshiCodeGen}}
|
{{/moshiCodeGen}}
|
||||||
@@ -36,7 +35,6 @@ import java.util.Date
|
|||||||
{{#moshi}}
|
{{#moshi}}
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
@@ -54,7 +52,6 @@ import java.util.Date
|
|||||||
{{#gson}}
|
{{#gson}}
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val gsonBuilder: GsonBuilder = GsonBuilder()
|
val gsonBuilder: GsonBuilder = GsonBuilder()
|
||||||
.registerTypeAdapter(Date::class.java, DateAdapter())
|
|
||||||
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
|
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
|
||||||
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
|
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
|
||||||
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name {{{packageName}}}
|
|
||||||
|
|
||||||
{{#hasAuthMethods}}
|
{{#hasAuthMethods}}
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
|
|
||||||
def __init__(self, host=None,
|
def __init__(self, host=None,
|
||||||
api_key=None, api_key_prefix=None,
|
api_key=None, api_key_prefix=None,
|
||||||
|
access_token=None,
|
||||||
username=None, password=None,
|
username=None, password=None,
|
||||||
discard_unknown_keys=False,
|
discard_unknown_keys=False,
|
||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
@@ -190,6 +191,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
"""Temp file folder for downloading files
|
"""Temp file folder for downloading files
|
||||||
"""
|
"""
|
||||||
# Authentication Settings
|
# Authentication Settings
|
||||||
|
self.access_token = access_token
|
||||||
self.api_key = {}
|
self.api_key = {}
|
||||||
if api_key:
|
if api_key:
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
@@ -218,18 +220,6 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
"""The HTTP signing configuration
|
"""The HTTP signing configuration
|
||||||
"""
|
"""
|
||||||
{{/hasHttpSignatureMethods}}
|
{{/hasHttpSignatureMethods}}
|
||||||
{{#hasOAuthMethods}}
|
|
||||||
self.access_token = None
|
|
||||||
"""access token for OAuth/Bearer
|
|
||||||
"""
|
|
||||||
{{/hasOAuthMethods}}
|
|
||||||
{{^hasOAuthMethods}}
|
|
||||||
{{#hasBearerMethods}}
|
|
||||||
self.access_token = None
|
|
||||||
"""access token for OAuth/Bearer
|
|
||||||
"""
|
|
||||||
{{/hasBearerMethods}}
|
|
||||||
{{/hasOAuthMethods}}
|
|
||||||
self.logger = {}
|
self.logger = {}
|
||||||
"""Logging Settings
|
"""Logging Settings
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text(){{#supportAsync}}.await{{/supportAsync}}?;
|
let local_var_content = local_var_resp.text(){{#supportAsync}}.await{{/supportAsync}}?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
{{^supportMultipleResponses}}
|
{{^supportMultipleResponses}}
|
||||||
{{^returnType}}
|
{{^returnType}}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use reqwest;
|
|
||||||
use serde_json;
|
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export class {{classname}} {
|
|||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{^isListContainer}}
|
{{^isListContainer}}
|
||||||
if ({{paramName}} !== undefined && {{paramName}} !== null) {
|
if ({{paramName}} !== undefined && {{paramName}} !== null) {
|
||||||
headers['{{baseName}}'] String({{paramName}});
|
headers['{{baseName}}'] = String({{paramName}});
|
||||||
}
|
}
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
@@ -147,7 +147,7 @@ export class {{classname}} {
|
|||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
{{#produces}}
|
{{#produces}}
|
||||||
'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}
|
'{{{mediaType}}}'{{^-last}},{{/-last}}
|
||||||
{{/produces}}
|
{{/produces}}
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -158,7 +158,7 @@ export class {{classname}} {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
{{#consumes}}
|
{{#consumes}}
|
||||||
'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}
|
'{{{mediaType}}}'{{^-last}},{{/-last}}
|
||||||
{{/consumes}}
|
{{/consumes}}
|
||||||
];
|
];
|
||||||
{{#bodyParam}}
|
{{#bodyParam}}
|
||||||
@@ -167,8 +167,8 @@ export class {{classname}} {
|
|||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
{{/bodyParam}}
|
{{/bodyParam}}
|
||||||
|
|
||||||
{{#hasFormParams}}
|
{{#hasFormParams}}
|
||||||
|
|
||||||
const canConsumeForm = this.canConsumeForm(consumes);
|
const canConsumeForm = this.canConsumeForm(consumes);
|
||||||
|
|
||||||
let formParams: { append(param: string, value: any): void; };
|
let formParams: { append(param: string, value: any): void; };
|
||||||
@@ -176,6 +176,7 @@ export class {{classname}} {
|
|||||||
let convertFormParamsToString = false;
|
let convertFormParamsToString = false;
|
||||||
{{#formParams}}
|
{{#formParams}}
|
||||||
{{#isFile}}
|
{{#isFile}}
|
||||||
|
|
||||||
// use FormData to transmit files using content-type "multipart/form-data"
|
// use FormData to transmit files using content-type "multipart/form-data"
|
||||||
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
|
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
|
||||||
useForm = canConsumeForm;
|
useForm = canConsumeForm;
|
||||||
@@ -186,8 +187,8 @@ export class {{classname}} {
|
|||||||
} else {
|
} else {
|
||||||
// formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()});
|
// formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()});
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#formParams}}
|
{{#formParams}}
|
||||||
|
|
||||||
{{#isListContainer}}
|
{{#isListContainer}}
|
||||||
if ({{paramName}}) {
|
if ({{paramName}}) {
|
||||||
{{#isCollectionFormatMulti}}
|
{{#isCollectionFormatMulti}}
|
||||||
|
|||||||
@@ -142,6 +142,45 @@ public class DartModelTest {
|
|||||||
Assert.assertTrue(property2.isContainer);
|
Assert.assertTrue(property2.isContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with set property")
|
||||||
|
public void setPropertyTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("id", new IntegerSchema())
|
||||||
|
.addProperties("urls", new ArraySchema().items(new StringSchema()).uniqueItems(true))
|
||||||
|
.addRequiredItem("id");
|
||||||
|
|
||||||
|
final DefaultCodegen codegen = new DartClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 2);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "id");
|
||||||
|
Assert.assertEquals(property1.dataType, "int");
|
||||||
|
Assert.assertEquals(property1.name, "id");
|
||||||
|
Assert.assertNull(property1.defaultValue);
|
||||||
|
Assert.assertEquals(property1.baseType, "int");
|
||||||
|
Assert.assertTrue(property1.required);
|
||||||
|
Assert.assertTrue(property1.isPrimitiveType);
|
||||||
|
Assert.assertFalse(property1.isContainer);
|
||||||
|
|
||||||
|
final CodegenProperty property2 = cm.vars.get(1);
|
||||||
|
Assert.assertEquals(property2.baseName, "urls");
|
||||||
|
Assert.assertEquals(property2.dataType, "Set<String>");
|
||||||
|
Assert.assertEquals(property2.name, "urls");
|
||||||
|
Assert.assertEquals(property2.baseType, "Set");
|
||||||
|
Assert.assertEquals(property2.containerType, "set");
|
||||||
|
Assert.assertFalse(property2.required);
|
||||||
|
Assert.assertTrue(property2.isPrimitiveType);
|
||||||
|
Assert.assertTrue(property2.isContainer);
|
||||||
|
}
|
||||||
|
|
||||||
@Test(description = "convert a model with a map property")
|
@Test(description = "convert a model with a map property")
|
||||||
public void mapPropertyTest() {
|
public void mapPropertyTest() {
|
||||||
final Schema model = new Schema()
|
final Schema model = new Schema()
|
||||||
|
|||||||
@@ -204,6 +204,44 @@ public class DartDioModelTest {
|
|||||||
Assert.assertTrue(property2.isContainer);
|
Assert.assertTrue(property2.isContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with set property")
|
||||||
|
public void setPropertyTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("id", new IntegerSchema())
|
||||||
|
.addProperties("urls", new ArraySchema().items(new StringSchema()).uniqueItems(true))
|
||||||
|
.addRequiredItem("id");
|
||||||
|
final DefaultCodegen codegen = new DartDioClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 2);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "id");
|
||||||
|
Assert.assertEquals(property1.dataType, "int");
|
||||||
|
Assert.assertEquals(property1.name, "id");
|
||||||
|
Assert.assertNull(property1.defaultValue);
|
||||||
|
Assert.assertEquals(property1.baseType, "int");
|
||||||
|
Assert.assertTrue(property1.required);
|
||||||
|
Assert.assertTrue(property1.isPrimitiveType);
|
||||||
|
Assert.assertFalse(property1.isContainer);
|
||||||
|
|
||||||
|
final CodegenProperty property2 = cm.vars.get(1);
|
||||||
|
Assert.assertEquals(property2.baseName, "urls");
|
||||||
|
Assert.assertEquals(property2.dataType, "BuiltSet<String>");
|
||||||
|
Assert.assertEquals(property2.name, "urls");
|
||||||
|
Assert.assertEquals(property2.baseType, "BuiltSet");
|
||||||
|
Assert.assertEquals(property2.containerType, "set");
|
||||||
|
Assert.assertFalse(property2.required);
|
||||||
|
Assert.assertTrue(property2.isPrimitiveType);
|
||||||
|
Assert.assertTrue(property2.isContainer);
|
||||||
|
}
|
||||||
|
|
||||||
@Test(description = "convert a model with a map property")
|
@Test(description = "convert a model with a map property")
|
||||||
public void mapPropertyTest() {
|
public void mapPropertyTest() {
|
||||||
final Schema model = new Schema()
|
final Schema model = new Schema()
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ paths:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
uniqueItems: true
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: successful operation
|
description: successful operation
|
||||||
@@ -143,11 +144,13 @@ paths:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
|
uniqueItems: true
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
|
uniqueItems: true
|
||||||
'400':
|
'400':
|
||||||
description: Invalid tag value
|
description: Invalid tag value
|
||||||
security:
|
security:
|
||||||
@@ -1313,6 +1316,7 @@ components:
|
|||||||
wrapped: true
|
wrapped: true
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
uniqueItems: true
|
||||||
tags:
|
tags:
|
||||||
type: array
|
type: array
|
||||||
xml:
|
xml:
|
||||||
|
|||||||
7
pom.xml
7
pom.xml
@@ -1181,6 +1181,8 @@
|
|||||||
</property>
|
</property>
|
||||||
</activation>
|
</activation>
|
||||||
<modules>
|
<modules>
|
||||||
|
<module>samples/client/petstore/typescript-axios/builds/with-npm-version</module>
|
||||||
|
<module>samples/client/petstore/typescript-axios/tests/default</module>
|
||||||
<module>samples/client/petstore/crystal</module>
|
<module>samples/client/petstore/crystal</module>
|
||||||
<!-- servers -->
|
<!-- servers -->
|
||||||
<module>samples/server/petstore/python-aiohttp</module>
|
<module>samples/server/petstore/python-aiohttp</module>
|
||||||
@@ -1222,7 +1224,6 @@
|
|||||||
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
|
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
|
||||||
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
||||||
<module>samples/client/petstore/typescript-fetch/tests/default</module>
|
<module>samples/client/petstore/typescript-fetch/tests/default</module>
|
||||||
<module>samples/client/petstore/typescript-axios/tests/default</module>
|
|
||||||
<module>samples/client/petstore/typescript-node/npm</module>
|
<module>samples/client/petstore/typescript-node/npm</module>
|
||||||
<module>samples/client/petstore/typescript-rxjs/builds/with-npm-version</module>
|
<module>samples/client/petstore/typescript-rxjs/builds/with-npm-version</module>
|
||||||
<!-- TODO comment out below when the test for typescript-nestjs is ready
|
<!-- TODO comment out below when the test for typescript-nestjs is ready
|
||||||
@@ -1259,8 +1260,7 @@
|
|||||||
<module>samples/server/petstore/jaxrs-spec</module>
|
<module>samples/server/petstore/jaxrs-spec</module>
|
||||||
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
||||||
<module>samples/server/petstore/jaxrs-spec-interface-response</module>
|
<module>samples/server/petstore/jaxrs-spec-interface-response</module>
|
||||||
<module>samples/server/petstore/java-vertx/rx</module>
|
<module>samples/server/petstore/java-vertx-web</module>
|
||||||
<module>samples/server/petstore/java-vertx/async</module>
|
|
||||||
<module>samples/server/petstore/java-inflector</module>
|
<module>samples/server/petstore/java-inflector</module>
|
||||||
<module>samples/server/petstore/java-pkmst</module>
|
<module>samples/server/petstore/java-pkmst</module>
|
||||||
<module>samples/server/petstore/java-play-framework</module>
|
<module>samples/server/petstore/java-play-framework</module>
|
||||||
@@ -1302,7 +1302,6 @@
|
|||||||
<module>samples/server/petstore/scala-play-server</module>
|
<module>samples/server/petstore/scala-play-server</module>
|
||||||
<module>samples/server/petstore/scala-akka-http-server</module>
|
<module>samples/server/petstore/scala-akka-http-server</module>
|
||||||
<module>samples/server/petstore/scalatra</module>
|
<module>samples/server/petstore/scalatra</module>
|
||||||
<module>samples/server/petstore/java-vertx-web</module>
|
|
||||||
<module>samples/server/petstore/scala-finch</module>
|
<module>samples/server/petstore/scala-finch</module>
|
||||||
<!--<module>samples/server/petstore/kotlin/vertx</module>-->
|
<!--<module>samples/server/petstore/kotlin/vertx</module>-->
|
||||||
</modules>
|
</modules>
|
||||||
|
|||||||
@@ -477,6 +477,19 @@ namespace Org.OpenAPITools.Client
|
|||||||
response = client.Execute<T>(req);
|
response = client.Execute<T>(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
|
if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
T instance = (T)Activator.CreateInstance(typeof(T));
|
||||||
|
MethodInfo method = typeof(T).GetMethod("FromJson");
|
||||||
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
|
response.Data = instance;
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
var result = ToApiResponse(response);
|
var result = ToApiResponse(response);
|
||||||
@@ -587,6 +600,10 @@ namespace Org.OpenAPITools.Client
|
|||||||
method.Invoke(instance, new object[] { response.Content });
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
response.Data = instance;
|
response.Data = instance;
|
||||||
}
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
|
|||||||
@@ -477,6 +477,19 @@ namespace Org.OpenAPITools.Client
|
|||||||
response = client.Execute<T>(req);
|
response = client.Execute<T>(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
|
if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
T instance = (T)Activator.CreateInstance(typeof(T));
|
||||||
|
MethodInfo method = typeof(T).GetMethod("FromJson");
|
||||||
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
|
response.Data = instance;
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
var result = ToApiResponse(response);
|
var result = ToApiResponse(response);
|
||||||
@@ -587,6 +600,10 @@ namespace Org.OpenAPITools.Client
|
|||||||
method.Invoke(instance, new object[] { response.Content });
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
response.Data = instance;
|
response.Data = instance;
|
||||||
}
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,19 @@ namespace Org.OpenAPITools.Test
|
|||||||
Assert.Equal("sample category name2", response.Category.Name);
|
Assert.Equal("sample category name2", response.Category.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* a simple test for binary response. no longer in use.
|
||||||
|
[Fact]
|
||||||
|
public void TestGetByIdBinaryResponse()
|
||||||
|
{
|
||||||
|
PetApi petApi = new PetApi(c1);
|
||||||
|
Stream response = petApi.GetPetByIdBinaryResponse(petId);
|
||||||
|
Assert.IsType<System.IO.MemoryStream>(response);
|
||||||
|
StreamReader reader = new StreamReader(response);
|
||||||
|
// the following will fail for sure
|
||||||
|
//Assert.Equal("someting", reader.ReadToEnd());
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test GetPetByIdWithHttpInfoAsync
|
/// Test GetPetByIdWithHttpInfoAsync
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -476,6 +476,19 @@ namespace Org.OpenAPITools.Client
|
|||||||
response = client.Execute<T>(req);
|
response = client.Execute<T>(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
|
if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
T instance = (T)Activator.CreateInstance(typeof(T));
|
||||||
|
MethodInfo method = typeof(T).GetMethod("FromJson");
|
||||||
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
|
response.Data = instance;
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
var result = ToApiResponse(response);
|
var result = ToApiResponse(response);
|
||||||
@@ -586,6 +599,10 @@ namespace Org.OpenAPITools.Client
|
|||||||
method.Invoke(instance, new object[] { response.Content });
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
response.Data = instance;
|
response.Data = instance;
|
||||||
}
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
|
|||||||
@@ -477,6 +477,19 @@ namespace Org.OpenAPITools.Client
|
|||||||
response = client.Execute<T>(req);
|
response = client.Execute<T>(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
|
if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
T instance = (T)Activator.CreateInstance(typeof(T));
|
||||||
|
MethodInfo method = typeof(T).GetMethod("FromJson");
|
||||||
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
|
response.Data = instance;
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
var result = ToApiResponse(response);
|
var result = ToApiResponse(response);
|
||||||
@@ -587,6 +600,10 @@ namespace Org.OpenAPITools.Client
|
|||||||
method.Invoke(instance, new object[] { response.Content });
|
method.Invoke(instance, new object[] { response.Content });
|
||||||
response.Data = instance;
|
response.Data = instance;
|
||||||
}
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
|
||||||
InterceptResponse(req, response);
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,31 +18,37 @@ import 'package:openapi/api/store_api.dart';
|
|||||||
import 'package:openapi/api/user_api.dart';
|
import 'package:openapi/api/user_api.dart';
|
||||||
|
|
||||||
|
|
||||||
final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()];
|
final _defaultInterceptors = [
|
||||||
|
OAuthInterceptor(),
|
||||||
|
BasicAuthInterceptor(),
|
||||||
|
ApiKeyAuthInterceptor(),
|
||||||
|
];
|
||||||
|
|
||||||
class Openapi {
|
class Openapi {
|
||||||
|
|
||||||
Dio dio;
|
static const String basePath = r'http://petstore.swagger.io/v2';
|
||||||
Serializers serializers;
|
|
||||||
String basePath = 'http://petstore.swagger.io/v2';
|
|
||||||
|
|
||||||
Openapi({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
final Dio dio;
|
||||||
if (dio == null) {
|
|
||||||
BaseOptions options = new BaseOptions(
|
final Serializers serializers;
|
||||||
|
|
||||||
|
Openapi({
|
||||||
|
Dio dio,
|
||||||
|
Serializers serializers,
|
||||||
|
String basePathOverride,
|
||||||
|
List<Interceptor> interceptors,
|
||||||
|
}) : this.serializers = serializers ?? standardSerializers,
|
||||||
|
this.dio = dio ??
|
||||||
|
Dio(BaseOptions(
|
||||||
baseUrl: basePathOverride ?? basePath,
|
baseUrl: basePathOverride ?? basePath,
|
||||||
connectTimeout: 5000,
|
connectTimeout: 5000,
|
||||||
receiveTimeout: 3000,
|
receiveTimeout: 3000,
|
||||||
);
|
)) {
|
||||||
this.dio = new Dio(options);
|
if (interceptors == null) {
|
||||||
}
|
this.dio.interceptors.addAll(_defaultInterceptors);
|
||||||
|
} else {
|
||||||
if (interceptors == null) {
|
this.dio.interceptors.addAll(interceptors);
|
||||||
this.dio.interceptors.addAll(_defaultInterceptors);
|
}
|
||||||
} else {
|
|
||||||
this.dio.interceptors.addAll(interceptors);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.serializers = serializers ?? standardSerializers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOAuthToken(String name, String token) {
|
void setOAuthToken(String name, String token) {
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ import 'package:built_collection/built_collection.dart';
|
|||||||
import 'package:openapi/api_util.dart';
|
import 'package:openapi/api_util.dart';
|
||||||
|
|
||||||
class PetApi {
|
class PetApi {
|
||||||
final Dio _dio;
|
|
||||||
Serializers _serializers;
|
|
||||||
|
|
||||||
PetApi(this._dio, this._serializers);
|
final Dio _dio;
|
||||||
|
|
||||||
|
final Serializers _serializers;
|
||||||
|
|
||||||
|
const PetApi(this._dio, this._serializers);
|
||||||
|
|
||||||
/// Add a new pet to the store
|
/// Add a new pet to the store
|
||||||
///
|
///
|
||||||
@@ -181,8 +183,7 @@ class PetApi {
|
|||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
const collectionType = BuiltList;
|
const type = FullType(BuiltList, [FullType(Pet)]);
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
|
||||||
final data = _serializers.deserialize(
|
final data = _serializers.deserialize(
|
||||||
response.data is String
|
response.data is String
|
||||||
? jsonDecode(response.data as String)
|
? jsonDecode(response.data as String)
|
||||||
@@ -193,6 +194,7 @@ class PetApi {
|
|||||||
return Response<BuiltList<Pet>>(
|
return Response<BuiltList<Pet>>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
@@ -251,8 +253,7 @@ class PetApi {
|
|||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
const collectionType = BuiltList;
|
const type = FullType(BuiltList, [FullType(Pet)]);
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
|
||||||
final data = _serializers.deserialize(
|
final data = _serializers.deserialize(
|
||||||
response.data is String
|
response.data is String
|
||||||
? jsonDecode(response.data as String)
|
? jsonDecode(response.data as String)
|
||||||
@@ -263,6 +264,7 @@ class PetApi {
|
|||||||
return Response<BuiltList<Pet>>(
|
return Response<BuiltList<Pet>>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
@@ -331,6 +333,7 @@ class PetApi {
|
|||||||
return Response<Pet>(
|
return Response<Pet>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
@@ -525,6 +528,7 @@ class PetApi {
|
|||||||
return Response<ApiResponse>(
|
return Response<ApiResponse>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ import 'package:openapi/model/order.dart';
|
|||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
|
||||||
class StoreApi {
|
class StoreApi {
|
||||||
final Dio _dio;
|
|
||||||
Serializers _serializers;
|
|
||||||
|
|
||||||
StoreApi(this._dio, this._serializers);
|
final Dio _dio;
|
||||||
|
|
||||||
|
final Serializers _serializers;
|
||||||
|
|
||||||
|
const StoreApi(this._dio, this._serializers);
|
||||||
|
|
||||||
/// Delete purchase order by ID
|
/// Delete purchase order by ID
|
||||||
///
|
///
|
||||||
@@ -113,8 +115,7 @@ class StoreApi {
|
|||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
const collectionType = BuiltMap;
|
const type = FullType(BuiltMap, [FullType(String), FullType(int)]);
|
||||||
const type = FullType(collectionType, [FullType(String), FullType(int)]);
|
|
||||||
final data = _serializers.deserialize(
|
final data = _serializers.deserialize(
|
||||||
response.data is String
|
response.data is String
|
||||||
? jsonDecode(response.data as String)
|
? jsonDecode(response.data as String)
|
||||||
@@ -125,6 +126,7 @@ class StoreApi {
|
|||||||
return Response<BuiltMap<String, int>>(
|
return Response<BuiltMap<String, int>>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
@@ -186,6 +188,7 @@ class StoreApi {
|
|||||||
return Response<Order>(
|
return Response<Order>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
@@ -252,6 +255,7 @@ class StoreApi {
|
|||||||
return Response<Order>(
|
return Response<Order>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ import 'package:openapi/model/user.dart';
|
|||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
|
||||||
class UserApi {
|
class UserApi {
|
||||||
final Dio _dio;
|
|
||||||
Serializers _serializers;
|
|
||||||
|
|
||||||
UserApi(this._dio, this._serializers);
|
final Dio _dio;
|
||||||
|
|
||||||
|
final Serializers _serializers;
|
||||||
|
|
||||||
|
const UserApi(this._dio, this._serializers);
|
||||||
|
|
||||||
/// Create user
|
/// Create user
|
||||||
///
|
///
|
||||||
@@ -266,6 +268,7 @@ class UserApi {
|
|||||||
return Response<User>(
|
return Response<User>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
@@ -326,6 +329,7 @@ class UserApi {
|
|||||||
return Response<String>(
|
return Response<String>(
|
||||||
data: data,
|
data: data,
|
||||||
headers: response.headers,
|
headers: response.headers,
|
||||||
|
isRedirect: response.isRedirect,
|
||||||
request: response.request,
|
request: response.request,
|
||||||
redirects: response.redirects,
|
redirects: response.redirects,
|
||||||
statusCode: response.statusCode,
|
statusCode: response.statusCode,
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
|
|||||||
const _dateEpochMarker = 'epoch';
|
const _dateEpochMarker = 'epoch';
|
||||||
final _dateFormatter = DateFormat('yyyy-MM-dd');
|
final _dateFormatter = DateFormat('yyyy-MM-dd');
|
||||||
final _regList = RegExp(r'^List<(.*)>$');
|
final _regList = RegExp(r'^List<(.*)>$');
|
||||||
|
final _regSet = RegExp(r'^Set<(.*)>$');
|
||||||
final _regMap = RegExp(r'^Map<String,(.*)>$');
|
final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||||
|
|
||||||
ApiClient defaultApiClient = ApiClient();
|
ApiClient defaultApiClient = ApiClient();
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ class PetApi {
|
|||||||
// FormatException when trying to decode an empty string.
|
// FormatException when trying to decode an empty string.
|
||||||
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
||||||
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<Pet>') as List)
|
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<Pet>') as List)
|
||||||
.map((item) => item as Pet)
|
.cast<Pet>()
|
||||||
.toList(growable: false);
|
.toList(growable: false);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -300,7 +300,7 @@ class PetApi {
|
|||||||
// FormatException when trying to decode an empty string.
|
// FormatException when trying to decode an empty string.
|
||||||
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
||||||
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<Pet>') as List)
|
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<Pet>') as List)
|
||||||
.map((item) => item as Pet)
|
.cast<Pet>()
|
||||||
.toList(growable: false);
|
.toList(growable: false);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -188,6 +188,12 @@ class ApiClient {
|
|||||||
.map((v) => _deserialize(v, newTargetType, growable: growable))
|
.map((v) => _deserialize(v, newTargetType, growable: growable))
|
||||||
.toList(growable: true == growable);
|
.toList(growable: true == growable);
|
||||||
}
|
}
|
||||||
|
if (value is Set && (match = _regSet.firstMatch(targetType)) != null) {
|
||||||
|
final newTargetType = match[1];
|
||||||
|
return value
|
||||||
|
.map((v) => _deserialize(v, newTargetType, growable: growable))
|
||||||
|
.toSet();
|
||||||
|
}
|
||||||
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
|
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
|
||||||
final newTargetType = match[1];
|
final newTargetType = match[1];
|
||||||
return Map.fromIterables(
|
return Map.fromIterables(
|
||||||
|
|||||||
@@ -279,12 +279,12 @@
|
|||||||
<java.version>1.7</java.version>
|
<java.version>1.7</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<gson-fire-version>1.8.4</gson-fire-version>
|
<gson-fire-version>1.8.5</gson-fire-version>
|
||||||
<swagger-core-version>1.5.24</swagger-core-version>
|
<swagger-core-version>1.6.2</swagger-core-version>
|
||||||
<okhttp-version>3.14.7</okhttp-version>
|
<okhttp-version>4.9.1</okhttp-version>
|
||||||
<gson-version>2.8.6</gson-version>
|
<gson-version>2.8.6</gson-version>
|
||||||
<commons-lang3-version>3.10</commons-lang3-version>
|
<commons-lang3-version>3.11</commons-lang3-version>
|
||||||
<threetenbp-version>1.4.3</threetenbp-version>
|
<threetenbp-version>1.5.0</threetenbp-version>
|
||||||
<javax-annotation-version>1.3.2</javax-annotation-version>
|
<javax-annotation-version>1.3.2</javax-annotation-version>
|
||||||
<junit-version>4.13.1</junit-version>
|
<junit-version>4.13.1</junit-version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -281,12 +281,12 @@
|
|||||||
<java.version>1.7</java.version>
|
<java.version>1.7</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<gson-fire-version>1.8.4</gson-fire-version>
|
<gson-fire-version>1.8.5</gson-fire-version>
|
||||||
<swagger-core-version>1.5.24</swagger-core-version>
|
<swagger-core-version>1.6.2</swagger-core-version>
|
||||||
<okhttp-version>3.14.7</okhttp-version>
|
<okhttp-version>4.9.1</okhttp-version>
|
||||||
<gson-version>2.8.6</gson-version>
|
<gson-version>2.8.6</gson-version>
|
||||||
<commons-lang3-version>3.10</commons-lang3-version>
|
<commons-lang3-version>3.11</commons-lang3-version>
|
||||||
<threetenbp-version>1.4.3</threetenbp-version>
|
<threetenbp-version>1.5.0</threetenbp-version>
|
||||||
<javax-annotation-version>1.3.2</javax-annotation-version>
|
<javax-annotation-version>1.3.2</javax-annotation-version>
|
||||||
<junit-version>4.13.1</junit-version>
|
<junit-version>4.13.1</junit-version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -274,12 +274,12 @@
|
|||||||
<java.version>1.7</java.version>
|
<java.version>1.7</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<gson-fire-version>1.8.4</gson-fire-version>
|
<gson-fire-version>1.8.5</gson-fire-version>
|
||||||
<swagger-core-version>1.5.24</swagger-core-version>
|
<swagger-core-version>1.6.2</swagger-core-version>
|
||||||
<okhttp-version>3.14.7</okhttp-version>
|
<okhttp-version>4.9.1</okhttp-version>
|
||||||
<gson-version>2.8.6</gson-version>
|
<gson-version>2.8.6</gson-version>
|
||||||
<commons-lang3-version>3.10</commons-lang3-version>
|
<commons-lang3-version>3.11</commons-lang3-version>
|
||||||
<threetenbp-version>1.4.3</threetenbp-version>
|
<threetenbp-version>1.5.0</threetenbp-version>
|
||||||
<javax-annotation-version>1.3.2</javax-annotation-version>
|
<javax-annotation-version>1.3.2</javax-annotation-version>
|
||||||
<junit-version>4.13.1</junit-version>
|
<junit-version>4.13.1</junit-version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import java.util.Date
|
|||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val gsonBuilder: GsonBuilder = GsonBuilder()
|
val gsonBuilder: GsonBuilder = GsonBuilder()
|
||||||
.registerTypeAdapter(Date::class.java, DateAdapter())
|
|
||||||
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
|
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
|
||||||
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
|
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
|
||||||
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import java.util.Date
|
|||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val gsonBuilder: GsonBuilder = GsonBuilder()
|
val gsonBuilder: GsonBuilder = GsonBuilder()
|
||||||
.registerTypeAdapter(Date::class.java, DateAdapter())
|
|
||||||
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
|
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
|
||||||
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
|
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
|
||||||
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
internal object Serializer {
|
internal object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
5.0.0-SNAPSHOT
|
5.0.1-SNAPSHOT
|
||||||
@@ -33,6 +33,5 @@ dependencies {
|
|||||||
compile "com.squareup.moshi:moshi-kotlin:1.9.2"
|
compile "com.squareup.moshi:moshi-kotlin:1.9.2"
|
||||||
compile "com.squareup.moshi:moshi-adapters:1.9.2"
|
compile "com.squareup.moshi:moshi-adapters:1.9.2"
|
||||||
compile "com.squareup.okhttp3:okhttp:4.2.2"
|
compile "com.squareup.okhttp3:okhttp:4.2.2"
|
||||||
compile "com.squareup.okhttp3:logging-interceptor:4.4.0"
|
|
||||||
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0"
|
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ val Response.isInformational : Boolean get() = this.code in 100..199
|
|||||||
/**
|
/**
|
||||||
* Provides an extension to evaluation whether the response is a 3xx code
|
* Provides an extension to evaluation whether the response is a 3xx code
|
||||||
*/
|
*/
|
||||||
|
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
|
||||||
val Response.isRedirect : Boolean get() = this.code in 300..399
|
val Response.isRedirect : Boolean get() = this.code in 300..399
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package org.openapitools.client.infrastructure
|
package org.openapitools.client.infrastructure
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
|
||||||
.add(OffsetDateTimeAdapter())
|
.add(OffsetDateTimeAdapter())
|
||||||
.add(LocalDateTimeAdapter())
|
.add(LocalDateTimeAdapter())
|
||||||
.add(LocalDateAdapter())
|
.add(LocalDateAdapter())
|
||||||
|
|||||||
@@ -1055,6 +1055,7 @@ class PetApi
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$resourcePath = '/pet/findByTags';
|
$resourcePath = '/pet/findByTags';
|
||||||
$formParams = [];
|
$formParams = [];
|
||||||
$queryParams = [];
|
$queryParams = [];
|
||||||
|
|||||||
@@ -362,6 +362,8 @@ class Pet implements ModelInterface, ArrayAccess, \JsonSerializable
|
|||||||
*/
|
*/
|
||||||
public function setPhotoUrls($photo_urls)
|
public function setPhotoUrls($photo_urls)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$this->container['photo_urls'] = $photo_urls;
|
$this->container['photo_urls'] = $photo_urls;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ Add a new pet to the store
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
@@ -72,8 +70,6 @@ Deletes a pet
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
@@ -124,8 +120,6 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
@@ -174,8 +168,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
@@ -224,8 +216,6 @@ Returns a single pet
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
@@ -274,8 +264,6 @@ Update an existing pet
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
@@ -324,8 +312,6 @@ Updates a pet in the store with form data
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
@@ -378,8 +364,6 @@ uploads an image
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure OAuth2 access token for authorization: petstore_auth
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
$OrderId = "OrderId_example" # String | ID of the order that needs to be deleted
|
$OrderId = "OrderId_example" # String | ID of the order that needs to be deleted
|
||||||
|
|
||||||
# Delete purchase order by ID
|
# Delete purchase order by ID
|
||||||
@@ -65,8 +63,6 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: api_key
|
# Configure API key authorization: api_key
|
||||||
@@ -113,8 +109,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
$OrderId = 987 # Int64 | ID of pet that needs to be fetched
|
$OrderId = 987 # Int64 | ID of pet that needs to be fetched
|
||||||
|
|
||||||
# Find purchase order by ID
|
# Find purchase order by ID
|
||||||
@@ -156,8 +150,6 @@ Place an order for a pet
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
$Order = (Initialize-Order -Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "placed" -Complete $false) # Order | order placed for purchasing the pet
|
$Order = (Initialize-Order -Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "placed" -Complete $false) # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
# Place an order for a pet
|
# Place an order for a pet
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: auth_cookie
|
# Configure API key authorization: auth_cookie
|
||||||
@@ -75,8 +73,6 @@ Creates list of users with given input array
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: auth_cookie
|
# Configure API key authorization: auth_cookie
|
||||||
@@ -125,8 +121,6 @@ Creates list of users with given input array
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: auth_cookie
|
# Configure API key authorization: auth_cookie
|
||||||
@@ -177,8 +171,6 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: auth_cookie
|
# Configure API key authorization: auth_cookie
|
||||||
@@ -227,8 +219,6 @@ Get user by user name
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
$Username = "Username_example" # String | The name that needs to be fetched. Use user1 for testing.
|
$Username = "Username_example" # String | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
# Get user by user name
|
# Get user by user name
|
||||||
@@ -271,8 +261,6 @@ Logs user into the system
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
$Username = "Username_example" # String | The user name for login
|
$Username = "Username_example" # String | The user name for login
|
||||||
$Password = "Password_example" # String | The password for login in clear text
|
$Password = "Password_example" # String | The password for login in clear text
|
||||||
|
|
||||||
@@ -315,8 +303,6 @@ Logs out current logged in user session
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: auth_cookie
|
# Configure API key authorization: auth_cookie
|
||||||
@@ -364,8 +350,6 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```powershell
|
```powershell
|
||||||
Import-Module -Name PSPetstore
|
|
||||||
|
|
||||||
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
# general setting of the PowerShell module, e.g. base URL, authentication, etc
|
||||||
$Configuration = Get-Configuration
|
$Configuration = Get-Configuration
|
||||||
# Configure API key authorization: auth_cookie
|
# Configure API key authorization: auth_cookie
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ conf = petstore_api.Configuration(
|
|||||||
|
|
||||||
def __init__(self, host=None,
|
def __init__(self, host=None,
|
||||||
api_key=None, api_key_prefix=None,
|
api_key=None, api_key_prefix=None,
|
||||||
|
access_token=None,
|
||||||
username=None, password=None,
|
username=None, password=None,
|
||||||
discard_unknown_keys=False,
|
discard_unknown_keys=False,
|
||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
@@ -142,6 +143,7 @@ conf = petstore_api.Configuration(
|
|||||||
"""Temp file folder for downloading files
|
"""Temp file folder for downloading files
|
||||||
"""
|
"""
|
||||||
# Authentication Settings
|
# Authentication Settings
|
||||||
|
self.access_token = access_token
|
||||||
self.api_key = {}
|
self.api_key = {}
|
||||||
if api_key:
|
if api_key:
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
@@ -163,9 +165,6 @@ conf = petstore_api.Configuration(
|
|||||||
"""
|
"""
|
||||||
self.discard_unknown_keys = discard_unknown_keys
|
self.discard_unknown_keys = discard_unknown_keys
|
||||||
self.disabled_client_side_validations = disabled_client_side_validations
|
self.disabled_client_side_validations = disabled_client_side_validations
|
||||||
self.access_token = None
|
|
||||||
"""access token for OAuth/Bearer
|
|
||||||
"""
|
|
||||||
self.logger = {}
|
self.logger = {}
|
||||||
"""Logging Settings
|
"""Logging Settings
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -154,6 +154,16 @@ module Petstore
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Custom attribute writer method with validation
|
||||||
|
# @param [Object] photo_urls Value to be assigned
|
||||||
|
def photo_urls=(photo_urls)
|
||||||
|
if photo_urls.nil?
|
||||||
|
fail ArgumentError, 'photo_urls cannot be nil'
|
||||||
|
end
|
||||||
|
|
||||||
|
@photo_urls = photo_urls
|
||||||
|
end
|
||||||
|
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
# @param [Object] status Object to be assigned
|
# @param [Object] status Object to be assigned
|
||||||
def status=(status)
|
def status=(status)
|
||||||
|
|||||||
@@ -154,6 +154,16 @@ module Petstore
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Custom attribute writer method with validation
|
||||||
|
# @param [Object] photo_urls Value to be assigned
|
||||||
|
def photo_urls=(photo_urls)
|
||||||
|
if photo_urls.nil?
|
||||||
|
fail ArgumentError, 'photo_urls cannot be nil'
|
||||||
|
end
|
||||||
|
|
||||||
|
@photo_urls = photo_urls
|
||||||
|
end
|
||||||
|
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
# @param [Object] status Object to be assigned
|
# @param [Object] status Object to be assigned
|
||||||
def status=(status)
|
def status=(status)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use reqwest;
|
|
||||||
use serde_json;
|
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ pub async fn add_pet(configuration: &configuration::Configuration, params: AddPe
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<AddPetSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<AddPetSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -269,7 +269,7 @@ pub async fn delete_pet(configuration: &configuration::Configuration, params: De
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<DeletePetSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<DeletePetSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -305,7 +305,7 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<FindPetsByStatusSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<FindPetsByStatusSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -341,7 +341,7 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<FindPetsByTagsSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<FindPetsByTagsSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -381,7 +381,7 @@ pub async fn get_pet_by_id(configuration: &configuration::Configuration, params:
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<GetPetByIdSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetPetByIdSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -416,7 +416,7 @@ pub async fn update_pet(configuration: &configuration::Configuration, params: Up
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<UpdatePetSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UpdatePetSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -460,7 +460,7 @@ pub async fn update_pet_with_form(configuration: &configuration::Configuration,
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<UpdatePetWithFormSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UpdatePetWithFormSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -502,7 +502,7 @@ pub async fn upload_file(configuration: &configuration::Configuration, params: U
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<UploadFileSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UploadFileSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ pub async fn delete_order(configuration: &configuration::Configuration, params:
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<DeleteOrderSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<DeleteOrderSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -161,7 +161,7 @@ pub async fn get_inventory(configuration: &configuration::Configuration) -> Resu
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<GetInventorySuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetInventorySuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -193,7 +193,7 @@ pub async fn get_order_by_id(configuration: &configuration::Configuration, param
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<GetOrderByIdSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetOrderByIdSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -225,7 +225,7 @@ pub async fn place_order(configuration: &configuration::Configuration, params: P
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<PlaceOrderSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<PlaceOrderSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ pub async fn create_user(configuration: &configuration::Configuration, params: C
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<CreateUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<CreateUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -248,7 +248,7 @@ pub async fn create_users_with_array_input(configuration: &configuration::Config
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<CreateUsersWithArrayInputSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<CreateUsersWithArrayInputSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -280,7 +280,7 @@ pub async fn create_users_with_list_input(configuration: &configuration::Configu
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<CreateUsersWithListInputSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<CreateUsersWithListInputSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -312,7 +312,7 @@ pub async fn delete_user(configuration: &configuration::Configuration, params: D
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<DeleteUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<DeleteUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -343,7 +343,7 @@ pub async fn get_user_by_name(configuration: &configuration::Configuration, para
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<GetUserByNameSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetUserByNameSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -377,7 +377,7 @@ pub async fn login_user(configuration: &configuration::Configuration, params: Lo
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<LoginUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<LoginUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -407,7 +407,7 @@ pub async fn logout_user(configuration: &configuration::Configuration) -> Result
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<LogoutUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<LogoutUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
@@ -441,7 +441,7 @@ pub async fn update_user(configuration: &configuration::Configuration, params: U
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text().await?;
|
let local_var_content = local_var_resp.text().await?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
let local_var_entity: Option<UpdateUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UpdateUserSuccess> = serde_json::from_str(&local_var_content).ok();
|
||||||
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
let local_var_result = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||||
Ok(local_var_result)
|
Ok(local_var_result)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use reqwest;
|
|
||||||
use serde_json;
|
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ pub fn add_pet(configuration: &configuration::Configuration, body: crate::models
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<AddPetError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<AddPetError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -135,7 +135,7 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<DeletePetError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<DeletePetError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -166,7 +166,7 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status:
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<FindPetsByStatusError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<FindPetsByStatusError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -197,7 +197,7 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<FindPetsByTagsError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<FindPetsByTagsError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -232,7 +232,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64)
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<GetPetByIdError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetPetByIdError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -262,7 +262,7 @@ pub fn update_pet(configuration: &configuration::Configuration, body: crate::mod
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<UpdatePetError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UpdatePetError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -299,7 +299,7 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<UpdatePetWithFormError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UpdatePetWithFormError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -336,7 +336,7 @@ pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, ad
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<UploadFileError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UploadFileError> = serde_json::from_str(&local_var_content).ok();
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ pub fn delete_order(configuration: &configuration::Configuration, order_id: &str
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<DeleteOrderError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<DeleteOrderError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -102,7 +102,7 @@ pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result<:
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<GetInventoryError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetInventoryError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -129,7 +129,7 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<GetOrderByIdError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetOrderByIdError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -156,7 +156,7 @@ pub fn place_order(configuration: &configuration::Configuration, body: crate::mo
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<PlaceOrderError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<PlaceOrderError> = serde_json::from_str(&local_var_content).ok();
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ pub fn create_user(configuration: &configuration::Configuration, body: crate::mo
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<CreateUserError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<CreateUserError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -129,7 +129,7 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<CreateUsersWithArrayInputError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<CreateUsersWithArrayInputError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -156,7 +156,7 @@ pub fn create_users_with_list_input(configuration: &configuration::Configuration
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<CreateUsersWithListInputError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<CreateUsersWithListInputError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -183,7 +183,7 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str)
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<DeleteUserError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<DeleteUserError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -209,7 +209,7 @@ pub fn get_user_by_name(configuration: &configuration::Configuration, username:
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<GetUserByNameError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<GetUserByNameError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -237,7 +237,7 @@ pub fn login_user(configuration: &configuration::Configuration, username: &str,
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<LoginUserError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<LoginUserError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -263,7 +263,7 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(),
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<LogoutUserError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<LogoutUserError> = serde_json::from_str(&local_var_content).ok();
|
||||||
@@ -291,7 +291,7 @@ pub fn update_user(configuration: &configuration::Configuration, username: &str,
|
|||||||
let local_var_status = local_var_resp.status();
|
let local_var_status = local_var_resp.status();
|
||||||
let local_var_content = local_var_resp.text()?;
|
let local_var_content = local_var_resp.text()?;
|
||||||
|
|
||||||
if local_var_status.is_success() {
|
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
let local_var_entity: Option<UpdateUserError> = serde_json::from_str(&local_var_content).ok();
|
let local_var_entity: Option<UpdateUserError> = serde_json::from_str(&local_var_content).ok();
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<project>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>TSAxiosPestoreTests</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<name>TS Axios Petstore Test Client</name>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>npm-install</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>npm</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>install</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
@@ -7,34 +7,7 @@
|
|||||||
"@openapitools/typescript-axios-petstore": {
|
"@openapitools/typescript-axios-petstore": {
|
||||||
"version": "file:../../builds/with-npm-version",
|
"version": "file:../../builds/with-npm-version",
|
||||||
"requires": {
|
"requires": {
|
||||||
"axios": "^0.19.2"
|
"axios": "^0.21.1"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"axios": {
|
|
||||||
"version": "0.19.2",
|
|
||||||
"bundled": true,
|
|
||||||
"requires": {
|
|
||||||
"follow-redirects": "1.5.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"bundled": true,
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"follow-redirects": {
|
|
||||||
"version": "1.5.10",
|
|
||||||
"bundled": true,
|
|
||||||
"requires": {
|
|
||||||
"debug": "=3.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"bundled": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/chai": {
|
"@types/chai": {
|
||||||
@@ -311,7 +284,7 @@
|
|||||||
},
|
},
|
||||||
"browserify-aes": {
|
"browserify-aes": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
||||||
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
|
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -543,7 +516,7 @@
|
|||||||
},
|
},
|
||||||
"convert-source-map": {
|
"convert-source-map": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
|
||||||
"integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=",
|
"integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
@@ -573,7 +546,7 @@
|
|||||||
},
|
},
|
||||||
"create-hash": {
|
"create-hash": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
|
||||||
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
|
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -586,7 +559,7 @@
|
|||||||
},
|
},
|
||||||
"create-hmac": {
|
"create-hmac": {
|
||||||
"version": "1.1.7",
|
"version": "1.1.7",
|
||||||
"resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
|
||||||
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
|
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -706,7 +679,7 @@
|
|||||||
},
|
},
|
||||||
"diffie-hellman": {
|
"diffie-hellman": {
|
||||||
"version": "5.0.3",
|
"version": "5.0.3",
|
||||||
"resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
|
||||||
"integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
|
"integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -1892,7 +1865,7 @@
|
|||||||
},
|
},
|
||||||
"sha.js": {
|
"sha.js": {
|
||||||
"version": "2.4.11",
|
"version": "2.4.11",
|
||||||
"resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
|
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
|
||||||
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
|
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2100,7 +2073,7 @@
|
|||||||
},
|
},
|
||||||
"through": {
|
"through": {
|
||||||
"version": "2.3.8",
|
"version": "2.3.8",
|
||||||
"resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||||
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
|
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"moduleResolution": "node",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export interface FindPetsByStatusRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface FindPetsByTagsRequest {
|
export interface FindPetsByTagsRequest {
|
||||||
tags: Array<string>;
|
tags: Set<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GetPetByIdRequest {
|
export interface GetPetByIdRequest {
|
||||||
@@ -203,7 +203,7 @@ export class PetApi extends runtime.BaseAPI {
|
|||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
* Finds Pets by tags
|
* Finds Pets by tags
|
||||||
*/
|
*/
|
||||||
async findPetsByTagsRaw(requestParameters: FindPetsByTagsRequest): Promise<runtime.ApiResponse<Array<Pet>>> {
|
async findPetsByTagsRaw(requestParameters: FindPetsByTagsRequest): Promise<runtime.ApiResponse<Set<Pet>>> {
|
||||||
if (requestParameters.tags === null || requestParameters.tags === undefined) {
|
if (requestParameters.tags === null || requestParameters.tags === undefined) {
|
||||||
throw new runtime.RequiredError('tags','Required parameter requestParameters.tags was null or undefined when calling findPetsByTags.');
|
throw new runtime.RequiredError('tags','Required parameter requestParameters.tags was null or undefined when calling findPetsByTags.');
|
||||||
}
|
}
|
||||||
@@ -239,7 +239,7 @@ export class PetApi extends runtime.BaseAPI {
|
|||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
* Finds Pets by tags
|
* Finds Pets by tags
|
||||||
*/
|
*/
|
||||||
async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise<Array<Pet>> {
|
async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise<Set<Pet>> {
|
||||||
const response = await this.findPetsByTagsRaw(requestParameters);
|
const response = await this.findPetsByTagsRaw(requestParameters);
|
||||||
return await response.value();
|
return await response.value();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ export interface Pet {
|
|||||||
name: string;
|
name: string;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {Array<string>}
|
* @type {Set<string>}
|
||||||
* @memberof Pet
|
* @memberof Pet
|
||||||
*/
|
*/
|
||||||
photoUrls: Array<string>;
|
photoUrls: Set<string>;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {Array<Tag>}
|
* @type {Array<Tag>}
|
||||||
|
|||||||
@@ -39,19 +39,6 @@
|
|||||||
</arguments>
|
</arguments>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
<execution>
|
|
||||||
<id>npm-test</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>npm</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>test</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
@@ -53,19 +53,6 @@
|
|||||||
</arguments>
|
</arguments>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
<execution>
|
|
||||||
<id>npm-test</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>npm</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>test</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export class PetService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -77,14 +77,13 @@ export class PetService {
|
|||||||
|
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
'application/json'
|
'application/json',
|
||||||
'application/xml'
|
'application/xml'
|
||||||
];
|
];
|
||||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||||
if (httpContentTypeSelected != undefined) {
|
if (httpContentTypeSelected != undefined) {
|
||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<Pet>(`${this.basePath}/pet`,
|
return this.httpClient.post<Pet>(`${this.basePath}/pet`,
|
||||||
pet,
|
pet,
|
||||||
{
|
{
|
||||||
@@ -111,7 +110,7 @@ export class PetService {
|
|||||||
|
|
||||||
let headers = this.defaultHeaders;
|
let headers = this.defaultHeaders;
|
||||||
if (apiKey !== undefined && apiKey !== null) {
|
if (apiKey !== undefined && apiKey !== null) {
|
||||||
headers['api_key'] String(apiKey);
|
headers['api_key'] = String(apiKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@@ -133,7 +132,6 @@ export class PetService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.delete<any>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.delete<any>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -172,7 +170,7 @@ export class PetService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -183,7 +181,6 @@ export class PetService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<Array<Pet>>(`${this.basePath}/pet/findByStatus`,
|
return this.httpClient.get<Array<Pet>>(`${this.basePath}/pet/findByStatus`,
|
||||||
{
|
{
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
@@ -223,7 +220,7 @@ export class PetService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -234,7 +231,6 @@ export class PetService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<Array<Pet>>(`${this.basePath}/pet/findByTags`,
|
return this.httpClient.get<Array<Pet>>(`${this.basePath}/pet/findByTags`,
|
||||||
{
|
{
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
@@ -266,7 +262,7 @@ export class PetService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -277,7 +273,6 @@ export class PetService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<Pet>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
return this.httpClient.get<Pet>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -311,7 +306,7 @@ export class PetService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -321,14 +316,13 @@ export class PetService {
|
|||||||
|
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
'application/json'
|
'application/json',
|
||||||
'application/xml'
|
'application/xml'
|
||||||
];
|
];
|
||||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||||
if (httpContentTypeSelected != undefined) {
|
if (httpContentTypeSelected != undefined) {
|
||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.put<Pet>(`${this.basePath}/pet`,
|
return this.httpClient.put<Pet>(`${this.basePath}/pet`,
|
||||||
pet,
|
pet,
|
||||||
{
|
{
|
||||||
@@ -392,6 +386,7 @@ export class PetService {
|
|||||||
if (name !== undefined) {
|
if (name !== undefined) {
|
||||||
formParams.append('name', <any>name);
|
formParams.append('name', <any>name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
formParams.append('status', <any>status);
|
formParams.append('status', <any>status);
|
||||||
}
|
}
|
||||||
@@ -451,6 +446,7 @@ export class PetService {
|
|||||||
let formParams: { append(param: string, value: any): void; };
|
let formParams: { append(param: string, value: any): void; };
|
||||||
let useForm = false;
|
let useForm = false;
|
||||||
let convertFormParamsToString = false;
|
let convertFormParamsToString = false;
|
||||||
|
|
||||||
// use FormData to transmit files using content-type "multipart/form-data"
|
// use FormData to transmit files using content-type "multipart/form-data"
|
||||||
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
|
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
|
||||||
useForm = canConsumeForm;
|
useForm = canConsumeForm;
|
||||||
@@ -463,6 +459,7 @@ export class PetService {
|
|||||||
if (additionalMetadata !== undefined) {
|
if (additionalMetadata !== undefined) {
|
||||||
formParams.append('additionalMetadata', <any>additionalMetadata);
|
formParams.append('additionalMetadata', <any>additionalMetadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file !== undefined) {
|
if (file !== undefined) {
|
||||||
formParams.append('file', <any>file);
|
formParams.append('file', <any>file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ export class StoreService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.delete<any>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
return this.httpClient.delete<any>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -103,7 +102,6 @@ export class StoreService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`,
|
return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -129,7 +127,7 @@ export class StoreService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -140,7 +138,6 @@ export class StoreService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<Order>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
return this.httpClient.get<Order>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -166,7 +163,7 @@ export class StoreService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -182,7 +179,6 @@ export class StoreService {
|
|||||||
if (httpContentTypeSelected != undefined) {
|
if (httpContentTypeSelected != undefined) {
|
||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<Order>(`${this.basePath}/store/order`,
|
return this.httpClient.post<Order>(`${this.basePath}/store/order`,
|
||||||
order,
|
order,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ export class UserService {
|
|||||||
if (httpContentTypeSelected != undefined) {
|
if (httpContentTypeSelected != undefined) {
|
||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.basePath}/user`,
|
return this.httpClient.post<any>(`${this.basePath}/user`,
|
||||||
user,
|
user,
|
||||||
{
|
{
|
||||||
@@ -123,7 +122,6 @@ export class UserService {
|
|||||||
if (httpContentTypeSelected != undefined) {
|
if (httpContentTypeSelected != undefined) {
|
||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.basePath}/user/createWithArray`,
|
return this.httpClient.post<any>(`${this.basePath}/user/createWithArray`,
|
||||||
user,
|
user,
|
||||||
{
|
{
|
||||||
@@ -169,7 +167,6 @@ export class UserService {
|
|||||||
if (httpContentTypeSelected != undefined) {
|
if (httpContentTypeSelected != undefined) {
|
||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.post<any>(`${this.basePath}/user/createWithList`,
|
return this.httpClient.post<any>(`${this.basePath}/user/createWithList`,
|
||||||
user,
|
user,
|
||||||
{
|
{
|
||||||
@@ -210,7 +207,6 @@ export class UserService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.delete<any>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
return this.httpClient.delete<any>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -236,7 +232,7 @@ export class UserService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -247,7 +243,6 @@ export class UserService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<User>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
return this.httpClient.get<User>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -286,7 +281,7 @@ export class UserService {
|
|||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
let httpHeaderAccepts: string[] = [
|
let httpHeaderAccepts: string[] = [
|
||||||
'application/xml'
|
'application/xml',
|
||||||
'application/json'
|
'application/json'
|
||||||
];
|
];
|
||||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||||
@@ -297,7 +292,6 @@ export class UserService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<string>(`${this.basePath}/user/login`,
|
return this.httpClient.get<string>(`${this.basePath}/user/login`,
|
||||||
{
|
{
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
@@ -333,7 +327,6 @@ export class UserService {
|
|||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.httpClient.get<any>(`${this.basePath}/user/logout`,
|
return this.httpClient.get<any>(`${this.basePath}/user/logout`,
|
||||||
{
|
{
|
||||||
withCredentials: this.configuration.withCredentials,
|
withCredentials: this.configuration.withCredentials,
|
||||||
@@ -383,7 +376,6 @@ export class UserService {
|
|||||||
if (httpContentTypeSelected != undefined) {
|
if (httpContentTypeSelected != undefined) {
|
||||||
headers['Content-Type'] = httpContentTypeSelected;
|
headers['Content-Type'] = httpContentTypeSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.httpClient.put<any>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
return this.httpClient.put<any>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||||
user,
|
user,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -121,7 +121,13 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<<<<<<< HEAD
|
||||||
<openapi-generator-version>5.1.0-SNAPSHOT</openapi-generator-version>
|
<openapi-generator-version>5.1.0-SNAPSHOT</openapi-generator-version>
|
||||||
|
=======
|
||||||
|
<!-- RELEASE_VERSION -->
|
||||||
|
<openapi-generator-version>5.0.1</openapi-generator-version>
|
||||||
|
<!-- /RELEASE_VERSION -->
|
||||||
|
>>>>>>> origin/master
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ conf = x_auth_id_alias.Configuration(
|
|||||||
|
|
||||||
def __init__(self, host=None,
|
def __init__(self, host=None,
|
||||||
api_key=None, api_key_prefix=None,
|
api_key=None, api_key_prefix=None,
|
||||||
|
access_token=None,
|
||||||
username=None, password=None,
|
username=None, password=None,
|
||||||
discard_unknown_keys=False,
|
discard_unknown_keys=False,
|
||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
@@ -126,6 +127,7 @@ conf = x_auth_id_alias.Configuration(
|
|||||||
"""Temp file folder for downloading files
|
"""Temp file folder for downloading files
|
||||||
"""
|
"""
|
||||||
# Authentication Settings
|
# Authentication Settings
|
||||||
|
self.access_token = access_token
|
||||||
self.api_key = {}
|
self.api_key = {}
|
||||||
if api_key:
|
if api_key:
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user