Merge branch 'master' into docusaurus

* master: (26 commits)
  Delete unused method (#1744)
  Use JsonNullable wrapper on nullable/x-nullable fields (#1762)
  Add an option to use reflection in equals, hashCode (Java client) (#1767)
  [Slim] Encode path to support non-latin characters (#1687)
  [elm] Add support for sending headers (#1704)
  Add test case for InlineModelResolver: inline array response (#1778)
  fix group parameter logic (#1779)
  Add test case for InlineModelResolver: inline array request body (#1777)
  Add test case for InlineModelResolver: inline array schema (#1772)
  Fix type inference error (#1773)
  skip default value for contaier in spring (#1725)
  [Slim] Add PHP CodeSniffer config template (#1764)
  Use CompareNetObject for object comparison in C# client (refactor) (#1765)
  Add test case for InlineModelResolver (#1771)
  Add online gen tests (#1759)
  Resolve inline models before preprocess (#1761)
  better handling of allOf (composition) (#1757)
  Fix UUID support (#1746)
  Use appInfo.version for podspec (#1760)
  [Swift 4] Add `createURLRequest` method (#1727)
  ...
This commit is contained in:
Jim Schubert 2018-12-30 21:33:14 -05:00
commit 1978db5ab7
1981 changed files with 49422 additions and 4077 deletions

View File

@ -0,0 +1,70 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import org.apache.commons.lang3.builder.EqualsBuilder;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for ArrayOfArrayOfNumberOnly
*/
public class ArrayOfArrayOfNumberOnlyTest {
private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly();
/**
* Model tests for ArrayOfArrayOfNumberOnly
*/
@Test
public void test() {
// TODO: test ArrayOfArrayOfNumberOnly
}
/**
* Test the property 'arrayArrayNumber'
*/
@Test
public void arrayArrayNumberTest() {
BigDecimal b1 = new BigDecimal("12.3");
BigDecimal b2 = new BigDecimal("5.6");
List<BigDecimal> arrayArrayNumber = new ArrayList<BigDecimal>();
arrayArrayNumber.add(b1);
arrayArrayNumber.add(b2);
model.getArrayArrayNumber().add(arrayArrayNumber);
// create another instance for comparison
BigDecimal b3 = new BigDecimal("12.3");
BigDecimal b4 = new BigDecimal("5.6");
ArrayOfArrayOfNumberOnly model2 = new ArrayOfArrayOfNumberOnly();
List<BigDecimal> arrayArrayNumber2 = new ArrayList<BigDecimal>();
arrayArrayNumber2.add(b1);
arrayArrayNumber2.add(b2);
model2.getArrayArrayNumber().add(arrayArrayNumber2);
Assert.assertTrue(model2.equals(model));
}
}

View File

@ -0,0 +1,103 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.Category;
import org.openapitools.client.model.Tag;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for Pet
*/
public class PetTest {
private final Pet model = new Pet();
/**
* Model tests for Pet
*/
@Test
public void testPet() {
// test Pet
model.setId(1029L);
model.setName("Dog");
Pet model2 = new Pet();
model2.setId(1029L);
model2.setName("Dog");
Assert.assertTrue(model.equals(model2));
}
/**
* Test the property 'id'
*/
@Test
public void idTest() {
// TODO: test id
}
/**
* Test the property 'category'
*/
@Test
public void categoryTest() {
// TODO: test category
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
/**
* Test the property 'photoUrls'
*/
@Test
public void photoUrlsTest() {
// TODO: test photoUrls
}
/**
* Test the property 'tags'
*/
@Test
public void tagsTest() {
// TODO: test tags
}
/**
* Test the property 'status'
*/
@Test
public void statusTest() {
// TODO: test status
}
}

View File

@ -27,7 +27,7 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/csharp-refactor/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-refactor -o samples/client/petstore/csharp-refactor/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} $@"
ags="generate -t modules/openapi-generator/src/main/resources/csharp-refactor/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-refactor -o samples/client/petstore/csharp-refactor/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -44,4 +44,6 @@ cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java
cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java
cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java
cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java
cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/PetTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java
cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnly.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java
cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java

View File

@ -5,122 +5,122 @@ title: Generators List
The following generators are available:
## CLIENT generators
* [ada](generators/ada)
* [android](generators/android)
* [apex](generators/apex)
* [bash](generators/bash)
* [c](generators/c)
* [clojure](generators/clojure)
* [cpp-qt5-client](generators/cpp-qt5-client)
* [cpp-restsdk](generators/cpp-restsdk)
* [cpp-tizen](generators/cpp-tizen)
* [csharp](generators/csharp)
* [csharp-dotnet2](generators/csharp-dotnet2)
* [csharp-refactor](generators/csharp-refactor)
* [dart](generators/dart)
* [dart-jaguar](generators/dart-jaguar)
* [eiffel](generators/eiffel)
* [elixir](generators/elixir)
* [elm](generators/elm)
* [erlang-client](generators/erlang-client)
* [erlang-proper](generators/erlang-proper)
* [flash](generators/flash)
* [go](generators/go)
* [groovy](generators/groovy)
* [haskell-http-client](generators/haskell-http-client)
* [java](generators/java)
* [javascript](generators/javascript)
* [javascript-closure-angular](generators/javascript-closure-angular)
* [javascript-flowtyped](generators/javascript-flowtyped)
* [jaxrs-cxf-client](generators/jaxrs-cxf-client)
* [jmeter](generators/jmeter)
* [kotlin](generators/kotlin)
* [lua](generators/lua)
* [objc](generators/objc)
* [perl](generators/perl)
* [php](generators/php)
* [powershell](generators/powershell)
* [python](generators/python)
* [r](generators/r)
* [ruby](generators/ruby)
* [rust](generators/rust)
* [scala-akka](generators/scala-akka)
* [scala-gatling](generators/scala-gatling)
* [scala-httpclient](generators/scala-httpclient)
* [scalaz](generators/scalaz)
* [swift2-deprecated](generators/swift2-deprecated)
* [swift3-deprecated](generators/swift3-deprecated)
* [swift4](generators/swift4)
* [typescript-angular](generators/typescript-angular)
* [typescript-angularjs](generators/typescript-angularjs)
* [typescript-aurelia](generators/typescript-aurelia)
* [typescript-axios](generators/typescript-axios)
* [typescript-fetch](generators/typescript-fetch)
* [typescript-inversify](generators/typescript-inversify)
* [typescript-jquery](generators/typescript-jquery)
* [typescript-node](generators/typescript-node)
* CLIENT generators:
- [ada](generators/ada.md)
- [android](generators/android.md)
- [apex](generators/apex.md)
- [bash](generators/bash.md)
- [c](generators/c.md)
- [clojure](generators/clojure.md)
- [cpp-qt5-client](generators/cpp-qt5-client.md)
- [cpp-restsdk](generators/cpp-restsdk.md)
- [cpp-tizen](generators/cpp-tizen.md)
- [csharp](generators/csharp.md)
- [csharp-dotnet2](generators/csharp-dotnet2.md)
- [csharp-refactor](generators/csharp-refactor.md)
- [dart](generators/dart.md)
- [dart-jaguar](generators/dart-jaguar.md)
- [eiffel](generators/eiffel.md)
- [elixir](generators/elixir.md)
- [elm](generators/elm.md)
- [erlang-client](generators/erlang-client.md)
- [erlang-proper](generators/erlang-proper.md)
- [flash](generators/flash.md)
- [go](generators/go.md)
- [groovy](generators/groovy.md)
- [haskell-http-client](generators/haskell-http-client.md)
- [java](generators/java.md)
- [javascript](generators/javascript.md)
- [javascript-closure-angular](generators/javascript-closure-angular.md)
- [javascript-flowtyped](generators/javascript-flowtyped.md)
- [jaxrs-cxf-client](generators/jaxrs-cxf-client.md)
- [jmeter](generators/jmeter.md)
- [kotlin](generators/kotlin.md)
- [lua](generators/lua.md)
- [objc](generators/objc.md)
- [perl](generators/perl.md)
- [php](generators/php.md)
- [powershell](generators/powershell.md)
- [python](generators/python.md)
- [r](generators/r.md)
- [ruby](generators/ruby.md)
- [rust](generators/rust.md)
- [scala-akka](generators/scala-akka.md)
- [scala-gatling](generators/scala-gatling.md)
- [scala-httpclient](generators/scala-httpclient.md)
- [scalaz](generators/scalaz.md)
- [swift2-deprecated](generators/swift2-deprecated.md)
- [swift3-deprecated](generators/swift3-deprecated.md)
- [swift4](generators/swift4.md)
- [typescript-angular](generators/typescript-angular.md)
- [typescript-angularjs](generators/typescript-angularjs.md)
- [typescript-aurelia](generators/typescript-aurelia.md)
- [typescript-axios](generators/typescript-axios.md)
- [typescript-fetch](generators/typescript-fetch.md)
- [typescript-inversify](generators/typescript-inversify.md)
- [typescript-jquery](generators/typescript-jquery.md)
- [typescript-node](generators/typescript-node.md)
## SERVER generators
* [ada-server](generators/ada-server)
* [aspnetcore](generators/aspnetcore)
* [cpp-pistache-server](generators/cpp-pistache-server)
* [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server)
* [cpp-restbed-server](generators/cpp-restbed-server)
* [csharp-nancyfx](generators/csharp-nancyfx)
* [erlang-server](generators/erlang-server)
* [go-gin-server](generators/go-gin-server)
* [go-server](generators/go-server)
* [graphql-server](generators/graphql-server)
* [haskell](generators/haskell)
* [java-inflector](generators/java-inflector)
* [java-msf4j](generators/java-msf4j)
* [java-pkmst](generators/java-pkmst)
* [java-play-framework](generators/java-play-framework)
* [java-undertow-server](generators/java-undertow-server)
* [java-vertx](generators/java-vertx)
* [jaxrs-cxf](generators/jaxrs-cxf)
* [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi)
* [jaxrs-jersey](generators/jaxrs-jersey)
* [jaxrs-resteasy](generators/jaxrs-resteasy)
* [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap)
* [jaxrs-spec](generators/jaxrs-spec)
* [kotlin-server](generators/kotlin-server)
* [kotlin-spring](generators/kotlin-spring)
* [nodejs-server](generators/nodejs-server)
* [php-laravel](generators/php-laravel)
* [php-lumen](generators/php-lumen)
* [php-silex](generators/php-silex)
* [php-slim](generators/php-slim)
* [php-symfony](generators/php-symfony)
* [php-ze-ph](generators/php-ze-ph)
* [python-flask](generators/python-flask)
* [ruby-on-rails](generators/ruby-on-rails)
* [ruby-sinatra](generators/ruby-sinatra)
* [rust-server](generators/rust-server)
* [scala-finch](generators/scala-finch)
* [scala-lagom-server](generators/scala-lagom-server)
* [scalatra](generators/scalatra)
* [spring](generators/spring)
* SERVER generators:
- [ada-server](generators/ada-server.md)
- [aspnetcore](generators/aspnetcore.md)
- [cpp-pistache-server](generators/cpp-pistache-server.md)
- [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server.md)
- [cpp-restbed-server](generators/cpp-restbed-server.md)
- [csharp-nancyfx](generators/csharp-nancyfx.md)
- [erlang-server](generators/erlang-server.md)
- [go-gin-server](generators/go-gin-server.md)
- [go-server](generators/go-server.md)
- [graphql-server](generators/graphql-server.md)
- [haskell](generators/haskell.md)
- [java-inflector](generators/java-inflector.md)
- [java-msf4j](generators/java-msf4j.md)
- [java-pkmst](generators/java-pkmst.md)
- [java-play-framework](generators/java-play-framework.md)
- [java-undertow-server](generators/java-undertow-server.md)
- [java-vertx](generators/java-vertx.md)
- [jaxrs-cxf](generators/jaxrs-cxf.md)
- [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi.md)
- [jaxrs-jersey](generators/jaxrs-jersey.md)
- [jaxrs-resteasy](generators/jaxrs-resteasy.md)
- [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap.md)
- [jaxrs-spec](generators/jaxrs-spec.md)
- [kotlin-server](generators/kotlin-server.md)
- [kotlin-spring](generators/kotlin-spring.md)
- [nodejs-server](generators/nodejs-server.md)
- [php-laravel](generators/php-laravel.md)
- [php-lumen](generators/php-lumen.md)
- [php-silex](generators/php-silex.md)
- [php-slim](generators/php-slim.md)
- [php-symfony](generators/php-symfony.md)
- [php-ze-ph](generators/php-ze-ph.md)
- [python-flask](generators/python-flask.md)
- [ruby-on-rails](generators/ruby-on-rails.md)
- [ruby-sinatra](generators/ruby-sinatra.md)
- [rust-server](generators/rust-server.md)
- [scala-finch](generators/scala-finch.md)
- [scala-lagom-server](generators/scala-lagom-server.md)
- [scalatra](generators/scalatra.md)
- [spring](generators/spring.md)
## DOCUMENTATION generators
* [cwiki](generators/cwiki)
* [dynamic-html](generators/dynamic-html)
* [html](generators/html)
* [html2](generators/html2)
* [openapi](generators/openapi)
* [openapi-yaml](generators/openapi-yaml)
* DOCUMENTATION generators:
- [cwiki](generators/cwiki.md)
- [dynamic-html](generators/dynamic-html.md)
- [html](generators/html.md)
- [html2](generators/html2.md)
- [openapi](generators/openapi.md)
- [openapi-yaml](generators/openapi-yaml.md)
## SCHEMA generators
* [mysql-schema](generators/mysql-schema)
* SCHEMA generators:
- [mysql-schema](generators/mysql-schema.md)
## CONFIG generators
* [apache2](generators/apache2)
* [graphql-schema](generators/graphql-schema)
* CONFIG generators:
- [apache2](generators/apache2.md)
- [graphql-schema](generators/graphql-schema.md)

View File

@ -28,3 +28,4 @@ sidebar_label: csharp
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|validatable|Generates self-validatable models.| |true|
|useCompareNetObjects|Use KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact.| |false|

View File

@ -53,4 +53,5 @@ sidebar_label: java
|useGzipFeature|Send gzip-encoded requests| |false|
|useRuntimeException|Use RuntimeException instead of Exception| |false|
|feignVersion|Version of OpenFeign: '10.x', '9.x' (default)| |false|
|useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.4. JSON processing: Jackson 2.8.9. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.8.9. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.8.9</dd><dt>**okhttp-gson**</dt><dd>HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit**</dt><dd>HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.8.0. JSON processing: Gson 2.6.1 (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.3.9-RELEASE. JSON processing: Jackson 2.8.9</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.0.7-RELEASE. JSON processing: Jackson 2.9.5</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.1.3.Final. JSON processing: Jackson 2.8.9</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.2.4. JSON processing: Jackson 2.8.9</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.23.0. JSON processing: Jackson 2.8.9</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 3.1.0. JSON processing: Gson 2.6.1. Only for Java8</dd><dl>|okhttp-gson|

View File

@ -20,4 +20,3 @@ sidebar_label: php-slim
|gitUserId|Git user ID, e.g. openapitools.| |null|
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
|phpcsStandard|PHP CodeSniffer &lt;standard&gt; option. Accepts name or path of the coding standard to use.| |PSR12|

View File

@ -23,7 +23,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.2.5</version>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@ -34,12 +34,12 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.2.5</version>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.2.5</version>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>

View File

@ -0,0 +1,129 @@
package org.openapitools.codegen.online.api;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openapitools.codegen.online.model.ResponseCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.text.MatchesPattern.matchesPattern;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
@RunWith(SpringRunner.class)
@WebMvcTest(GenApiController.class)
public class GenApiControllerTest {
private static final String OPENAPI_URL = "http://petstore.swagger.io/v2/swagger.json";
private static final String UUID_REGEX = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}";
@Autowired
private MockMvc mockMvc;
@Test
public void clientLanguages() throws Exception {
getLanguages("clients", "java");
}
@Test
public void serverFrameworks() throws Exception {
getLanguages("servers", "spring");
}
public void getLanguages(String type, String expected) throws Exception {
mockMvc.perform(get("/api/gen/" + type))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$.[*]").value(hasItem(expected)));
}
@Test
public void clientOptions() throws Exception {
getOptions("clients", "java");
}
@Test
public void clientOptionsUnknown() throws Exception {
mockMvc.perform(get("/api/gen/clients/unknown"))
.andExpect(status().isNotFound());
}
@Test
public void serverOptions() throws Exception {
getOptions("servers", "spring");
}
@Test
public void serverOptionsUnknown() throws Exception {
mockMvc.perform(get("/api/gen/servers/unknown"))
.andExpect(status().isNotFound());
}
private void getOptions(String type, String name) throws Exception {
mockMvc.perform(get("/api/gen/" + type + "/" + name))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$.sortParamsByRequiredFlag.opt").value("sortParamsByRequiredFlag"));
}
@Test
public void generateClient() throws Exception {
generateAndDownload("clients", "java");
}
@Test
public void generateServer() throws Exception {
generateAndDownload("servers", "spring");
}
private void generateAndDownload(String type, String name) throws Exception {
String result = mockMvc.perform(post("http://test.com:1234/api/gen/" + type + "/" + name)
.contentType(MediaType.APPLICATION_JSON_UTF8)
.content("{\"openAPIUrl\": \"" + OPENAPI_URL + "\"}"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$.code").value(matchesPattern(UUID_REGEX)))
.andExpect(jsonPath("$.link").value(matchesPattern("http\\:\\/\\/test.com\\:1234\\/api\\/gen\\/download\\/" + UUID_REGEX)))
.andReturn().getResponse().getContentAsString();
String code = new ObjectMapper().readValue(result, ResponseCode.class).getCode();
mockMvc.perform(get("http://test.com:1234/api/gen/download/" + code))
.andExpect(content().contentType("application/zip"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.CONTENT_LENGTH, not(0)));
}
@Test
public void generateWIthForwardedHeaders() throws Exception {
String result = mockMvc.perform(post("http://test.com:1234/api/gen/clients/java")
.contentType(MediaType.APPLICATION_JSON_UTF8)
.header("X-Forwarded-Proto", "https")
.header("X-Forwarded-Host", "forwarded.com")
.header("X-Forwarded-Port", "5678")
.content("{\"openAPIUrl\": \"" + OPENAPI_URL + "\"}"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$.code").value(matchesPattern(UUID_REGEX)))
.andExpect(jsonPath("$.link").value(matchesPattern("https\\:\\/\\/forwarded.com\\:5678\\/api\\/gen\\/download\\/" + UUID_REGEX)))
.andReturn().getResponse().getContentAsString();
String code = new ObjectMapper().readValue(result, ResponseCode.class).getCode();
mockMvc.perform(get("http://test.com:1234/api/gen/download/" + code))
.andExpect(content().contentType("application/zip"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.CONTENT_LENGTH, not(0)));
}
}

View File

@ -81,6 +81,8 @@ public interface CodegenConfig {
String escapeTextWhileAllowingNewLines(String text);
String encodePath(String text);
String escapeUnsafeCharacters(String input);
String escapeReservedWord(String name);

View File

@ -283,4 +283,7 @@ public class CodegenConstants {
public static final String ENABLE_POST_PROCESS_FILE_DESC = "Enable post-processing file using environment variables.";
public static final String OPEN_API_SPEC_NAME = "openAPISpecName";
public static final String USE_COMPARE_NET_OBJECTS = "useCompareNetObjects";
public static final String USE_COMPARE_NET_OBJECTS_DESC = "Use KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact.";
}

View File

@ -616,4 +616,18 @@ public class CodegenModel {
}
}
}
/**
* Remove self reference import
*/
public void removeSelfReferenceImport() {
for (CodegenProperty cp : allVars) {
// detect self import
if (cp.dataType.equalsIgnoreCase(this.classname) ||
(cp.isContainer && cp.items.dataType.equalsIgnoreCase(this.classname))) {
this.imports.remove(this.classname); // remove self import
cp.isSelfReference = true;
}
}
}
}

View File

@ -18,36 +18,12 @@
package org.openapitools.codegen;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
public final class CodegenModelFactory {
private static final Map<CodegenModelType, Class<?>> typeMapping = new HashMap<CodegenModelType, Class<?>>();
/**
* Configure a different implementation class.
*
* @param type the type that shall be replaced
* @param implementation the implementation class must extend the default class and must provide a public no-arg constructor
*/
public static void setTypeMapping(CodegenModelType type, Class<?> implementation) {
if (!type.getDefaultImplementation().isAssignableFrom(implementation)) {
throw new IllegalArgumentException(implementation.getSimpleName() + " doesn't extend " + type.getDefaultImplementation().getSimpleName());
}
try {
implementation.getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
typeMapping.put(type, implementation);
}
@SuppressWarnings("unchecked")
public static <T> T newInstance(CodegenModelType type) {
Class<?> classType = typeMapping.get(type);
try {
return (T) (classType != null ? classType : type.getDefaultImplementation()).getDeclaredConstructor().newInstance();
return (T) type.getDefaultImplementation().getDeclaredConstructor().newInstance();
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
throw new RuntimeException(e);
}

View File

@ -280,8 +280,8 @@ public class DefaultCodegen implements CodegenConfig {
CodegenModel cm = (CodegenModel) mo.get("model");
for (CodegenProperty cp : cm.allVars) {
// detect self import
if (cp.dataType.equals(cm.classname) ||
(cp.isContainer && cp.items.dataType.equals(cm.classname))) {
if (cp.dataType.equalsIgnoreCase(cm.classname) ||
(cp.isContainer && cp.items.dataType.equalsIgnoreCase(cm.classname))) {
cm.imports.remove(cm.classname); // remove self import
cp.isSelfReference = true;
}
@ -557,6 +557,12 @@ public class DefaultCodegen implements CodegenConfig {
.replace("\"", "\\\""));
}
// override with any special encoding and escaping logic
@SuppressWarnings("static-method")
public String encodePath(String input) {
return escapeText(input);
}
/**
* override with any special text escaping logic to handle unsafe
* characters so as to avoid code injection
@ -1371,64 +1377,53 @@ public class DefaultCodegen implements CodegenConfig {
ComposedSchema cs = (ComposedSchema) schema;
List<Schema> schemas = ModelUtils.getInterfaces(cs);
if (cs.getAllOf() != null) {
for (Schema s : cs.getAllOf()) {
if (s != null) {
//schema = s;
}
//LOGGER.info("ALL OF SCHEMA: {}", s);
List<String> names = new ArrayList<>();
for (Schema s : schemas) {
names.add(getSingleSchemaType(s));
}
LOGGER.info("Composed schema not yet supported: {}", cs);
// get the model (allOf)
return getAlias("UNKNOWN_COMPOSED_SCHMEA");
} else if (cs.getAnyOf() != null) { // anyOf
List<String> names = new ArrayList<String>();
for (Schema s : schemas) {
if (StringUtils.isNotBlank(s.get$ref())) { // reference to another definition/schema
String schemaName = ModelUtils.getSimpleRef(s.get$ref());
if (StringUtils.isNotEmpty(schemaName)) {
names.add(getAlias(schemaName));
if (names.size() == 0) {
LOGGER.error("allOf has no member defined: {}. Default to ERROR_ALLOF_SCHEMA", cs);
return "ERROR_ALLOF_SCHEMA";
} else if (names.size() == 1) {
return names.get(0);
} else {
LOGGER.warn("Error obtaining the datatype from ref:" + schema.get$ref() + ". Default to 'object'");
return "object";
LOGGER.warn("allOf with multiple schemas defined. Using only the first one: {}. To fully utilize allOf, please use $ref instead of inline schema definition", names.get(0));
return names.get(0);
}
} else {
// primitive type or model
names.add(getAlias(getPrimitiveType(s)));
} else if (cs.getAnyOf() != null) { // anyOf
List<String> names = new ArrayList<>();
for (Schema s : schemas) {
names.add(getSingleSchemaType(s));
}
return "anyOf<" + String.join(",", names) + ">";
}
} else if (cs.getOneOf() != null) { // oneOf
List<String> names = new ArrayList<String>();
List<String> names = new ArrayList<>();
for (Schema s : schemas) {
if (StringUtils.isNotBlank(s.get$ref())) { // reference to another definition/schema
String schemaName = ModelUtils.getSimpleRef(s.get$ref());
if (StringUtils.isNotEmpty(schemaName)) {
names.add(getAlias(schemaName));
} else {
LOGGER.warn("Error obtaining the datatype from ref:" + schema.get$ref() + ". Default to 'object'");
return "object";
}
} else {
// primitive type or model
names.add(getAlias(getPrimitiveType(s)));
}
names.add(getSingleSchemaType(s));
}
return "oneOf<" + String.join(",", names) + ">";
}
}
if (StringUtils.isNotBlank(schema.get$ref())) { // reference to another definition/schema
return getSingleSchemaType(schema);
}
private String getSingleSchemaType(Schema schema) {
Schema unaliasSchema = ModelUtils.unaliasSchema(globalSchemas, schema);
if (StringUtils.isNotBlank(unaliasSchema.get$ref())) { // reference to another definition/schema
// get the schema/model name from $ref
String schemaName = ModelUtils.getSimpleRef(schema.get$ref());
String schemaName = ModelUtils.getSimpleRef(unaliasSchema.get$ref());
if (StringUtils.isNotEmpty(schemaName)) {
return getAlias(schemaName);
} else {
LOGGER.warn("Error obtaining the datatype from ref:" + schema.get$ref() + ". Default to 'object'");
LOGGER.warn("Error obtaining the datatype from ref:" + unaliasSchema.get$ref() + ". Default to 'object'");
return "object";
}
} else { // primitive type or model
return getAlias(getPrimitiveType(schema));
return getAlias(getPrimitiveType(unaliasSchema));
}
}
@ -2115,6 +2110,8 @@ public class DefaultCodegen implements CodegenConfig {
allowableValues.put("values", _enum);
property.allowableValues = allowableValues;
}
} else if (ModelUtils.isFreeFormObject(p)){
property.isFreeFormObject = true;
}
property.dataType = getTypeDeclaration(p);
@ -2918,7 +2915,7 @@ public class DefaultCodegen implements CodegenConfig {
}
if (parameter.getSchema() != null) {
Schema parameterSchema = parameter.getSchema();
Schema parameterSchema = ModelUtils.unaliasSchema(globalSchemas, parameter.getSchema());
if (parameterSchema == null) {
LOGGER.warn("warning! Schema not found for parameter \"" + parameter.getName() + "\", using String");
parameterSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to missing type definition.");
@ -2992,7 +2989,6 @@ public class DefaultCodegen implements CodegenConfig {
// set boolean flag (e.g. isString)
setParameterBooleanFlagWithCodegenProperty(codegenParameter, codegenProperty);
String parameterDataType = this.getParameterDataType(parameter, parameterSchema);
if (parameterDataType != null) {
codegenParameter.dataType = parameterDataType;
@ -4635,6 +4631,25 @@ public class DefaultCodegen implements CodegenConfig {
codegenProperty = codegenProperty.items;
}
} else if (ModelUtils.isFreeFormObject(schema)) {
// HTTP request body is free form object
CodegenProperty codegenProperty = fromProperty("FREE_FORM_REQUEST_BODY", schema);
if (codegenProperty != null) {
if (StringUtils.isEmpty(bodyParameterName)) {
codegenParameter.baseName = "body"; // default to body
} else {
codegenParameter.baseName = bodyParameterName;
}
codegenParameter.isPrimitiveType = true;
codegenParameter.baseType = codegenProperty.baseType;
codegenParameter.dataType = codegenProperty.dataType;
codegenParameter.description = codegenProperty.description;
codegenParameter.paramName = toParamName(codegenParameter.baseName);
}
setParameterBooleanFlagWithCodegenProperty(codegenParameter, codegenProperty);
// set nullable
setParameterNullable(codegenParameter, codegenProperty);
} else if (ModelUtils.isObjectSchema(schema) || ModelUtils.isComposedSchema(schema)) {
CodegenModel codegenModel = null;
if (StringUtils.isNotBlank(name)) {

View File

@ -430,17 +430,16 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
Schema schema = schemas.get(name);
// check to see if it's a "map" model
if (ModelUtils.isMapSchema(schema)) {
if (ModelUtils.isFreeFormObject(schema)) { // check to see if it'a a free-form object
LOGGER.info("Model " + name + " not generated since it's a free-form object");
continue;
} else if (ModelUtils.isMapSchema(schema)) { // check to see if it's a "map" model
if (schema.getProperties() == null || schema.getProperties().isEmpty()) {
// schema without property, i.e. alias to map
LOGGER.info("Model " + name + " not generated since it's an alias to map (without property)");
continue;
}
}
// check to see if it's an "array" model
if (ModelUtils.isArraySchema(schema)) {
} else if (ModelUtils.isArraySchema(schema)) { // check to see if it's an "array" model
if (schema.getProperties() == null || schema.getProperties().isEmpty()) {
// schema without property, i.e. alias to array
LOGGER.info("Model " + name + " not generated since it's an alias to array (without property)");
@ -475,6 +474,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
continue;
}
// TODO revise below as we've already performed unaliasing so that the isAlias check may be removed
Map<String, Object> modelTemplate = (Map<String, Object>) ((List<Object>) models.get("models")).get(0);
// Special handling of aliases only applies to Java
if (modelTemplate != null && modelTemplate.containsKey("model")) {
@ -537,9 +537,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
}
});
Map<String, Object> operation = processOperations(config, tag, ops, allModels);
URL url = URLPathUtils.getServerURL(openAPI);
operation.put("basePath", basePath);
operation.put("basePathWithoutHost", basePathWithoutHost);
operation.put("basePathWithoutHost", config.encodePath(url.getPath()).replaceAll("/$", ""));
operation.put("contextPath", contextPath);
operation.put("baseName", tag);
operation.put("apiPackage", config.apiPackage());
@ -568,8 +568,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
@SuppressWarnings("unchecked")
List<CodegenOperation> operations = (List<CodegenOperation>) objectMap.get("operation");
for (CodegenOperation op : operations) {
op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT);
if (!op.vendorExtensions.containsKey("x-group-parameters")) {
if (isGroupParameters && !op.vendorExtensions.containsKey("x-group-parameters")) {
op.vendorExtensions.put("x-group-parameters", Boolean.TRUE);
}
}
@ -878,13 +877,13 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
throw new RuntimeException("missing config!");
}
configureGeneratorProperties();
configureOpenAPIInfo();
// resolve inline models
InlineModelResolver inlineModelResolver = new InlineModelResolver();
inlineModelResolver.flatten(openAPI);
configureGeneratorProperties();
configureOpenAPIInfo();
List<File> files = new ArrayList<File>();
// models
List<String> filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI);
@ -1137,6 +1136,8 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
mo.put("importPath", config.toModelImport(cm.classname));
models.add(mo);
cm.removeSelfReferenceImport();
allImports.addAll(cm.imports);
}
objs.put("models", models);

View File

@ -27,7 +27,6 @@ import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.PathItem;
import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.oas.models.parameters.RequestBody;
import io.swagger.v3.oas.models.Paths;
import io.swagger.v3.core.util.Json;
import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
@ -42,12 +41,11 @@ import io.swagger.v3.oas.models.media.XML;
public class InlineModelResolver {
private OpenAPI openapi;
private boolean skipMatches;
private Map<String, Schema> addedModels = new HashMap<String, Schema>();
private Map<String, String> generatedSignature = new HashMap<String, String>();
static Logger LOGGER = LoggerFactory.getLogger(InlineModelResolver.class);
Map<String, Schema> addedModels = new HashMap<String, Schema>();
Map<String, String> generatedSignature = new HashMap<String, String>();
public void flatten(OpenAPI openapi) {
void flatten(OpenAPI openapi) {
this.openapi = openapi;
if (openapi.getComponents() == null) {
@ -341,10 +339,7 @@ public class InlineModelResolver {
}
}
public String matchGenerated(Schema model) {
if (this.skipMatches) {
return null;
}
private String matchGenerated(Schema model) {
String json = Json.pretty(model);
if (generatedSignature.containsKey(json)) {
return generatedSignature.get(json);
@ -352,11 +347,11 @@ public class InlineModelResolver {
return null;
}
public void addGenerated(String name, Schema model) {
private void addGenerated(String name, Schema model) {
generatedSignature.put(Json.pretty(model), name);
}
public String uniqueName(String key) {
private String uniqueName(String key) {
if (key == null) {
key = "NULL_UNIQUE_NAME";
LOGGER.warn("null key found. Default to NULL_UNIQUE_NAME");
@ -380,7 +375,7 @@ public class InlineModelResolver {
return key;
}
public void flattenProperties(Map<String, Schema> properties, String path) {
private void flattenProperties(Map<String, Schema> properties, String path) {
if (properties == null) {
return;
}
@ -465,28 +460,7 @@ public class InlineModelResolver {
}
}
@SuppressWarnings("static-method")
public Schema modelFromProperty(ArraySchema object, @SuppressWarnings("unused") String path) {
String description = object.getDescription();
String example = null;
Object obj = object.getExample();
if (obj != null) {
example = obj.toString();
}
Schema inner = object.getItems();
if (inner instanceof ObjectSchema) {
ArraySchema model = new ArraySchema();
model.setDescription(description);
model.setExample(example);
model.setItems(object.getItems());
model.setName(object.getName());
return model;
}
return null;
}
public Schema modelFromProperty(ObjectSchema object, String path) {
private Schema modelFromProperty(ObjectSchema object, String path) {
String description = object.getDescription();
String example = null;
Object obj = object.getExample();
@ -508,22 +482,6 @@ public class InlineModelResolver {
return model;
}
@SuppressWarnings("static-method")
public Schema modelFromProperty(MapSchema object, @SuppressWarnings("unused") String path) {
String description = object.getDescription();
String example = null;
Object obj = object.getExample();
if (obj != null) {
example = obj.toString();
}
ArraySchema model = new ArraySchema();
model.setDescription(description);
model.setName(object.getName());
model.setExample(example);
model.setItems(ModelUtils.getAdditionalProperties(object));
return model;
}
/**
* Make a Schema
*
@ -531,7 +489,7 @@ public class InlineModelResolver {
* @param property Schema
* @return {@link Schema} A constructed OpenAPI property
*/
public Schema makeSchema(String ref, Schema property) {
private Schema makeSchema(String ref, Schema property) {
Schema newProperty = new Schema().$ref(ref);
this.copyVendorExtensions(property, newProperty);
return newProperty;
@ -544,7 +502,7 @@ public class InlineModelResolver {
* @param target target property
*/
public void copyVendorExtensions(Schema source, Schema target) {
private void copyVendorExtensions(Schema source, Schema target) {
Map<String, Object> vendorExtensions = source.getExtensions();
if (vendorExtensions == null) {
return;
@ -553,12 +511,4 @@ public class InlineModelResolver {
target.addExtension(extName, vendorExtensions.get(extName));
}
}
public boolean isSkipMatches() {
return skipMatches;
}
public void setSkipMatches(boolean skipMatches) {
this.skipMatches = skipMatches;
}
}

View File

@ -534,17 +534,22 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
@Override
public String apiFileFolder() {
return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', '/');
return (outputFolder + "/" + sourceFolder + "/" + apiPackage()).replace('.', File.separatorChar);
}
@Override
public String apiTestFileFolder() {
return outputFolder + "/" + testFolder + "/" + apiPackage().replace('.', '/');
return (outputFolder + "/" + testFolder + "/" + apiPackage()).replace('.', File.separatorChar);
}
@Override
public String modelTestFileFolder() {
return (outputFolder + "/" + testFolder + "/" + modelPackage()).replace('.', File.separatorChar);
}
@Override
public String modelFileFolder() {
return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', '/');
return (outputFolder + "/" + sourceFolder + "/" + modelPackage()).replace('.', File.separatorChar);
}
@Override
@ -572,6 +577,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return toApiName(name) + "Test";
}
@Override
public String toModelTestFilename(String name) {
return toModelName(name) + "Test";
}
@Override
public String toApiName(String name) {
if (name.length() == 0) {

View File

@ -83,6 +83,9 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
// By default, generated code is considered public
protected boolean nonPublicApi = Boolean.FALSE;
// use KellermanSoftware.CompareNetObjects for deep recursive object comparision
protected boolean useCompareNetObjects = Boolean.FALSE;
public CSharpClientCodegen() {
super();
supportsInheritance = true;
@ -196,6 +199,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
CodegenConstants.VALIDATABLE_DESC,
this.validatable);
addSwitch(CodegenConstants.USE_COMPARE_NET_OBJECTS,
CodegenConstants.USE_COMPARE_NET_OBJECTS_DESC,
this.useCompareNetObjects);
regexModifiers = new HashMap<Character, String>();
regexModifiers.put('i', "IgnoreCase");
regexModifiers.put('m', "Multiline");
@ -798,6 +805,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
this.generatePropertyChanged = generatePropertyChanged;
}
public void setUseCompareNetObjects(final Boolean useCompareNetObjects) {
this.useCompareNetObjects = useCompareNetObjects;
}
public boolean isNonPublicApi() {
return nonPublicApi;
}

View File

@ -447,7 +447,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
if (ElmVersion.ELM_018.equals(elmVersion)) {
String path = op.path;
for (CodegenParameter param : op.pathParams) {
final String var = paramToString(param, false, null);
final String var = paramToString("params", param, false, null);
path = path.replace("{" + param.paramName + "}", "\" ++ " + var + " ++ \"");
hasDateTime = hasDateTime || param.isDateTime;
hasDate = hasDate || param.isDate;
@ -457,7 +457,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
final List<String> paths = Arrays.asList(op.path.substring(1).split("/"));
String path = paths.stream().map(str -> str.charAt(0) == '{' ? str : "\"" + str + "\"").collect(Collectors.joining(", "));
for (CodegenParameter param : op.pathParams) {
String str = paramToString(param, false, null);
String str = paramToString("params", param, false, null);
path = path.replace("{" + param.paramName + "}", str);
hasDateTime = hasDateTime || param.isDateTime;
hasDate = hasDate || param.isDate;
@ -465,10 +465,15 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
op.path = path;
final String query = op.queryParams.stream()
.map(param -> paramToString(param, true, "Url.string \"" + param.paramName + "\""))
.map(param -> paramToString("params", param, true, "Url.string \"" + param.baseName + "\""))
.collect(Collectors.joining(", "));
op.vendorExtensions.put("query", query);
// TODO headers
final String headers = op.headerParams.stream()
.map(param -> paramToString("headers", param, true, "Http.header \"" + param.baseName + "\""))
.collect(Collectors.joining(", "));
op.vendorExtensions.put("headers", headers);
// TODO cookies
// TODO forms
}
@ -563,8 +568,8 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
return "(Just " + value + ")";
}
private String paramToString(final CodegenParameter param, final boolean useMaybe, final String maybeMapResult) {
final String paramName = (ElmVersion.ELM_018.equals(elmVersion) ? "" : "params.") + param.paramName;
private String paramToString(final String prefix, final CodegenParameter param, final boolean useMaybe, final String maybeMapResult) {
final String paramName = (ElmVersion.ELM_018.equals(elmVersion) ? "" : prefix + ".") + param.paramName;
if (!useMaybe) {
param.required = true;
}
@ -601,11 +606,15 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
}
String mapResult = "";
if (maybeMapResult != null) {
if (mapFn == "") {
mapResult = maybeMapResult;
} else {
mapResult = maybeMapResult + (param.required ? " <|" : " <<");
}
}
final String just = useMaybe ? "Just (" : "";
final String justEnd = useMaybe ? ")" : "";
return (param.required ? just : "Maybe.map") + mapResult + " " + mapFn + " " + paramName + (param.required ? justEnd : "");
return (param.required ? just : "Maybe.map (") + mapResult + " " + mapFn + (param.required ? " " : ") ") + paramName + (param.required ? justEnd : "");
}
@Override

View File

@ -64,6 +64,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
public static final String FEIGN_VERSION = "feignVersion";
public static final String PARCELABLE_MODEL = "parcelableModel";
public static final String USE_RUNTIME_EXCEPTION = "useRuntimeException";
public static final String USE_REFLECTION_EQUALS_HASHCODE = "useReflectionEqualsHashCode";
public static final String PLAY_24 = "play24";
public static final String PLAY_25 = "play25";
@ -88,7 +89,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen
protected String gradleWrapperPackage = "gradle.wrapper";
protected boolean useRxJava = false;
protected boolean useRxJava2 = false;
protected boolean doNotUseRx = true; // backwards compatibility for swagger configs that specify neither rx1 nor rx2 (mustache does not allow for boolean operators so we need this extra field)
// backwards compatibility for openapi configs that specify neither rx1 nor rx2
// (mustache does not allow for boolean operators so we need this extra field)
protected boolean doNotUseRx = true;
protected boolean usePlayWS = false;
protected String playVersion = PLAY_25;
protected String feignVersion = FEIGN_9;
@ -97,7 +100,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
protected boolean performBeanValidation = false;
protected boolean useGzipFeature = false;
protected boolean useRuntimeException = false;
protected boolean useReflectionEqualsHashCode = false;
public JavaClientCodegen() {
super();
@ -108,6 +111,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen
apiPackage = "org.openapitools.client.api";
modelPackage = "org.openapitools.client.model";
modelTestTemplateFiles.put("model_test.mustache", ".java");
cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library."));
cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library."));
cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library."));
@ -119,6 +124,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE, "Send gzip-encoded requests"));
cliOptions.add(CliOption.newBoolean(USE_RUNTIME_EXCEPTION, "Use RuntimeException instead of Exception"));
cliOptions.add(CliOption.newBoolean(FEIGN_VERSION, "Version of OpenFeign: '10.x', '9.x' (default)"));
cliOptions.add(CliOption.newBoolean(USE_REFLECTION_EQUALS_HASHCODE, "Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact."));
supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.4. JSON processing: Jackson 2.8.9. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.8.9. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'");
@ -225,6 +231,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
this.setUseRuntimeException(convertPropertyToBooleanAndWriteBack(USE_RUNTIME_EXCEPTION));
}
if (additionalProperties.containsKey(USE_REFLECTION_EQUALS_HASHCODE)) {
this.setUseReflectionEqualsHashCode(convertPropertyToBooleanAndWriteBack(USE_REFLECTION_EQUALS_HASHCODE));
}
final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/");
final String authFolder = (sourceFolder + '/' + invokerPackage + ".auth").replace(".", "/");
final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/");
@ -632,6 +642,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
this.useRuntimeException = useRuntimeException;
}
public void setUseReflectionEqualsHashCode(boolean useReflectionEqualsHashCode) {
this.useReflectionEqualsHashCode = useReflectionEqualsHashCode;
}
final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?");
final private static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?");

View File

@ -31,16 +31,21 @@ import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.net.URLEncoder;
import org.apache.commons.lang3.StringEscapeUtils;
import java.io.UnsupportedEncodingException;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.Schema;
public class PhpSlimServerCodegen extends AbstractPhpCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(PhpSlimServerCodegen.class);
public static final String PHPCS_STANDARD = "phpcsStandard";
public static final String USER_CLASSNAME_KEY = "userClassname";
protected String groupId = "org.openapitools";
protected String artifactId = "openapi-server";
protected String phpcsStandard = "PSR12";
public PhpSlimServerCodegen() {
super();
@ -74,9 +79,6 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
break;
}
}
cliOptions.add(new CliOption(PHPCS_STANDARD, "PHP CodeSniffer <standard> option. Accepts name or path of the coding standard to use.")
.defaultValue("PSR12"));
}
@Override
@ -116,18 +118,13 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
public void processOpts() {
super.processOpts();
if (additionalProperties.containsKey(PHPCS_STANDARD)) {
this.setPhpcsStandard((String) additionalProperties.get(PHPCS_STANDARD));
} else {
additionalProperties.put(PHPCS_STANDARD, phpcsStandard);
}
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("composer.mustache", "", "composer.json"));
supportingFiles.add(new SupportingFile("index.mustache", "", "index.php"));
supportingFiles.add(new SupportingFile(".htaccess", "", ".htaccess"));
supportingFiles.add(new SupportingFile("SlimRouter.mustache", toSrcPath(invokerPackage, srcBasePath), "SlimRouter.php"));
supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist"));
supportingFiles.add(new SupportingFile("phpcs.xml.mustache", "", "phpcs.xml.dist"));
}
@Override
@ -161,15 +158,6 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
return objs;
}
/**
* Sets PHP CodeSniffer &lt;standard&gt; option. Accepts name or path of the coding standard to use.
*
* @param phpcsStandard standard option value
*/
public void setPhpcsStandard(String phpcsStandard) {
this.phpcsStandard = phpcsStandard;
}
@Override
public String toApiName(String name) {
if (name.length() == 0) {
@ -198,4 +186,57 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
operations.put(USER_CLASSNAME_KEY, classname);
}
@Override
public String encodePath(String input) {
if (input == null) {
return input;
}
// from DefaultCodegen.java
// remove \t, \n, \r
// replace \ with \\
// replace " with \"
// outter unescape to retain the original multi-byte characters
// finally escalate characters avoiding code injection
input = super.escapeUnsafeCharacters(
StringEscapeUtils.unescapeJava(
StringEscapeUtils.escapeJava(input)
.replace("\\/", "/"))
.replaceAll("[\\t\\n\\r]", " ")
.replace("\\", "\\\\"));
// .replace("\"", "\\\""));
// from AbstractPhpCodegen.java
// Trim the string to avoid leading and trailing spaces.
input = input.trim();
try {
input = URLEncoder.encode(input, "UTF-8")
.replaceAll("\\+", "%20")
.replaceAll("\\%2F", "/")
.replaceAll("\\%7B", "{") // keep { part of complex placeholders
.replaceAll("\\%7D", "}") // } part
.replaceAll("\\%5B", "[") // [ part
.replaceAll("\\%5D", "]") // ] part
.replaceAll("\\%3A", ":") // : part
.replaceAll("\\%2B", "+") // + part
.replaceAll("\\%5C\\%5Cd", "\\\\d"); // \d part
} catch (UnsupportedEncodingException e) {
// continue
LOGGER.error(e.getMessage(), e);
}
return input;
}
@Override
public CodegenOperation fromOperation(String path,
String httpMethod,
Operation operation,
Map<String, Schema> schemas,
OpenAPI openAPI) {
CodegenOperation op = super.fromOperation(path, httpMethod, operation, schemas, openAPI);
op.path = encodePath(path);
return op;
}
}

View File

@ -125,6 +125,7 @@ dependencies {
compile 'com.google.code.gson:gson:2.8.1'
compile 'io.gsonfire:gson-fire:1.8.0'
compile group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
{{#joda}}
compile 'joda-time:joda-time:2.9.9'
{{/joda}}

View File

@ -13,6 +13,7 @@ lazy val root = (project in file(".")).
"com.squareup.okhttp" % "okhttp" % "2.7.5",
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
"com.google.code.gson" % "gson" % "2.8.1",
"org.apache.commons" % "commons-lang3" % "3.8.1",
{{#joda}}
"joda-time" % "joda-time" % "2.9.9" % "compile",
{{/joda}}

View File

@ -225,6 +225,11 @@
<artifactId>org.apache.oltu.oauth2.client</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3-version}</version>
</dependency>
{{#joda}}
<dependency>
<groupId>joda-time</groupId>
@ -286,6 +291,7 @@
<swagger-core-version>1.5.18</swagger-core-version>
<okhttp-version>2.7.5</okhttp-version>
<gson-version>2.8.1</gson-version>
<commons-lang3-version>3.8.1</commons-lang3-version>
{{#joda}}
<jodatime-version>2.9.9</jodatime-version>
{{/joda}}

View File

@ -2,6 +2,10 @@
package {{package}};
{{#useReflectionEqualsHashCode}}
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
{{/useReflectionEqualsHashCode}}
{{^supportJava6}}
import java.util.Objects;
import java.util.Arrays;

View File

@ -0,0 +1,48 @@
{{>licenseInfo}}
package {{package}};
{{#imports}}import {{import}};
{{/imports}}
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
{{#fullJavaUtil}}
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
{{/fullJavaUtil}}
/**
* Model tests for {{classname}}
*/
public class {{classname}}Test {
{{#models}}
{{#model}}
{{^isEnum}}
private final {{classname}} model = new {{classname}}();
{{/isEnum}}
/**
* Model tests for {{classname}}
*/
@Test
public void test{{classname}}() {
// TODO: test {{classname}}
}
{{#allVars}}
/**
* Test the property '{{name}}'
*/
@Test
public void {{name}}Test() {
// TODO: test {{name}}
}
{{/allVars}}
{{/model}}
{{/models}}
}

View File

@ -148,6 +148,10 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
{{^supportJava6}}
@Override
public boolean equals(java.lang.Object o) {
{{#useReflectionEqualsHashCode}}
return EqualsBuilder.reflectionEquals(this, o);
{{/useReflectionEqualsHashCode}}
{{^useReflectionEqualsHashCode}}
if (this == o) {
return true;
}
@ -159,11 +163,17 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
{{/hasMore}}{{/vars}}{{#parent}} &&
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
{{/useReflectionEqualsHashCode}}
}
@Override
public int hashCode() {
{{#useReflectionEqualsHashCode}}
return HashCodeBuilder.reflectionHashCode(this);
{{/useReflectionEqualsHashCode}}
{{^useReflectionEqualsHashCode}}
return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
{{/useReflectionEqualsHashCode}}
}
{{/supportJava6}}
@ -194,9 +204,13 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class {{classname}} {\n");
{{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}}
{{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n");
{{/vars}}sb.append("}");
{{#parent}}
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
{{/parent}}
{{#vars}}
sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n");
{{/vars}}
sb.append("}");
return sb.toString();
}

View File

@ -1 +1 @@
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}} {{paramName}}{{/isBodyParam}}
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}} {{paramName}}{{/isBodyParam}}

View File

@ -1 +1 @@
{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "file detail") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}}
{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "file detail") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("file") MultipartFile {{baseName}}{{/isFile}}{{/isFormParam}}

View File

@ -1 +1 @@
{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}}
{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}}

View File

@ -1,5 +1,7 @@
package {{basePackage}};
import com.fasterxml.jackson.databind.Module;
import org.openapitools.jackson.nullable.JsonNullableModule;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
@ -69,4 +71,9 @@ public class OpenAPI2SpringBoot implements CommandLineRunner {
};
}
@Bean
public Module jsonNullableModule() {
return new JsonNullableModule();
}
}

View File

@ -137,6 +137,11 @@
<version>2.8.4</version>
</dependency>
{{/threetenbp}}
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.1.0</version>
</dependency>
{{#useBeanValidation}}
<!-- Bean Validation API support -->
<dependency>

View File

@ -1 +1 @@
{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestParam("{{baseName}}") MultipartFile {{paramName}}{{/isFile}}{{/isFormParam}}
{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "file detail") @RequestParam("{{baseName}}") MultipartFile {{paramName}}{{/isFile}}{{/isFormParam}}

View File

@ -81,6 +81,11 @@
<version>2.6.4</version>
</dependency>
{{/threetenbp}}
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
{{#threetenbp}}
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
{{/threetenbp}}
import org.openapitools.jackson.nullable.JsonNullableModule;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@ -94,9 +95,7 @@ public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter {
return new Jackson2ObjectMapperBuilder()
.indentOutput(true)
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
{{#threetenbp}}
.modulesToInstall(module)
{{/threetenbp}}
.modulesToInstall({{#threetenbp}}module, {{/threetenbp}}new JsonNullableModule())
.dateFormat(new RFC3339DateFormat());
}

View File

@ -202,6 +202,11 @@
<version>${jackson-threetenbp-version}</version>
</dependency>
{{/threetenbp}}
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -3,6 +3,7 @@ package {{package}};
import java.util.Objects;
{{#imports}}import {{import}};
{{/imports}}
import org.openapitools.jackson.nullable.JsonNullable;
{{#serializableModel}}
import java.io.Serializable;
{{/serializableModel}}

View File

@ -0,0 +1 @@
{{#isNullable}}JsonNullable<{{{datatypeWithEnum}}}>{{/isNullable}}{{^isNullable}}{{{datatypeWithEnum}}}{{/isNullable}}

View File

@ -1 +1 @@
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}}

View File

@ -28,16 +28,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}}
{{/gson}}
{{#isContainer}}
{{#useBeanValidation}}@Valid{{/useBeanValidation}}
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
private {{>nullableDataType}} {{name}} = {{#isNullable}}JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#required}}{{{defaultValue}}}{{/required}}{{^required}}null{{/required}}{{/isNullable}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
private {{>nullableDataType}} {{name}}{{#isNullable}} = JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isNullable}};
{{/isContainer}}
{{/vars}}
{{#vars}}
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};
this.{{name}} = {{#isNullable}}JsonNullable.of({{name}}){{/isNullable}}{{^isNullable}}{{name}}{{/isNullable}};
return this;
}
{{#isListContainer}}
@ -84,11 +84,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}}
{{{vendorExtensions.extraAnnotation}}}
{{/vendorExtensions.extraAnnotation}}
@ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}")
{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() {
{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{>nullableDataType}} {{getter}}() {
return {{name}};
}
public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
public void {{setter}}({{>nullableDataType}} {{name}}) {
this.{{name}} = {{name}};
}

View File

@ -1 +1 @@
{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}) {{>optionalDataType}} {{paramName}}{{/isQueryParam}}
{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{>optionalDataType}} {{paramName}}{{/isQueryParam}}

View File

@ -9,6 +9,9 @@ using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
{{#useCompareNetObjects}}
using KellermanSoftware.CompareNetObjects;
{{/useCompareNetObjects}}
namespace {{packageName}}.Client
{
@ -17,6 +20,21 @@ namespace {{packageName}}.Client
/// </summary>
public static class ClientUtils
{
{{#useCompareNetObjects}}
/// <summary>
/// An instance of CompareLogic.
/// </summary>
public static CompareLogic compareLogic;
/// <summary>
/// Static contstructor to initialise compareLogic.
/// </summary>
static ClientUtils()
{
compareLogic = new CompareLogic();
}
{{/useCompareNetObjects}}
/// <summary>
/// Sanitize filename by removing the path
/// </summary>

View File

@ -84,6 +84,14 @@
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
</Reference>
{{#useCompareNetObjects}}
<Reference Include="KellermanSoftware.Compare-NET-Objects">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
</Reference>
{{/useCompareNetObjects}}
{{#generatePropertyChanged}}
<Reference Include="PropertyChanged">
<HintPath>..\..\packages\PropertyChanged.Fody.1.51.3\Lib\portable-net4+sl4+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>

View File

@ -44,6 +44,9 @@ ${nuget_cmd} install src/{{packageName}}/packages.config -o packages;
echo "[INFO] Copy DLLs to the 'bin' folder"
mkdir -p bin;
{{#useCompareNetObjects}}
cp packages/CompareNETObjects.4.57.0/lib/{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}/KellermanSoftware.Compare-NET-Objects.dll bin/KellermanSoftware.Compare-NET-Objects.dll;
{{/useCompareNetObjects}}
cp packages/Newtonsoft.Json.12.0.1/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/RestSharp.106.5.4/lib/{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}/RestSharp.dll bin/RestSharp.dll;
cp packages/JsonSubTypes.1.5.1/lib/{{targetFrameworkNuget}}/JsonSubTypes.dll bin/JsonSubTypes.dll
@ -60,6 +63,9 @@ bin/Fody.dll,\
bin/PropertyChanged.Fody.dll,\
bin/PropertyChanged.dll,\
{{/generatePropertyChanged}}
{{#useCompareNetObjects}}
bin/KellermanSoftware.Compare-NET-Objects.dll,\
{{/useCompareNetObjects}}
bin/RestSharp.dll,\
System.ComponentModel.DataAnnotations.dll,\
System.Runtime.Serialization.dll \

View File

@ -14,7 +14,9 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
.\nuget.exe install src\{{packageName}}\packages.config -o packages
if not exist ".\bin" mkdir bin
{{#CompareNetObjects}}
copy packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll bin\KellermanSoftware.Compare-NET-Objects.dll
{{/CompareNetObjects}}
copy packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll bin\JsonSubTypes.dll
copy packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll bin\RestSharp.dll
@ -23,5 +25,5 @@ copy packages\Fody.1.29.4\Fody.dll bin\Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll
{{/generatePropertyChanged}}
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;{{#CompareNetObjects}}bin\KellermanSoftware.Compare-NET-Objects.dll;{{/CompareNetObjects}}System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml

View File

@ -28,6 +28,9 @@ using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
{{/netStandard}}
using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter;
{{#useCompareNetObjects}}
using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils;
{{/useCompareNetObjects}}
{{#models}}
{{#model}}

View File

@ -149,7 +149,12 @@
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
{{#useCompareNetObjects}}
return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual;
{{/useCompareNetObjects}}
{{^useCompareNetObjects}}
return this.Equals(input as {{classname}});
{{/useCompareNetObjects}}
}
/// <summary>
@ -159,6 +164,10 @@
/// <returns>Boolean</returns>
public bool Equals({{classname}} input)
{
{{#useCompareNetObjects}}
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
{{/useCompareNetObjects}}
{{^useCompareNetObjects}}
if (input == null)
return false;
@ -178,6 +187,7 @@
this.{{name}} != null &&
this.{{name}}.SequenceEqual(input.{{name}})
){{#hasMore}} && {{/hasMore}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}};
{{/useCompareNetObjects}}
}
/// <summary>

View File

@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
{{#useCompareNetObjects}}
<package id="CompareNETObjects" version="4.57.0" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
{{/useCompareNetObjects}}
<package id="RestSharp" version="106.5.4" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
{{#generatePropertyChanged}}
<package id="Fody" version="1.29.4" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
{{/generatePropertyChanged}}
</packages>

View File

@ -4,6 +4,9 @@
"FubarCoder.RestSharp.Portable.Core": "4.0.7",
"FubarCoder.RestSharp.Portable.HttpClient": "4.0.7",
"Newtonsoft.Json": "12.0.1",
{{#useCompareNetObjects}}
"KellermanSoftware.Compare-NET-Objects": "4.57.0",
{{/useCompareNetObjects}}
"JsonSubTypes": "1.5.1"
},
"frameworks": {

View File

@ -21,6 +21,10 @@ basePath =
-}
{{/notes}}
{{operationId}} :
{{#headerParams}}
{{#-first}} { {{/-first}}{{^-first}} , {{/-first}}{{paramName}} : {{^required}}Maybe ({{/required}}{{#isListContainer}}List {{/isListContainer}}{{dataType}}{{^required}}){{/required}}
{{#-last}} } -> {{/-last}}
{{/headerParams}}
{ onSend : Result Http.Error {{^responses}}(){{/responses}}{{#responses}}{{#-first}}{{^dataType}}(){{/dataType}}{{#isMapContainer}}(Dict.Dict String {{/isMapContainer}}{{#isListContainer}}(List {{/isListContainer}}{{dataType}}{{#isListContainer}}){{/isListContainer}}{{#isMapContainer}}){{/isMapContainer}}{{/-first}}{{/responses}} -> msg
{{#enableCustomBasePaths}} , basePath : String{{/enableCustomBasePaths}}
{{#enableHttpRequestTrackers}} , tracker : Maybe String{{/enableHttpRequestTrackers}}
@ -29,13 +33,13 @@ basePath =
{{#queryParams}} , {{paramName}} : {{^required}}Maybe ({{/required}}{{#isListContainer}}List {{/isListContainer}}{{dataType}}{{^required}}){{/required}}{{/queryParams}}
}
-> Cmd msg
{{operationId}} params =
{{operationId}} {{#headerParams.0}}headers {{/headerParams.0}}params =
Http.request
{ method = "{{httpMethod}}"
, headers = []
, headers = {{#headerParams.0}}List.filterMap identity {{/headerParams.0}}[{{{vendorExtensions.headers}}}]
, url = Url.crossOrigin {{#enableCustomBasePaths}}params.{{/enableCustomBasePaths}}basePath
[{{{path}}}]
(List.filterMap identity [{{{vendorExtensions.query}}}])
{{#queryParams.0}}(List.filterMap identity {{/queryParams.0}}[{{{vendorExtensions.query}}}]{{#queryParams.0}}){{/queryParams.0}}
, body = {{#bodyParam}}{{^required}}Maybe.withDefault Http.emptyBody <| Maybe.map ({{/required}}Http.jsonBody {{#required}}<|{{/required}}{{^required}}<<{{/required}} {{vendorExtensions.elmEncoder}}{{^required}}){{/required}} params.body{{/bodyParam}}{{^bodyParam}}Http.emptyBody{{/bodyParam}}
, expect = {{^responses}}Http.expectWhatever params.onSend{{/responses}}{{#responses}}{{#-first}}{{^dataType}}Http.expectWhatever params.onSend{{/dataType}}{{#dataType}}Http.expectJson params.onSend {{#isMapContainer}}(Decode.dict {{/isMapContainer}}{{#isListContainer}}(Decode.list {{/isListContainer}}{{#vendorExtensions}}{{elmDecoder}}{{/vendorExtensions}}{{#isListContainer}}){{/isListContainer}}{{#isMapContainer}}){{/isMapContainer}}{{/dataType}}{{/-first}}{{/responses}}
, timeout = Just 30000

View File

@ -8,6 +8,9 @@ from typing import List, Dict # noqa: F401
from {{modelPackage}}.base_model_ import Model
from {{packageName}} import util
{{#imports}}
{{{import}}} # noqa: E501
{{/imports}}
{{#models}}
{{#model}}

View File

@ -23,7 +23,7 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base
fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{paramName}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}}
val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mapOf(){{/hasQueryParams}}{{#hasQueryParams}}mapOf({{#queryParams}}"{{baseName}}" to {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/queryParams}}){{/hasQueryParams}}
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}}
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}{{paramName}}.toString(){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}}
val localVariableConfig = RequestConfig(
RequestMethod.{{httpMethod}},
"{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}},

View File

@ -1,7 +1,11 @@
package {{packageName}}.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.Moshi
import com.squareup.moshi.ToJson
import okhttp3.*
import java.io.File
import java.util.*
open class ApiClient(val baseUrl: String) {
companion object {
@ -51,7 +55,12 @@ open class ApiClient(val baseUrl: String) {
protected inline fun <reified T: Any?> responseBody(body: ResponseBody?, mediaType: String = JsonMediaType): T? {
if(body == null) return null
return when(mediaType) {
JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(body.source())
JsonMediaType -> Moshi.Builder().add(object {
@ToJson
fun toJson(uuid: UUID) = uuid.toString()
@FromJson
fun fromJson(s: String) = UUID.fromString(s)
}).build().adapter(T::class.java).fromJson(body.source())
else -> TODO()
}
}

View File

@ -9,3 +9,9 @@ composer.phar
# phplint tool creates cache file which is not necessary in a codebase
/.phplint-cache
# Do not commit local PHPUnit config
/phpunit.xml
# Do not commit local PHP_CodeSniffer config
/phpcs.xml

View File

@ -28,21 +28,54 @@ $ php -S localhost:8888 -t php-slim-server
> It may also be useful for testing purposes or for application demonstrations that are run in controlled environments.
> It is not intended to be a full-featured web server. It should not be used on a public network.
## Run tests
## Tests
This package uses PHPUnit 6 or 7(depends from your PHP version) for unit testing and PHP Codesniffer to check source code against user defined coding standard(`phpcsStandard` generator config option).
### PHPUnit
This package uses PHPUnit 6 or 7(depends from your PHP version) for unit testing.
[Test folder]({{testBasePath}}) contains templates which you can fill with real test assertions.
How to write tests read at [PHPUnit Manual - Chapter 2. Writing Tests for PHPUnit](https://phpunit.de/manual/6.5/en/writing-tests-for-phpunit.html).
How to configure PHP CodeSniffer read at [PHP CodeSniffer Documentation](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
There is [phplint](https://github.com/overtrue/phplint) tool to check php syntax automatically.
Command | Tool | Target
---- | ---- | ----
`$ composer test` | PHPUnit | All tests
`$ composer run test-apis` | PHPUnit | Apis tests
`$ composer run test-models` | PHPUnit | Models tests
`$ composer run phpcs` | PHP CodeSniffer | All files
`$ composer run phplint` | phplint | All files
#### Run
Command | Target
---- | ----
`$ composer test` | All tests
`$ composer test-apis` | Apis tests
`$ composer test-models` | Models tests
#### Config
Package contains fully functional config `./phpunit.xml.dist` file. Create `./phpunit.xml` in root folder to override it.
Quote from [3. The Command-Line Test Runner — PHPUnit 7.4 Manual](https://phpunit.readthedocs.io/en/7.4/textui.html#command-line-options):
> If phpunit.xml or phpunit.xml.dist (in that order) exist in the current working directory and --configuration is not used, the configuration will be automatically read from that file.
### PHP CodeSniffer
[PHP CodeSniffer Documentation](https://github.com/squizlabs/PHP_CodeSniffer/wiki). This tool helps to follow coding style and avoid common PHP coding mistakes.
#### Run
```bash
$ composer phpcs
```
#### Config
Package contains fully functional config `./phpcs.xml.dist` file. It checks source code against PSR-1 and PSR-2 coding standards.
Create `./phpcs.xml` in root folder to override it. More info at [Using a Default Configuration File](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file)
### PHPLint
[PHPLint Documentation](https://github.com/overtrue/phplint). Checks PHP syntax only.
#### Run
```bash
$ composer phplint
```
## Show errors

View File

@ -64,7 +64,7 @@ class SlimRouter
[
'httpMethod' => '{{httpMethod}}',
'basePathWithoutHost' => '{{{basePathWithoutHost}}}',
'path' => '{{path}}',
'path' => '{{{path}}}',
'apiPackage' => '{{apiPackage}}',
'classname' => '{{classname}}',
'userClassname' => '{{userClassname}}',

View File

@ -26,7 +26,7 @@
],
"test-apis": "phpunit --testsuite Apis",
"test-models": "phpunit --testsuite Models",
"phpcs": "phpcs ./ --ignore=vendor --warning-severity=0 --standard={{phpcsStandard}}",
"phpcs": "phpcs",
"phplint": "phplint ./ --exclude=vendor"
}
}

View File

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="{{appName}} Config" xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>PHP_CodeSniffer config for {{appName}}</description>
<!-- Path to inspected files -->
<file>./</file>
<!-- Don't need to inspect installed packages -->
<exclude-pattern>./vendor</exclude-pattern>
<!-- <basepath> A path to strip from the front of file paths inside reports -->
<arg name="basepath" value="."/>
<!-- colors Use colors in output -->
<arg name="colors"/>
<!-- Do not print warnings -->
<!-- <arg name="warning-severity" value="0"/> -->
<!-- -p Show progress of the run -->
<!-- -s Show sniff codes in all reports -->
<arg value="ps"/>
<!-- Include the whole PSR12 standard -->
<rule ref="PSR12">
<!-- There is no way to wrap generated comments, just disable that rule for now -->
<exclude name="Generic.Files.LineLength.TooLong" />
<!-- Codegen generates variables with underscore on purpose -->
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore" />
</rule>
</ruleset>

View File

@ -64,6 +64,15 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
return Alamofire.SessionManager(configuration: configuration)
}
/**
May be overridden by a subclass if you want to custom request constructor.
*/
open func createURLRequest() -> URLRequest? {
let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding()
guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil }
return try? encoding.encode(originalRequest, with: parameters)
}
/**
May be overridden by a subclass if you want to control the Content-Type
that is given to an uploaded form part.

View File

@ -4,8 +4,8 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}'
s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}
s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}{{#apiInfo}}{{version}}{{/apiInfo}}{{^apiInfo}}}0.0.1{{/apiInfo}}{{/podVersion}}'
s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v{{#apiInfo}}{{version}}{{/apiInfo}}{{^apiInfo}}}0.0.1{{/apiInfo}}' }{{/podSource}}
{{#podAuthors}}
s.authors = '{{podAuthors}}'
{{/podAuthors}}

View File

@ -33,6 +33,8 @@ open class {{classname}} {
{{/isEnum}}
{{/allParams}}
{{^usePromiseKit}}
{{^useRxSwift}}
/**
{{#summary}}
{{{summary}}}
@ -54,7 +56,8 @@ open class {{classname}} {
{{/returnType}}
}
}
{{/useRxSwift}}
{{/usePromiseKit}}
{{#usePromiseKit}}
/**
{{#summary}}
@ -65,11 +68,19 @@ open class {{classname}} {
*/
open class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {
let deferred = Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.pending()
{{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { data, error in
{{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute { (response, error) -> Void in
if let error = error {
deferred.reject(error)
{{#returnType}}
} else if let response = response {
deferred.fulfill(response.body!)
} else {
deferred.fulfill(data!)
fatalError()
{{/returnType}}
{{^returnType}}
} else {
deferred.fulfill(())
{{/returnType}}
}
}
return deferred.promise
@ -85,13 +96,21 @@ open class {{classname}} {
*/
open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {
return Observable.create { observer -> Disposable in
{{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { data, error in
{{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute { (response, error) -> Void in
if let error = error {
observer.on(.error(error))
observer.onError(error)
{{#returnType}}
} else if let response = response {
observer.onNext(response.body!)
} else {
observer.on(.next(data!))
fatalError()
{{/returnType}}
{{^returnType}}
} else {
observer.onNext(())
{{/returnType}}
}
observer.on(.completed)
observer.onCompleted()
}
return Disposables.create()
}

View File

@ -17,14 +17,14 @@
package org.openapitools.codegen;
import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.*;
import io.swagger.v3.oas.models.media.*;
import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.core.util.Json;
import io.swagger.v3.oas.models.parameters.RequestBody;
import io.swagger.v3.oas.models.responses.ApiResponse;
import io.swagger.v3.oas.models.responses.ApiResponses;
import org.apache.commons.lang3.StringUtils;
import org.testng.Assert;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.openapitools.codegen.utils.ModelUtils;
import org.testng.annotations.Test;
import java.util.HashMap;
@ -274,130 +274,56 @@ public class InlineModelResolverTest {
assertTrue(model.getProperties().get("name") instanceof StringSchema);
}
@Test
public void resolveInlineArraySchemaWithTitle() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
assertTrue(openAPI.getComponents().getSchemas().get("Users") instanceof ArraySchema);
ArraySchema users = (ArraySchema) openAPI.getComponents().getSchemas().get("Users");
assertTrue(users.getItems() instanceof ObjectSchema);
ObjectSchema user = (ObjectSchema) users.getItems();
assertEquals("User", user.getTitle());
assertTrue(user.getProperties().get("street") instanceof StringSchema);
assertTrue(user.getProperties().get("city") instanceof StringSchema);
}
@Test
public void resolveInlineRequestBody() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
RequestBody requestBodyReference = openAPI
.getPaths()
.get("/resolve_inline_request_body")
.getPost()
.getRequestBody();
assertNotNull(requestBodyReference.get$ref());
RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, requestBodyReference);
MediaType mediaType = requestBody.getContent().get("application/json");
assertTrue(ModelUtils.getReferencedSchema(openAPI, mediaType.getSchema()) instanceof ObjectSchema);
ObjectSchema schema = (ObjectSchema) ModelUtils.getReferencedSchema(openAPI, mediaType.getSchema());
assertTrue(schema.getProperties().get("name") instanceof StringSchema);
assertNotNull(schema.getProperties().get("address").get$ref());
Schema address = ModelUtils.getReferencedSchema(openAPI, schema.getProperties().get("address"));
assertTrue(address.getProperties().get("street") instanceof StringSchema);
}
@Test
public void resolveInlineRequestBodyWithRequired() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
RequestBody requestBodyReference = openAPI.getPaths().get("/resolve_inline_request_body_with_required").getPost().getRequestBody();
assertTrue(requestBodyReference.getRequired());
}
/*
@Test
public void resolveInlineArraySchemaWithTitle() throws Exception {
OpenAPI openapi = new OpenAPI();
openapi.getComponents().addSchemas("User", new ArraySchema()
.items(new ObjectSchema()
.title("InnerUserTitle")
.access("access")
.readOnly(false)
.required(true)
.description("description")
.name("name")
.addProperties("street", new StringSchema())
.addProperties("city", new StringSchema())));
new InlineModelResolver().flatten(openapi);
Schema model = openapi.getComponents().getSchemas().get("User");
assertTrue(model instanceof ArraySchema);
Schema user = openapi.getComponents().getSchemas().get("InnerUserTitle");
assertNotNull(user);
assertEquals("description", user.getDescription());
}
/*
@Test
public void resolveInlineArraySchemaWithoutTitle() throws Exception {
OpenAPI openapi = new OpenAPI();
openapi.getComponents().addSchemas("User", new ArraySchema()
.items(new ObjectSchema()
._default("default")
.access("access")
.readOnly(false)
.required(true)
.description("description")
.name("name")
.addProperties("street", new StringSchema())
.addProperties("city", new StringSchema())));
new InlineModelResolver().flatten(openapi);
Schema model = openapi.getComponents().getSchemas().get("User");
assertTrue(model instanceof ArraySchema);
Model user = openapi.getComponents().getSchemas().get("User_inner");
assertNotNull(user);
assertEquals("description", user.getDescription());
}
@Test
public void resolveInlineBodyParameter() throws Exception {
OpenAPI openapi = new OpenAPI();
openapi.path("/hello", new Path()
.get(new Operation()
.parameter(new BodyParameter()
.name("body")
.schema(new ObjectSchema()
.addProperties("address", new ObjectSchema()
.addProperties("street", new StringSchema()))
.addProperties("name", new StringSchema())))));
new InlineModelResolver().flatten(openapi);
Operation operation = openapi.getPaths().get("/hello").getGet();
BodyParameter bp = (BodyParameter)operation.getParameters().get(0);
assertTrue(bp.getSchema() instanceof RefModel);
Model body = openapi.getComponents().getSchemas().get("body");
assertTrue(body instanceof ObjectSchema);
ObjectSchema impl = (ObjectSchema) body;
assertNotNull(impl.getProperties().get("address"));
}
@Test
public void resolveInlineBodyParameterWithRequired() throws Exception {
OpenAPI openapi = new OpenAPI();
openapi.path("/hello", new Path()
.get(new Operation()
.parameter(new BodyParameter()
.name("body")
.schema(new ObjectSchema()
.addProperties("address", new ObjectSchema()
.addProperties("street", new StringSchema()
.required(true))
.required(true))
.addProperties("name", new StringSchema())))));
new InlineModelResolver().flatten(openapi);
Operation operation = openapi.getPaths().get("/hello").getGet();
BodyParameter bp = (BodyParameter)operation.getParameters().get(0);
assertTrue(bp.getSchema() instanceof RefModel);
Model body = openapi.getComponents().getSchemas().get("body");
assertTrue(body instanceof ObjectSchema);
ObjectSchema impl = (ObjectSchema) body;
assertNotNull(impl.getProperties().get("address"));
Property addressProperty = impl.getProperties().get("address");
assertTrue(addressProperty instanceof Schema);
assertTrue(addressProperty.getRequired());
Model helloAddress = openapi.getComponents().getSchemas().get("hello_address");
assertTrue(helloAddress instanceof ObjectSchema);
ObjectSchema addressImpl = (ObjectSchema) helloAddress;
assertNotNull(addressImpl);
Property streetProperty = addressImpl.getProperties().get("street");
assertTrue(streetProperty instanceof StringSchema);
assertTrue(streetProperty.getRequired());
}
@Test
public void resolveInlineBodyParameterWithTitle() throws Exception {
OpenAPI openapi = new OpenAPI();
@ -426,173 +352,109 @@ public class InlineModelResolverTest {
ObjectSchema impl = (ObjectSchema) body;
assertNotNull(impl.getProperties().get("address"));
}
*/
@Test
public void notResolveNonModelBodyParameter() throws Exception {
OpenAPI openapi = new OpenAPI();
public void nonModelRequestBody() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
openapi.path("/hello", new Path()
.get(new Operation()
.parameter(new BodyParameter()
.name("body")
.schema(new ObjectSchema()
.type("string")
.format("binary")))));
MediaType mediaType = openAPI
.getPaths()
.get("/non_model_request_body")
.getPost()
.getRequestBody()
.getContent()
.get("multipart/form-data");
new InlineModelResolver().flatten(openapi);
Operation operation = openapi.getPaths().get("/hello").getGet();
BodyParameter bp = (BodyParameter)operation.getParameters().get(0);
assertTrue(bp.getSchema() instanceof ObjectSchema);
ObjectSchema m = (ObjectSchema) bp.getSchema();
assertEquals("string", m.getType());
assertEquals("binary", m.getFormat());
assertTrue(mediaType.getSchema() instanceof BinarySchema);
assertEquals("string", mediaType.getSchema().getType());
assertEquals("binary", mediaType.getSchema().getFormat());
}
@Test
public void resolveInlineArrayBodyParameter() throws Exception {
OpenAPI openapi = new OpenAPI();
public void resolveInlineArrayRequestBody() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
openapi.path("/hello", new Path()
.get(new Operation()
.parameter(new BodyParameter()
.name("body")
.schema(new ArraySchema()
.items(new ObjectSchema()
.addProperties("address", new ObjectSchema()
.addProperties("street", new StringSchema())))))));
MediaType mediaType = openAPI
.getPaths()
.get("/resolve_inline_array_request_body")
.getPost()
.getRequestBody()
.getContent()
.get("application/json");
new InlineModelResolver().flatten(openapi);
assertTrue(mediaType.getSchema() instanceof ArraySchema);
Parameter param = openapi.getPaths().get("/hello").getGet().getParameters().get(0);
assertTrue(param instanceof BodyParameter);
ArraySchema requestBody = (ArraySchema) mediaType.getSchema();
assertNotNull(requestBody.getItems().get$ref());
assertEquals("#/components/schemas/NULL_UNIQUE_NAME", requestBody.getItems().get$ref());
BodyParameter bp = (BodyParameter) param;
Model schema = bp.getSchema();
assertTrue(schema instanceof ArraySchema);
ArraySchema am = (ArraySchema) schema;
Property inner = am.getItems();
assertTrue(inner instanceof Schema);
Schema rp = (Schema) inner;
assertEquals(rp.getType(), "ref");
assertEquals(rp.get$ref(), "#/definitions/body");
assertEquals(rp.getSimpleRef(), "body");
Model inline = openapi.getComponents().getSchemas().get("body");
assertNotNull(inline);
assertTrue(inline instanceof ObjectSchema);
ObjectSchema impl = (ObjectSchema) inline;
Schema rpAddress = (Schema) impl.getProperties().get("address");
assertNotNull(rpAddress);
assertEquals(rpAddress.getType(), "ref");
assertEquals(rpAddress.get$ref(), "#/definitions/hello_address");
assertEquals(rpAddress.getSimpleRef(), "hello_address");
Model inlineProp = openapi.getComponents().getSchemas().get("hello_address");
assertNotNull(inlineProp);
assertTrue(inlineProp instanceof ObjectSchema);
ObjectSchema implProp = (ObjectSchema) inlineProp;
assertNotNull(implProp.getProperties().get("street"));
assertTrue(implProp.getProperties().get("street") instanceof StringSchema);
Schema items = ModelUtils.getReferencedSchema(openAPI, ((ArraySchema) mediaType.getSchema()).getItems());
assertTrue(items.getProperties().get("street") instanceof StringSchema);
assertTrue(items.getProperties().get("city") instanceof StringSchema);
}
@Test
public void resolveInlineArrayResponse() throws Exception {
OpenAPI openapi = new OpenAPI();
public void resolveInlineArrayRequestBodyWithTitle() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
ArrayProperty schema = new ArrayProperty()
.items(new ObjectSchema()
.addProperties("name", new StringSchema())
.vendorExtension("x-ext", "ext-items"))
.vendorExtension("x-ext", "ext-prop");
openapi.path("/foo/baz", new Path()
.get(new Operation()
.response(200, new Response()
.vendorExtension("x-foo", "bar")
.description("it works!")
.schema(schema))));
ArraySchema requestBodySchema = (ArraySchema) openAPI
.getPaths()
.get("/resolve_inline_array_request_body_with_title")
.getPost()
.getRequestBody()
.getContent()
.get("application/json")
.getSchema();
new InlineModelResolver().flatten(openapi);
Response response = openapi.getPaths().get("/foo/baz").getGet().getResponses().get("200");
assertNotNull(response);
assertNotNull(response.getSchema());
Property responseProperty = response.getSchema();
// no need to flatten more
assertTrue(responseProperty instanceof ArrayProperty);
ArrayProperty ap = (ArrayProperty) responseProperty;
assertEquals(1, ap.getVendorExtensions().size());
assertEquals("ext-prop", ap.getVendorExtensions().get("x-ext"));
Property p = ap.getItems();
assertNotNull(p);
Schema rp = (Schema) p;
assertEquals(rp.getType(), "ref");
assertEquals(rp.get$ref(), "#/definitions/inline_response_200");
assertEquals(rp.getSimpleRef(), "inline_response_200");
assertEquals(1, rp.getVendorExtensions().size());
assertEquals("ext-items", rp.getVendorExtensions().get("x-ext"));
Model inline = openapi.getComponents().getSchemas().get("inline_response_200");
assertNotNull(inline);
assertTrue(inline instanceof ObjectSchema);
ObjectSchema impl = (ObjectSchema) inline;
assertNotNull(impl.getProperties().get("name"));
assertTrue(impl.getProperties().get("name") instanceof StringSchema);
assertNotNull(requestBodySchema.getItems().get$ref());
assertEquals("#/components/schemas/resolveInlineArrayRequestBodyWithTitleItems", requestBodySchema.getItems().get$ref());
}
@Test
public void resolveInlineArrayResponseWithTitle() throws Exception {
OpenAPI openapi = new OpenAPI();
public void resolveInlineArrayResponse() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
openapi.path("/foo/baz", new Path()
.get(new Operation()
.response(200, new Response()
.vendorExtension("x-foo", "bar")
.description("it works!")
.schema(new ArrayProperty()
.items(new ObjectSchema()
.title("FooBar")
.addProperties("name", new StringSchema()))))));
MediaType mediaType = openAPI
.getPaths()
.get("/resolve_inline_array_response")
.getGet()
.getResponses()
.get("200")
.getContent()
.get("application/json");
new InlineModelResolver().flatten(openapi);
assertTrue(mediaType.getSchema() instanceof ArraySchema);
Response response = openapi.getPaths().get("/foo/baz").getGet().getResponses().get("200");
assertNotNull(response);
ArraySchema responseSchema = (ArraySchema) mediaType.getSchema();
assertEquals("#/components/schemas/inline_response_200", responseSchema.getItems().get$ref());
assertNotNull(response.getSchema());
Property responseProperty = response.getSchema();
// no need to flatten more
assertTrue(responseProperty instanceof ArrayProperty);
ArrayProperty ap = (ArrayProperty) responseProperty;
Property p = ap.getItems();
assertNotNull(p);
Schema rp = (Schema) p;
assertEquals(rp.getType(), "ref");
assertEquals(rp.get$ref(), "#/definitions/"+ "FooBar");
assertEquals(rp.getSimpleRef(), "FooBar");
Model inline = openapi.getComponents().getSchemas().get("FooBar");
assertNotNull(inline);
assertTrue(inline instanceof ObjectSchema);
ObjectSchema impl = (ObjectSchema) inline;
assertNotNull(impl.getProperties().get("name"));
assertTrue(impl.getProperties().get("name") instanceof StringSchema);
Schema items = ModelUtils.getReferencedSchema(openAPI, responseSchema.getItems());
assertTrue(items.getProperties().get("array_response_property") instanceof StringSchema);
}
@Test
public void resolveInlineArrayResponseWithTitle() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);
MediaType mediaType = openAPI
.getPaths()
.get("/resolve_inline_array_response_with_title")
.getGet()
.getResponses()
.get("200")
.getContent()
.get("application/json");
ArraySchema responseSchema = (ArraySchema) mediaType.getSchema();
assertEquals("#/components/schemas/resolveInlineArrayResponseWithTitleItems", responseSchema.getItems().get$ref());
}
/*
@Test
public void testInlineMapResponse() throws Exception {
OpenAPI openapi = new OpenAPI();

View File

@ -19,7 +19,6 @@ package org.openapitools.codegen.options;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.languages.AbstractPhpCodegen;
import org.openapitools.codegen.languages.PhpSlimServerCodegen;
import com.google.common.collect.ImmutableMap;
@ -39,7 +38,6 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider {
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true";
public static final String PHPCS_STANDARD_VALUE = "PSR12";
@Override
public String getLanguage() {
@ -62,7 +60,6 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider {
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
.put(PhpSlimServerCodegen.PHPCS_STANDARD, PHPCS_STANDARD_VALUE)
.build();
}

View File

@ -325,8 +325,7 @@ public class RubyClientCodegenTest {
CodegenParameter name = op.formParams.get(0);
Assert.assertFalse(name.isNullable);
CodegenParameter status = op.formParams.get(1);
// TODO comment out the following until https://github.com/swagger-api/swagger-parser/issues/820 is solved
//Assert.assertTrue(status.isNullable);
Assert.assertTrue(status.isNullable);
}
@Test(description = "test anyOf (OAS3)")

View File

@ -0,0 +1,47 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.slim;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.openapitools.codegen.languages.PhpSlimServerCodegen;
public class PhpSlimServerCodegenTest {
@Test
public void testEncodePath() {
final PhpSlimServerCodegen codegen = new PhpSlimServerCodegen();
Assert.assertEquals(codegen.encodePath("/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r/fake"), "/%20%27%20%22%20%3Dend%20--%20%5C%5Cr%5C%5Cn%20%5C%5Cn%20%5C%5Cr/v2%20*_/%20%27%20%22%20%3Dend%20--%20%5C%5Cr%5C%5Cn%20%5C%5Cn%20%5C%5Cr/fake");
Assert.assertEquals(codegen.encodePath("/o\'\"briens/v2/o\'\"henry/fake"), "/o%27%22briens/v2/o%27%22henry/fake");
Assert.assertEquals(codegen.encodePath("/comedians/Chris D\'Elia"), "/comedians/Chris%20D%27Elia");
Assert.assertEquals(codegen.encodePath("/разработчики/Юрий Беленко"), "/%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%87%D0%B8%D0%BA%D0%B8/%D0%AE%D1%80%D0%B8%D0%B9%20%D0%91%D0%B5%D0%BB%D0%B5%D0%BD%D0%BA%D0%BE");
Assert.assertEquals(codegen.encodePath("/text with multilines \\\n\\\t\\\r"), "/text%20with%20multilines%20%5C%5C%20%5C%5C%20%5C%5C");
Assert.assertEquals(codegen.encodePath("/path with argument {value}"), "/path%20with%20argument%20{value}");
// few examples from Slim documentation
Assert.assertEquals(codegen.encodePath("/users[/{id}]"), "/users[/{id}]");
Assert.assertEquals(codegen.encodePath("/news[/{year}[/{month}]]"), "/news[/{year}[/{month}]]");
Assert.assertEquals(codegen.encodePath("/news[/{params:.*}]"), "/news[/{params:.*}]");
Assert.assertEquals(codegen.encodePath("/users/{id:[0-9]+}"), "/users/{id:[0-9]+}");
// from FastRoute\RouteParser\Std.php
Assert.assertEquals(codegen.encodePath("/user/{name}[/{id:[0-9]+}]"), "/user/{name}[/{id:[0-9]+}]");
Assert.assertEquals(codegen.encodePath("/fixedRoutePart/{varName}[/moreFixed/{varName2:\\d+}]"), "/fixedRoutePart/{varName}[/moreFixed/{varName2:\\d+}]");
}
}

View File

@ -63,8 +63,6 @@ public class PhpSlimServerOptionsTest extends AbstractOptionsTest {
times = 1;
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE));
times = 1;
clientCodegen.setPhpcsStandard(PhpSlimServerOptionsProvider.PHPCS_STANDARD_VALUE);
times = 1;
}};
}
}

View File

@ -0,0 +1,135 @@
openapi: 3.0.1
info:
version: 1.0.0
title: Example
license:
name: MIT
servers:
- url: http://api.example.xyz/v1
paths:
/resolve_inline_request_body:
post:
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
address:
type: object
properties:
street:
type: string
operationId: resolveInlineRequestBody
responses:
'200':
description: OK
/resolve_inline_request_body_with_required:
post:
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
required: true
operationId: resolveInlineRequestBodyWithRequired
responses:
'200':
description: OK
/non_model_request_body:
post:
requestBody:
content:
multipart/form-data:
schema:
type: string
format: binary
operationId: nonModelRequestBody
responses:
'200':
description: OK
/resolve_inline_array_request_body:
post:
requestBody:
content:
application/json:
schema:
type: array
items:
type: object
properties:
street:
type: string
city:
type: string
operationId: resolveInlineArrayRequestBody
responses:
'200':
description: OK
/resolve_inline_array_request_body_with_title:
post:
requestBody:
content:
application/json:
schema:
type: array
items:
title: resolveInlineArrayRequestBodyWithTitleItems
type: object
properties:
street_2:
type: string
city_2:
type: string
operationId: resolveInlineArrayRequestBodyWithTitle
responses:
'200':
description: OK
/resolve_inline_array_response:
get:
operationId: resolveInlineArrayResponse
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
type: object
properties:
array_response_property:
type: string
/resolve_inline_array_response_with_title:
get:
operationId: resolveInlineArrayResponseWithTitle
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
title: resolveInlineArrayResponseWithTitleItems
type: object
properties:
array_response_with_title_property:
type: string
components:
schemas:
Users:
type: array
items:
title: User
type: object
properties:
street:
type: string
city:
type: string

View File

@ -1,12 +1,15 @@
<Properties StartupConfiguration="{19F1DEBC-DE5E-4517-8062-F000CD499087}|Unit Tests">
<MonoDevelop.Ide.Workbench ActiveDocument="src/Org.OpenAPITools.Test/Api/PetApiTests.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="src/Org.OpenAPITools.Test/Model/PetTests.cs">
<Files>
<File FileName="src/Org.OpenAPITools.Test/Api/PetApiTests.cs" Line="302" Column="15" />
<File FileName="src/Org.OpenAPITools/Client/ApiClient.cs" Line="239" Column="82" />
<File FileName="src/Org.OpenAPITools.Test/packages.config" Line="1" Column="1" />
<File FileName="src/Org.OpenAPITools/Api/PetApi.cs" Line="1583" Column="1" />
<File FileName="src/Org.OpenAPITools/Client/ClientUtils.cs" Line="1" Column="1" />
<File FileName="src/Org.OpenAPITools.Test/Model/PetTests.cs" Line="159" Column="29" />
</Files>
<Pads>
<Pad Id="MonoDevelop.UnitTesting.TestPad">
<State name="__root__">
<Node name="Org.OpenAPITools" expanded="True" selected="True" />
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>

View File

@ -71,12 +71,12 @@ namespace Example
{
var apiInstance = new AnotherFakeApi();
var modelClient = new ModelClient(); // ModelClient | client model
var body = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
ModelClient result = apiInstance.Call123TestSpecialTags(body);
Debug.WriteLine(result);
}
catch (Exception e)

View File

@ -9,7 +9,6 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
.\nuget.exe install src\Org.OpenAPITools\packages.config -o packages
if not exist ".\bin" mkdir bin
copy packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll
copy packages\RestSharp.106.5.4\lib\net452\RestSharp.dll bin\RestSharp.dll

View File

@ -44,12 +44,14 @@ ${nuget_cmd} install src/Org.OpenAPITools/packages.config -o packages;
echo "[INFO] Copy DLLs to the 'bin' folder"
mkdir -p bin;
cp packages/CompareNETObjects.4.57.0/lib/net452/KellermanSoftware.Compare-NET-Objects.dll bin/KellermanSoftware.Compare-NET-Objects.dll;
cp packages/Newtonsoft.Json.12.0.1/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/RestSharp.106.5.4/lib/net452/RestSharp.dll bin/RestSharp.dll;
cp packages/JsonSubTypes.1.5.1/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll
echo "[INFO] Run 'mcs' to build bin/Org.OpenAPITools.dll"
mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\
bin/KellermanSoftware.Compare-NET-Objects.dll,\
bin/RestSharp.dll,\
System.ComponentModel.DataAnnotations.dll,\
System.Runtime.Serialization.dll \

View File

@ -9,7 +9,7 @@ Method | HTTP request | Description
<a name="call123testspecialtags"></a>
# **Call123TestSpecialTags**
> ModelClient Call123TestSpecialTags (ModelClient modelClient)
> ModelClient Call123TestSpecialTags (ModelClient body)
To test special tags
@ -30,12 +30,12 @@ namespace Example
public void main()
{
var apiInstance = new AnotherFakeApi();
var modelClient = new ModelClient(); // ModelClient | client model
var body = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
ModelClient result = apiInstance.Call123TestSpecialTags(body);
Debug.WriteLine(result);
}
catch (Exception e)
@ -51,7 +51,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
**body** | [**ModelClient**](ModelClient.md)| client model |
### Return type

View File

@ -80,7 +80,7 @@ No authorization required
<a name="fakeoutercompositeserialize"></a>
# **FakeOuterCompositeSerialize**
> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null)
> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null)
@ -101,11 +101,11 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
try
{
OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite);
OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body);
Debug.WriteLine(result);
}
catch (Exception e)
@ -121,7 +121,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
@ -260,7 +260,7 @@ No authorization required
<a name="testbodywithfileschema"></a>
# **TestBodyWithFileSchema**
> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass)
> void TestBodyWithFileSchema (FileSchemaTestClass body)
@ -281,11 +281,11 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
var body = new FileSchemaTestClass(); // FileSchemaTestClass |
try
{
apiInstance.TestBodyWithFileSchema(fileSchemaTestClass);
apiInstance.TestBodyWithFileSchema(body);
}
catch (Exception e)
{
@ -300,7 +300,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
@ -319,7 +319,7 @@ No authorization required
<a name="testbodywithqueryparams"></a>
# **TestBodyWithQueryParams**
> void TestBodyWithQueryParams (string query, User user)
> void TestBodyWithQueryParams (string query, User body)
@ -339,11 +339,11 @@ namespace Example
{
var apiInstance = new FakeApi();
var query = query_example; // string |
var user = new User(); // User |
var body = new User(); // User |
try
{
apiInstance.TestBodyWithQueryParams(query, user);
apiInstance.TestBodyWithQueryParams(query, body);
}
catch (Exception e)
{
@ -359,7 +359,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **string**| |
**user** | [**User**](User.md)| |
**body** | [**User**](User.md)| |
### Return type
@ -378,7 +378,7 @@ No authorization required
<a name="testclientmodel"></a>
# **TestClientModel**
> ModelClient TestClientModel (ModelClient modelClient)
> ModelClient TestClientModel (ModelClient body)
To test \"client\" model
@ -399,12 +399,12 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var modelClient = new ModelClient(); // ModelClient | client model
var body = new ModelClient(); // ModelClient | client model
try
{
// To test \"client\" model
ModelClient result = apiInstance.TestClientModel(modelClient);
ModelClient result = apiInstance.TestClientModel(body);
Debug.WriteLine(result);
}
catch (Exception e)
@ -420,7 +420,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
**body** | [**ModelClient**](ModelClient.md)| client model |
### Return type
@ -673,7 +673,7 @@ No authorization required
<a name="testinlineadditionalproperties"></a>
# **TestInlineAdditionalProperties**
> void TestInlineAdditionalProperties (Dictionary<string, string> requestBody)
> void TestInlineAdditionalProperties (Dictionary<string, string> param)
test inline additionalProperties
@ -692,12 +692,12 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var requestBody = new Dictionary<string, string>(); // Dictionary<string, string> | request body
var param = new Dictionary<string, string>(); // Dictionary<string, string> | request body
try
{
// test inline additionalProperties
apiInstance.TestInlineAdditionalProperties(requestBody);
apiInstance.TestInlineAdditionalProperties(param);
}
catch (Exception e)
{
@ -712,7 +712,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | [**Dictionary&lt;string, string&gt;**](string.md)| request body |
**param** | [**Dictionary&lt;string, string&gt;**](string.md)| request body |
### Return type

View File

@ -9,7 +9,7 @@ Method | HTTP request | Description
<a name="testclassname"></a>
# **TestClassname**
> ModelClient TestClassname (ModelClient modelClient)
> ModelClient TestClassname (ModelClient body)
To test class name in snake case
@ -35,12 +35,12 @@ namespace Example
// Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer");
var apiInstance = new FakeClassnameTags123Api();
var modelClient = new ModelClient(); // ModelClient | client model
var body = new ModelClient(); // ModelClient | client model
try
{
// To test class name in snake case
ModelClient result = apiInstance.TestClassname(modelClient);
ModelClient result = apiInstance.TestClassname(body);
Debug.WriteLine(result);
}
catch (Exception e)
@ -56,7 +56,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
**body** | [**ModelClient**](ModelClient.md)| client model |
### Return type

View File

@ -17,7 +17,7 @@ Method | HTTP request | Description
<a name="addpet"></a>
# **AddPet**
> void AddPet (Pet pet)
> void AddPet (Pet body)
Add a new pet to the store
@ -39,12 +39,12 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi();
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
var body = new Pet(); // Pet | Pet object that needs to be added to the store
try
{
// Add a new pet to the store
apiInstance.AddPet(pet);
apiInstance.AddPet(body);
}
catch (Exception e)
{
@ -59,7 +59,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@ -335,7 +335,7 @@ Name | Type | Description | Notes
<a name="updatepet"></a>
# **UpdatePet**
> void UpdatePet (Pet pet)
> void UpdatePet (Pet body)
Update an existing pet
@ -357,12 +357,12 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi();
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
var body = new Pet(); // Pet | Pet object that needs to be added to the store
try
{
// Update an existing pet
apiInstance.UpdatePet(pet);
apiInstance.UpdatePet(body);
}
catch (Exception e)
{
@ -377,7 +377,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type

View File

@ -195,7 +195,7 @@ No authorization required
<a name="placeorder"></a>
# **PlaceOrder**
> Order PlaceOrder (Order order)
> Order PlaceOrder (Order body)
Place an order for a pet
@ -214,12 +214,12 @@ namespace Example
public void main()
{
var apiInstance = new StoreApi();
var order = new Order(); // Order | order placed for purchasing the pet
var body = new Order(); // Order | order placed for purchasing the pet
try
{
// Place an order for a pet
Order result = apiInstance.PlaceOrder(order);
Order result = apiInstance.PlaceOrder(body);
Debug.WriteLine(result);
}
catch (Exception e)
@ -235,7 +235,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="createuser"></a>
# **CreateUser**
> void CreateUser (User user)
> void CreateUser (User body)
Create user
@ -37,12 +37,12 @@ namespace Example
public void main()
{
var apiInstance = new UserApi();
var user = new User(); // User | Created user object
var body = new User(); // User | Created user object
try
{
// Create user
apiInstance.CreateUser(user);
apiInstance.CreateUser(body);
}
catch (Exception e)
{
@ -57,7 +57,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**User**](User.md)| Created user object |
**body** | [**User**](User.md)| Created user object |
### Return type
@ -76,7 +76,7 @@ No authorization required
<a name="createuserswitharrayinput"></a>
# **CreateUsersWithArrayInput**
> void CreateUsersWithArrayInput (List<User> user)
> void CreateUsersWithArrayInput (List<User> body)
Creates list of users with given input array
@ -95,12 +95,12 @@ namespace Example
public void main()
{
var apiInstance = new UserApi();
var user = new List<User>(); // List<User> | List of user object
var body = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithArrayInput(user);
apiInstance.CreateUsersWithArrayInput(body);
}
catch (Exception e)
{
@ -115,7 +115,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**List&lt;User&gt;**](List.md)| List of user object |
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type
@ -134,7 +134,7 @@ No authorization required
<a name="createuserswithlistinput"></a>
# **CreateUsersWithListInput**
> void CreateUsersWithListInput (List<User> user)
> void CreateUsersWithListInput (List<User> body)
Creates list of users with given input array
@ -153,12 +153,12 @@ namespace Example
public void main()
{
var apiInstance = new UserApi();
var user = new List<User>(); // List<User> | List of user object
var body = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithListInput(user);
apiInstance.CreateUsersWithListInput(body);
}
catch (Exception e)
{
@ -173,7 +173,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**List&lt;User&gt;**](List.md)| List of user object |
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type
@ -426,7 +426,7 @@ No authorization required
<a name="updateuser"></a>
# **UpdateUser**
> void UpdateUser (string username, User user)
> void UpdateUser (string username, User body)
Updated user
@ -448,12 +448,12 @@ namespace Example
{
var apiInstance = new UserApi();
var username = username_example; // string | name that need to be deleted
var user = new User(); // User | Updated user object
var body = new User(); // User | Updated user object
try
{
// Updated user
apiInstance.UpdateUser(username, user);
apiInstance.UpdateUser(username, body);
}
catch (Exception e)
{
@ -469,7 +469,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **string**| name that need to be deleted |
**user** | [**User**](User.md)| Updated user object |
**body** | [**User**](User.md)| Updated user object |
### Return type

View File

@ -72,7 +72,45 @@ namespace Org.OpenAPITools.Test
[Test]
public void ArrayArrayNumberTest()
{
// TODO unit test for the property 'ArrayArrayNumber'
// 1st instance
ArrayOfArrayOfNumberOnly instance1 = new ArrayOfArrayOfNumberOnly();
List<decimal?> list1 = new List<decimal?>();
list1.Add(11.1m);
list1.Add(8.9m);
List<List<decimal?>> listOfList1 = new List<List<decimal?>>();
listOfList1.Add(list1);
instance1.ArrayArrayNumber = listOfList1;
// 2nd instance
ArrayOfArrayOfNumberOnly instance2 = new ArrayOfArrayOfNumberOnly();
List<decimal?> list2 = new List<decimal?>();
list2.Add(11.1m);
list2.Add(8.9m);
List<List<decimal?>> listOfList2 = new List<List<decimal?>>();
listOfList2.Add(list2);
instance2.ArrayArrayNumber = listOfList2;
Assert.IsTrue(instance1.Equals(instance2));
// add one more element to list2
list2.Add(183.3m);
Assert.IsFalse(instance1.Equals(instance2));
// 3rd instance
ArrayOfArrayOfNumberOnly instance3 = new ArrayOfArrayOfNumberOnly();
List<decimal?> list3 = new List<decimal?>();
list3.Add(11.1m);
list3.Add(1.1m); // not the same as 8.9
List<List<decimal?>> listOfList3 = new List<List<decimal?>>();
instance2.ArrayArrayNumber = listOfList3;
Assert.IsFalse(instance1.Equals(instance3));
}
}

View File

@ -33,9 +33,10 @@ namespace Org.OpenAPITools.Test
[TestFixture]
public class PetTests
{
// TODO uncomment below to declare an instance variable for Pet
//private Pet instance;
private long petId = 11088;
/// <summary>
/// Setup before each test
/// </summary>
@ -115,6 +116,70 @@ namespace Org.OpenAPITools.Test
// TODO unit test for the property 'Status'
}
/// <summary>
/// Test Equal
/// </summary>
[Test()]
public void TestEqual()
{
// create pet
Pet p1 = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
p1.Id = petId;
//p1.Name = "Csharp test";
p1.Status = Pet.StatusEnum.Available;
// create Category object
Category category1 = new Category();
category1.Id = 56;
category1.Name = "sample category name2";
List<String> photoUrls1 = new List<String>(new String[] { "sample photoUrls" });
// create Tag object
Tag tag1 = new Tag();
tag1.Id = petId;
tag1.Name = "csharp sample tag name1";
List<Tag> tags1 = new List<Tag>(new Tag[] { tag1 });
p1.Tags = tags1;
p1.Category = category1;
p1.PhotoUrls = photoUrls1;
// create pet 2
Pet p2 = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
p2.Id = petId;
p2.Name = "Csharp test";
p2.Status = Pet.StatusEnum.Available;
// create Category object
Category category2 = new Category();
category2.Id = 56;
category2.Name = "sample category name2";
List<String> photoUrls2 = new List<String>(new String[] { "sample photoUrls" });
// create Tag object
Tag tag2 = new Tag();
tag2.Id = petId;
tag2.Name = "csharp sample tag name1";
List<Tag> tags2 = new List<Tag>(new Tag[] { tag2 });
p2.Tags = tags2;
p2.Category = category2;
p2.PhotoUrls = photoUrls2;
// p1 and p2 should be equal (both object and attribute level)
Assert.IsTrue(category1.Equals(category2));
Assert.IsTrue(tags1.SequenceEqual(tags2));
Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.IsTrue(p1.Equals(p2));
// update attribute to that p1 and p2 are not equal
category2.Name = "new category name";
Assert.IsFalse(category1.Equals(category2));
tags2 = new List<Tag>();
Assert.IsFalse(tags1.SequenceEqual(tags2));
// photoUrls has not changed so it should be equal
Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.IsFalse(p1.Equals(p2));
}
}
}

View File

@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api
/// To test special tags and operation ID starting with number
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ModelClient</returns>
ModelClient Call123TestSpecialTags (ModelClient modelClient);
ModelClient Call123TestSpecialTags (ModelClient body);
/// <summary>
/// To test special tags
@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api
/// To test special tags and operation ID starting with number
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
ApiResponse<ModelClient> Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient);
ApiResponse<ModelClient> Call123TestSpecialTagsWithHttpInfo (ModelClient body);
#endregion Synchronous Operations
}
@ -64,9 +64,9 @@ namespace Org.OpenAPITools.Api
/// To test special tags and operation ID starting with number
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ModelClient</returns>
System.Threading.Tasks.Task<ModelClient> Call123TestSpecialTagsAsync (ModelClient modelClient);
System.Threading.Tasks.Task<ModelClient> Call123TestSpecialTagsAsync (ModelClient body);
/// <summary>
/// To test special tags
@ -75,9 +75,9 @@ namespace Org.OpenAPITools.Api
/// To test special tags and operation ID starting with number
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
System.Threading.Tasks.Task<ApiResponse<ModelClient>> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient);
System.Threading.Tasks.Task<ApiResponse<ModelClient>> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body);
#endregion Asynchronous Operations
}
@ -202,11 +202,11 @@ namespace Org.OpenAPITools.Api
/// To test special tags To test special tags and operation ID starting with number
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ModelClient</returns>
public ModelClient Call123TestSpecialTags (ModelClient modelClient)
public ModelClient Call123TestSpecialTags (ModelClient body)
{
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = Call123TestSpecialTagsWithHttpInfo(modelClient);
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = Call123TestSpecialTagsWithHttpInfo(body);
return localVarResponse.Data;
}
@ -214,13 +214,13 @@ namespace Org.OpenAPITools.Api
/// To test special tags To test special tags and operation ID starting with number
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient)
public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body)
{
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -239,7 +239,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = modelClient;
requestOptions.Data = body;
// make the HTTP request
@ -259,11 +259,11 @@ namespace Org.OpenAPITools.Api
/// To test special tags To test special tags and operation ID starting with number
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ModelClient</returns>
public async System.Threading.Tasks.Task<ModelClient> Call123TestSpecialTagsAsync (ModelClient modelClient)
public async System.Threading.Tasks.Task<ModelClient> Call123TestSpecialTagsAsync (ModelClient body)
{
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(modelClient);
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body);
return localVarResponse.Data;
}
@ -272,13 +272,13 @@ namespace Org.OpenAPITools.Api
/// To test special tags To test special tags and operation ID starting with number
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ModelClient>> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ModelClient>> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body)
{
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -297,7 +297,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = modelClient;
requestOptions.Data = body;
// make the HTTP request

View File

@ -55,9 +55,9 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>OuterComposite</returns>
OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null);
OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null);
/// <summary>
///
@ -66,9 +66,9 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>ApiResponse of OuterComposite</returns>
ApiResponse<OuterComposite> FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null);
ApiResponse<OuterComposite> FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null);
/// <summary>
///
/// </summary>
@ -118,9 +118,9 @@ namespace Org.OpenAPITools.Api
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns></returns>
void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass);
void TestBodyWithFileSchema (FileSchemaTestClass body);
/// <summary>
///
@ -129,9 +129,9 @@ namespace Org.OpenAPITools.Api
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass);
ApiResponse<Object> TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body);
/// <summary>
///
/// </summary>
@ -140,9 +140,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns></returns>
void TestBodyWithQueryParams (string query, User user);
void TestBodyWithQueryParams (string query, User body);
/// <summary>
///
@ -152,9 +152,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> TestBodyWithQueryParamsWithHttpInfo (string query, User user);
ApiResponse<Object> TestBodyWithQueryParamsWithHttpInfo (string query, User body);
/// <summary>
/// To test \&quot;client\&quot; model
/// </summary>
@ -162,9 +162,9 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ModelClient</returns>
ModelClient TestClientModel (ModelClient modelClient);
ModelClient TestClientModel (ModelClient body);
/// <summary>
/// To test \&quot;client\&quot; model
@ -173,9 +173,9 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
ApiResponse<ModelClient> TestClientModelWithHttpInfo (ModelClient modelClient);
ApiResponse<ModelClient> TestClientModelWithHttpInfo (ModelClient body);
/// <summary>
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary>
@ -296,9 +296,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns></returns>
void TestInlineAdditionalProperties (Dictionary<string, string> requestBody);
void TestInlineAdditionalProperties (Dictionary<string, string> param);
/// <summary>
/// test inline additionalProperties
@ -307,9 +307,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> TestInlineAdditionalPropertiesWithHttpInfo (Dictionary<string, string> requestBody);
ApiResponse<Object> TestInlineAdditionalPropertiesWithHttpInfo (Dictionary<string, string> param);
/// <summary>
/// test json serialization of form data
/// </summary>
@ -370,9 +370,9 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>Task of OuterComposite</returns>
System.Threading.Tasks.Task<OuterComposite> FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null);
System.Threading.Tasks.Task<OuterComposite> FakeOuterCompositeSerializeAsync (OuterComposite body = null);
/// <summary>
///
@ -381,9 +381,9 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>Task of ApiResponse (OuterComposite)</returns>
System.Threading.Tasks.Task<ApiResponse<OuterComposite>> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null);
System.Threading.Tasks.Task<ApiResponse<OuterComposite>> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null);
/// <summary>
///
/// </summary>
@ -433,9 +433,9 @@ namespace Org.OpenAPITools.Api
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass);
System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body);
/// <summary>
///
@ -444,9 +444,9 @@ namespace Org.OpenAPITools.Api
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass);
System.Threading.Tasks.Task<ApiResponse<Object>> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body);
/// <summary>
///
/// </summary>
@ -455,9 +455,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user);
System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body);
/// <summary>
///
@ -467,9 +467,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user);
System.Threading.Tasks.Task<ApiResponse<Object>> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body);
/// <summary>
/// To test \&quot;client\&quot; model
/// </summary>
@ -477,9 +477,9 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ModelClient</returns>
System.Threading.Tasks.Task<ModelClient> TestClientModelAsync (ModelClient modelClient);
System.Threading.Tasks.Task<ModelClient> TestClientModelAsync (ModelClient body);
/// <summary>
/// To test \&quot;client\&quot; model
@ -488,9 +488,9 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClientModelAsyncWithHttpInfo (ModelClient modelClient);
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClientModelAsyncWithHttpInfo (ModelClient body);
/// <summary>
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary>
@ -611,9 +611,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary<string, string> requestBody);
System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary<string, string> param);
/// <summary>
/// test inline additionalProperties
@ -622,9 +622,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary<string, string> requestBody);
System.Threading.Tasks.Task<ApiResponse<Object>> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary<string, string> param);
/// <summary>
/// test json serialization of form data
/// </summary>
@ -879,11 +879,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>OuterComposite</returns>
public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null)
public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null)
{
Org.OpenAPITools.Client.ApiResponse<OuterComposite> localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite);
Org.OpenAPITools.Client.ApiResponse<OuterComposite> localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body);
return localVarResponse.Data;
}
@ -891,9 +891,9 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>ApiResponse of OuterComposite</returns>
public Org.OpenAPITools.Client.ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null)
public Org.OpenAPITools.Client.ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null)
{
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -912,7 +912,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = outerComposite;
requestOptions.Data = body;
// make the HTTP request
@ -932,11 +932,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>Task of OuterComposite</returns>
public async System.Threading.Tasks.Task<OuterComposite> FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null)
public async System.Threading.Tasks.Task<OuterComposite> FakeOuterCompositeSerializeAsync (OuterComposite body = null)
{
Org.OpenAPITools.Client.ApiResponse<OuterComposite> localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(outerComposite);
Org.OpenAPITools.Client.ApiResponse<OuterComposite> localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body);
return localVarResponse.Data;
}
@ -945,9 +945,9 @@ namespace Org.OpenAPITools.Api
/// Test serialization of object with outer number type
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="outerComposite">Input composite as post body (optional)</param>
/// <param name="body">Input composite as post body (optional)</param>
/// <returns>Task of ApiResponse (OuterComposite)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<OuterComposite>> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<OuterComposite>> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null)
{
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -966,7 +966,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = outerComposite;
requestOptions.Data = body;
// make the HTTP request
@ -1200,24 +1200,24 @@ namespace Org.OpenAPITools.Api
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns></returns>
public void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass)
public void TestBodyWithFileSchema (FileSchemaTestClass body)
{
TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
TestBodyWithFileSchemaWithHttpInfo(body);
}
/// <summary>
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass)
public Org.OpenAPITools.Client.ApiResponse<Object> TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body)
{
// verify the required parameter 'fileSchemaTestClass' is set
if (fileSchemaTestClass == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1235,7 +1235,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = fileSchemaTestClass;
requestOptions.Data = body;
// make the HTTP request
@ -1255,11 +1255,11 @@ namespace Org.OpenAPITools.Api
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass)
public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body)
{
await TestBodyWithFileSchemaAsyncWithHttpInfo(fileSchemaTestClass);
await TestBodyWithFileSchemaAsyncWithHttpInfo(body);
}
@ -1267,13 +1267,13 @@ namespace Org.OpenAPITools.Api
/// For this test, the body for this request much reference a schema named &#x60;File&#x60;.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="fileSchemaTestClass"></param>
/// <param name="body"></param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body)
{
// verify the required parameter 'fileSchemaTestClass' is set
if (fileSchemaTestClass == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1291,7 +1291,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = fileSchemaTestClass;
requestOptions.Data = body;
// make the HTTP request
@ -1312,11 +1312,11 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns></returns>
public void TestBodyWithQueryParams (string query, User user)
public void TestBodyWithQueryParams (string query, User body)
{
TestBodyWithQueryParamsWithHttpInfo(query, user);
TestBodyWithQueryParamsWithHttpInfo(query, body);
}
/// <summary>
@ -1324,16 +1324,16 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> TestBodyWithQueryParamsWithHttpInfo (string query, User user)
public Org.OpenAPITools.Client.ApiResponse<Object> TestBodyWithQueryParamsWithHttpInfo (string query, User body)
{
// verify the required parameter 'query' is set
if (query == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams");
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1361,7 +1361,7 @@ namespace Org.OpenAPITools.Api
}
}
}
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -1382,11 +1382,11 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user)
public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body)
{
await TestBodyWithQueryParamsAsyncWithHttpInfo(query, user);
await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body);
}
@ -1395,16 +1395,16 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query"></param>
/// <param name="user"></param>
/// <param name="body"></param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body)
{
// verify the required parameter 'query' is set
if (query == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams");
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1432,7 +1432,7 @@ namespace Org.OpenAPITools.Api
}
}
}
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -1452,11 +1452,11 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ModelClient</returns>
public ModelClient TestClientModel (ModelClient modelClient)
public ModelClient TestClientModel (ModelClient body)
{
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = TestClientModelWithHttpInfo(modelClient);
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = TestClientModelWithHttpInfo(body);
return localVarResponse.Data;
}
@ -1464,13 +1464,13 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient modelClient)
public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body)
{
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1489,7 +1489,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = modelClient;
requestOptions.Data = body;
// make the HTTP request
@ -1509,11 +1509,11 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ModelClient</returns>
public async System.Threading.Tasks.Task<ModelClient> TestClientModelAsync (ModelClient modelClient)
public async System.Threading.Tasks.Task<ModelClient> TestClientModelAsync (ModelClient body)
{
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = await TestClientModelAsyncWithHttpInfo(modelClient);
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = await TestClientModelAsyncWithHttpInfo(body);
return localVarResponse.Data;
}
@ -1522,13 +1522,13 @@ namespace Org.OpenAPITools.Api
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ModelClient>> TestClientModelAsyncWithHttpInfo (ModelClient modelClient)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ModelClient>> TestClientModelAsyncWithHttpInfo (ModelClient body)
{
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1547,7 +1547,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = modelClient;
requestOptions.Data = body;
// make the HTTP request
@ -2332,24 +2332,24 @@ namespace Org.OpenAPITools.Api
/// test inline additionalProperties
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns></returns>
public void TestInlineAdditionalProperties (Dictionary<string, string> requestBody)
public void TestInlineAdditionalProperties (Dictionary<string, string> param)
{
TestInlineAdditionalPropertiesWithHttpInfo(requestBody);
TestInlineAdditionalPropertiesWithHttpInfo(param);
}
/// <summary>
/// test inline additionalProperties
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> TestInlineAdditionalPropertiesWithHttpInfo (Dictionary<string, string> requestBody)
public Org.OpenAPITools.Client.ApiResponse<Object> TestInlineAdditionalPropertiesWithHttpInfo (Dictionary<string, string> param)
{
// verify the required parameter 'requestBody' is set
if (requestBody == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties");
// verify the required parameter 'param' is set
if (param == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -2367,7 +2367,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = requestBody;
requestOptions.Data = param;
// make the HTTP request
@ -2387,11 +2387,11 @@ namespace Org.OpenAPITools.Api
/// test inline additionalProperties
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary<string, string> requestBody)
public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary<string, string> param)
{
await TestInlineAdditionalPropertiesAsyncWithHttpInfo(requestBody);
await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param);
}
@ -2399,13 +2399,13 @@ namespace Org.OpenAPITools.Api
/// test inline additionalProperties
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requestBody">request body</param>
/// <param name="param">request body</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary<string, string> requestBody)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary<string, string> param)
{
// verify the required parameter 'requestBody' is set
if (requestBody == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties");
// verify the required parameter 'param' is set
if (param == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -2423,7 +2423,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = requestBody;
requestOptions.Data = param;
// make the HTTP request

View File

@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ModelClient</returns>
ModelClient TestClassname (ModelClient modelClient);
ModelClient TestClassname (ModelClient body);
/// <summary>
/// To test class name in snake case
@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
ApiResponse<ModelClient> TestClassnameWithHttpInfo (ModelClient modelClient);
ApiResponse<ModelClient> TestClassnameWithHttpInfo (ModelClient body);
#endregion Synchronous Operations
}
@ -64,9 +64,9 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ModelClient</returns>
System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient modelClient);
System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient body);
/// <summary>
/// To test class name in snake case
@ -75,9 +75,9 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient modelClient);
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient body);
#endregion Asynchronous Operations
}
@ -202,11 +202,11 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ModelClient</returns>
public ModelClient TestClassname (ModelClient modelClient)
public ModelClient TestClassname (ModelClient body)
{
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = TestClassnameWithHttpInfo(modelClient);
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = TestClassnameWithHttpInfo(body);
return localVarResponse.Data;
}
@ -214,13 +214,13 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient)
public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body)
{
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -239,7 +239,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = modelClient;
requestOptions.Data = body;
// authentication (api_key_query) required
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
@ -270,11 +270,11 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ModelClient</returns>
public async System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient modelClient)
public async System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient body)
{
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = await TestClassnameAsyncWithHttpInfo(modelClient);
Org.OpenAPITools.Client.ApiResponse<ModelClient> localVarResponse = await TestClassnameAsyncWithHttpInfo(body);
return localVarResponse.Data;
}
@ -283,13 +283,13 @@ namespace Org.OpenAPITools.Api
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="modelClient">client model</param>
/// <param name="body">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient modelClient)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient body)
{
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -308,7 +308,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = modelClient;
requestOptions.Data = body;
// authentication (api_key_query) required
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))

View File

@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
void AddPet (Pet pet);
void AddPet (Pet body);
/// <summary>
/// Add a new pet to the store
@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> AddPetWithHttpInfo (Pet pet);
ApiResponse<Object> AddPetWithHttpInfo (Pet body);
/// <summary>
/// Deletes a pet
/// </summary>
@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
void UpdatePet (Pet pet);
void UpdatePet (Pet body);
/// <summary>
/// Update an existing pet
@ -152,9 +152,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> UpdatePetWithHttpInfo (Pet pet);
ApiResponse<Object> UpdatePetWithHttpInfo (Pet body);
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
@ -246,9 +246,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task AddPetAsync (Pet pet);
System.Threading.Tasks.Task AddPetAsync (Pet body);
/// <summary>
/// Add a new pet to the store
@ -257,9 +257,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet pet);
System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet body);
/// <summary>
/// Deletes a pet
/// </summary>
@ -353,9 +353,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task UpdatePetAsync (Pet pet);
System.Threading.Tasks.Task UpdatePetAsync (Pet body);
/// <summary>
/// Update an existing pet
@ -364,9 +364,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet pet);
System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet body);
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
@ -566,24 +566,24 @@ namespace Org.OpenAPITools.Api
/// Add a new pet to the store
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
public void AddPet (Pet pet)
public void AddPet (Pet body)
{
AddPetWithHttpInfo(pet);
AddPetWithHttpInfo(body);
}
/// <summary>
/// Add a new pet to the store
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> AddPetWithHttpInfo (Pet pet)
public Org.OpenAPITools.Client.ApiResponse<Object> AddPetWithHttpInfo (Pet body)
{
// verify the required parameter 'pet' is set
if (pet == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -602,7 +602,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = pet;
requestOptions.Data = body;
// authentication (petstore_auth) required
// oauth required
@ -628,11 +628,11 @@ namespace Org.OpenAPITools.Api
/// Add a new pet to the store
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task AddPetAsync (Pet pet)
public async System.Threading.Tasks.Task AddPetAsync (Pet body)
{
await AddPetAsyncWithHttpInfo(pet);
await AddPetAsyncWithHttpInfo(body);
}
@ -640,13 +640,13 @@ namespace Org.OpenAPITools.Api
/// Add a new pet to the store
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet pet)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet body)
{
// verify the required parameter 'pet' is set
if (pet == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -665,7 +665,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = pet;
requestOptions.Data = body;
// authentication (petstore_auth) required
// oauth required
@ -1239,24 +1239,24 @@ namespace Org.OpenAPITools.Api
/// Update an existing pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
public void UpdatePet (Pet pet)
public void UpdatePet (Pet body)
{
UpdatePetWithHttpInfo(pet);
UpdatePetWithHttpInfo(body);
}
/// <summary>
/// Update an existing pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> UpdatePetWithHttpInfo (Pet pet)
public Org.OpenAPITools.Client.ApiResponse<Object> UpdatePetWithHttpInfo (Pet body)
{
// verify the required parameter 'pet' is set
if (pet == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1275,7 +1275,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = pet;
requestOptions.Data = body;
// authentication (petstore_auth) required
// oauth required
@ -1301,11 +1301,11 @@ namespace Org.OpenAPITools.Api
/// Update an existing pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet)
public async System.Threading.Tasks.Task UpdatePetAsync (Pet body)
{
await UpdatePetAsyncWithHttpInfo(pet);
await UpdatePetAsyncWithHttpInfo(body);
}
@ -1313,13 +1313,13 @@ namespace Org.OpenAPITools.Api
/// Update an existing pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet pet)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet body)
{
// verify the required parameter 'pet' is set
if (pet == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1338,7 +1338,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = pet;
requestOptions.Data = body;
// authentication (petstore_auth) required
// oauth required

View File

@ -95,9 +95,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
Order PlaceOrder (Order order);
Order PlaceOrder (Order body);
/// <summary>
/// Place an order for a pet
@ -106,9 +106,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
ApiResponse<Order> PlaceOrderWithHttpInfo (Order order);
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
#endregion Synchronous Operations
}
@ -186,9 +186,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Task of Order</returns>
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order order);
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body);
/// <summary>
/// Place an order for a pet
@ -197,9 +197,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Task of ApiResponse (Order)</returns>
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order order);
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body);
#endregion Asynchronous Operations
}
@ -663,11 +663,11 @@ namespace Org.OpenAPITools.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
public Order PlaceOrder (Order order)
public Order PlaceOrder (Order body)
{
Org.OpenAPITools.Client.ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(order);
Org.OpenAPITools.Client.ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(body);
return localVarResponse.Data;
}
@ -675,13 +675,13 @@ namespace Org.OpenAPITools.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Order order)
public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Order body)
{
// verify the required parameter 'order' is set
if (order == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -700,7 +700,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = order;
requestOptions.Data = body;
// make the HTTP request
@ -720,11 +720,11 @@ namespace Org.OpenAPITools.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Task of Order</returns>
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order order)
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body)
{
Org.OpenAPITools.Client.ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(order);
Org.OpenAPITools.Client.ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(body);
return localVarResponse.Data;
}
@ -733,13 +733,13 @@ namespace Org.OpenAPITools.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="order">order placed for purchasing the pet</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Task of ApiResponse (Order)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order order)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body)
{
// verify the required parameter 'order' is set
if (order == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -758,7 +758,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = order;
requestOptions.Data = body;
// make the HTTP request

View File

@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns></returns>
void CreateUser (User user);
void CreateUser (User body);
/// <summary>
/// Create user
@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUserWithHttpInfo (User user);
ApiResponse<Object> CreateUserWithHttpInfo (User body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@ -55,9 +55,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
void CreateUsersWithArrayInput (List<User> user);
void CreateUsersWithArrayInput (List<User> body);
/// <summary>
/// Creates list of users with given input array
@ -66,9 +66,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> user);
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@ -76,9 +76,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
void CreateUsersWithListInput (List<User> user);
void CreateUsersWithListInput (List<User> body);
/// <summary>
/// Creates list of users with given input array
@ -87,9 +87,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> user);
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body);
/// <summary>
/// Delete user
/// </summary>
@ -182,9 +182,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
void UpdateUser (string username, User user);
void UpdateUser (string username, User body);
/// <summary>
/// Updated user
@ -194,9 +194,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User user);
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body);
#endregion Synchronous Operations
}
@ -213,9 +213,9 @@ namespace Org.OpenAPITools.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUserAsync (User user);
System.Threading.Tasks.Task CreateUserAsync (User body);
/// <summary>
/// Create user
@ -224,9 +224,9 @@ namespace Org.OpenAPITools.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User user);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@ -234,9 +234,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> user);
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body);
/// <summary>
/// Creates list of users with given input array
@ -245,9 +245,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> user);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@ -255,9 +255,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> user);
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body);
/// <summary>
/// Creates list of users with given input array
@ -266,9 +266,9 @@ namespace Org.OpenAPITools.Api
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> user);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body);
/// <summary>
/// Delete user
/// </summary>
@ -361,9 +361,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task UpdateUserAsync (string username, User user);
System.Threading.Tasks.Task UpdateUserAsync (string username, User body);
/// <summary>
/// Updated user
@ -373,9 +373,9 @@ namespace Org.OpenAPITools.Api
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User user);
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body);
#endregion Asynchronous Operations
}
@ -500,24 +500,24 @@ namespace Org.OpenAPITools.Api
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns></returns>
public void CreateUser (User user)
public void CreateUser (User body)
{
CreateUserWithHttpInfo(user);
CreateUserWithHttpInfo(body);
}
/// <summary>
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> CreateUserWithHttpInfo (User user)
public Org.OpenAPITools.Client.ApiResponse<Object> CreateUserWithHttpInfo (User body)
{
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -534,7 +534,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -554,11 +554,11 @@ namespace Org.OpenAPITools.Api
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUserAsync (User user)
public async System.Threading.Tasks.Task CreateUserAsync (User body)
{
await CreateUserAsyncWithHttpInfo(user);
await CreateUserAsyncWithHttpInfo(body);
}
@ -566,13 +566,13 @@ namespace Org.OpenAPITools.Api
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">Created user object</param>
/// <param name="body">Created user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User user)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body)
{
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -589,7 +589,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -609,24 +609,24 @@ namespace Org.OpenAPITools.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
public void CreateUsersWithArrayInput (List<User> user)
public void CreateUsersWithArrayInput (List<User> body)
{
CreateUsersWithArrayInputWithHttpInfo(user);
CreateUsersWithArrayInputWithHttpInfo(body);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> user)
public Org.OpenAPITools.Client.ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body)
{
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -643,7 +643,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -663,11 +663,11 @@ namespace Org.OpenAPITools.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> user)
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body)
{
await CreateUsersWithArrayInputAsyncWithHttpInfo(user);
await CreateUsersWithArrayInputAsyncWithHttpInfo(body);
}
@ -675,13 +675,13 @@ namespace Org.OpenAPITools.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> user)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body)
{
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -698,7 +698,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -718,24 +718,24 @@ namespace Org.OpenAPITools.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
public void CreateUsersWithListInput (List<User> user)
public void CreateUsersWithListInput (List<User> body)
{
CreateUsersWithListInputWithHttpInfo(user);
CreateUsersWithListInputWithHttpInfo(body);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> user)
public Org.OpenAPITools.Client.ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body)
{
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -752,7 +752,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -772,11 +772,11 @@ namespace Org.OpenAPITools.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> user)
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body)
{
await CreateUsersWithListInputAsyncWithHttpInfo(user);
await CreateUsersWithListInputAsyncWithHttpInfo(body);
}
@ -784,13 +784,13 @@ namespace Org.OpenAPITools.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="user">List of user object</param>
/// <param name="body">List of user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> user)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body)
{
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -807,7 +807,7 @@ namespace Org.OpenAPITools.Api
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -1316,11 +1316,11 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
public void UpdateUser (string username, User user)
public void UpdateUser (string username, User body)
{
UpdateUserWithHttpInfo(username, user);
UpdateUserWithHttpInfo(username, body);
}
/// <summary>
@ -1328,16 +1328,16 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> UpdateUserWithHttpInfo (string username, User user)
public Org.OpenAPITools.Client.ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body)
{
// verify the required parameter 'username' is set
if (username == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1356,7 +1356,7 @@ namespace Org.OpenAPITools.Api
if (username != null)
requestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request
@ -1377,11 +1377,11 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User user)
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body)
{
await UpdateUserAsyncWithHttpInfo(username, user);
await UpdateUserAsyncWithHttpInfo(username, body);
}
@ -1390,16 +1390,16 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="user">Updated user object</param>
/// <param name="body">Updated user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User user)
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body)
{
// verify the required parameter 'username' is set
if (username == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
// verify the required parameter 'user' is set
if (user == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser");
// verify the required parameter 'body' is set
if (body == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1418,7 +1418,7 @@ namespace Org.OpenAPITools.Api
if (username != null)
requestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter
requestOptions.Data = user;
requestOptions.Data = body;
// make the HTTP request

View File

@ -18,6 +18,7 @@ using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using KellermanSoftware.CompareNetObjects;
namespace Org.OpenAPITools.Client
{
@ -26,6 +27,19 @@ namespace Org.OpenAPITools.Client
/// </summary>
public static class ClientUtils
{
/// <summary>
/// An instance of CompareLogic.
/// </summary>
public static CompareLogic compareLogic;
/// <summary>
/// Static contstructor to initialise compareLogic.
/// </summary>
static ClientUtils()
{
compareLogic = new CompareLogic();
}
/// <summary>
/// Sanitize filename by removing the path
/// </summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -84,7 +85,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as AdditionalPropertiesClass);
return OpenAPIClientUtils.compareLogic.Compare(this, input as AdditionalPropertiesClass).AreEqual;
}
/// <summary>
@ -94,20 +95,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(AdditionalPropertiesClass input)
{
if (input == null)
return false;
return
(
this.MapProperty == input.MapProperty ||
this.MapProperty != null &&
this.MapProperty.SequenceEqual(input.MapProperty)
) &&
(
this.MapOfMapProperty == input.MapOfMapProperty ||
this.MapOfMapProperty != null &&
this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty)
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -23,6 +23,7 @@ using Newtonsoft.Json.Converters;
using JsonSubTypes;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -30,7 +31,7 @@ namespace Org.OpenAPITools.Model
/// Animal
/// </summary>
[DataContract]
[JsonConverter(typeof(JsonSubtypes), "className")]
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
public partial class Animal : IEquatable<Animal>, IValidatableObject
@ -109,7 +110,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as Animal);
return OpenAPIClientUtils.compareLogic.Compare(this, input as Animal).AreEqual;
}
/// <summary>
@ -119,20 +120,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(Animal input)
{
if (input == null)
return false;
return
(
this.ClassName == input.ClassName ||
(this.ClassName != null &&
this.ClassName.Equals(input.ClassName))
) &&
(
this.Color == input.Color ||
(this.Color != null &&
this.Color.Equals(input.Color))
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -93,7 +94,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as ApiResponse);
return OpenAPIClientUtils.compareLogic.Compare(this, input as ApiResponse).AreEqual;
}
/// <summary>
@ -103,25 +104,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(ApiResponse input)
{
if (input == null)
return false;
return
(
this.Code == input.Code ||
(this.Code != null &&
this.Code.Equals(input.Code))
) &&
(
this.Type == input.Type ||
(this.Type != null &&
this.Type.Equals(input.Type))
) &&
(
this.Message == input.Message ||
(this.Message != null &&
this.Message.Equals(input.Message))
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as ArrayOfArrayOfNumberOnly);
return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfArrayOfNumberOnly).AreEqual;
}
/// <summary>
@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(ArrayOfArrayOfNumberOnly input)
{
if (input == null)
return false;
return
(
this.ArrayArrayNumber == input.ArrayArrayNumber ||
this.ArrayArrayNumber != null &&
this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber)
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as ArrayOfNumberOnly);
return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfNumberOnly).AreEqual;
}
/// <summary>
@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(ArrayOfNumberOnly input)
{
if (input == null)
return false;
return
(
this.ArrayNumber == input.ArrayNumber ||
this.ArrayNumber != null &&
this.ArrayNumber.SequenceEqual(input.ArrayNumber)
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -93,7 +94,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as ArrayTest);
return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayTest).AreEqual;
}
/// <summary>
@ -103,25 +104,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(ArrayTest input)
{
if (input == null)
return false;
return
(
this.ArrayOfString == input.ArrayOfString ||
this.ArrayOfString != null &&
this.ArrayOfString.SequenceEqual(input.ArrayOfString)
) &&
(
this.ArrayArrayOfInteger == input.ArrayArrayOfInteger ||
this.ArrayArrayOfInteger != null &&
this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger)
) &&
(
this.ArrayArrayOfModel == input.ArrayArrayOfModel ||
this.ArrayArrayOfModel != null &&
this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel)
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -121,7 +122,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as Capitalization);
return OpenAPIClientUtils.compareLogic.Compare(this, input as Capitalization).AreEqual;
}
/// <summary>
@ -131,40 +132,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(Capitalization input)
{
if (input == null)
return false;
return
(
this.SmallCamel == input.SmallCamel ||
(this.SmallCamel != null &&
this.SmallCamel.Equals(input.SmallCamel))
) &&
(
this.CapitalCamel == input.CapitalCamel ||
(this.CapitalCamel != null &&
this.CapitalCamel.Equals(input.CapitalCamel))
) &&
(
this.SmallSnake == input.SmallSnake ||
(this.SmallSnake != null &&
this.SmallSnake.Equals(input.SmallSnake))
) &&
(
this.CapitalSnake == input.CapitalSnake ||
(this.CapitalSnake != null &&
this.CapitalSnake.Equals(input.CapitalSnake))
) &&
(
this.SCAETHFlowPoints == input.SCAETHFlowPoints ||
(this.SCAETHFlowPoints != null &&
this.SCAETHFlowPoints.Equals(input.SCAETHFlowPoints))
) &&
(
this.ATT_NAME == input.ATT_NAME ||
(this.ATT_NAME != null &&
this.ATT_NAME.Equals(input.ATT_NAME))
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -83,7 +84,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as Cat);
return OpenAPIClientUtils.compareLogic.Compare(this, input as Cat).AreEqual;
}
/// <summary>
@ -93,15 +94,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(Cat input)
{
if (input == null)
return false;
return base.Equals(input) &&
(
this.Declawed == input.Declawed ||
(this.Declawed != null &&
this.Declawed.Equals(input.Declawed))
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -97,7 +98,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as Category);
return OpenAPIClientUtils.compareLogic.Compare(this, input as Category).AreEqual;
}
/// <summary>
@ -107,20 +108,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(Category input)
{
if (input == null)
return false;
return
(
this.Id == input.Id ||
(this.Id != null &&
this.Id.Equals(input.Id))
) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

View File

@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as ClassModel);
return OpenAPIClientUtils.compareLogic.Compare(this, input as ClassModel).AreEqual;
}
/// <summary>
@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Boolean</returns>
public bool Equals(ClassModel input)
{
if (input == null)
return false;
return
(
this.Class == input.Class ||
(this.Class != null &&
this.Class.Equals(input.Class))
);
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>

Some files were not shown because too many files have changed in this diff Show More