mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 02:55:19 +00:00
Merge branch 'upstream-master' into feature/objc-sessionmanager-integration
* upstream-master: update JAR URL to 2.2.0 updated dev versions set interface with discriminator as parent null check updated readme updated versions for release update java petstore sample derive invoker package name from api/modoel package name
This commit is contained in:
commit
e73f2a5c64
@ -59,8 +59,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
|
||||
-------------------------- | ------------ | -------------------------- | -----
|
||||
2.2.0-SNAPSHOT | | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen)
|
||||
2.1.6 (**current stable**) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6)
|
||||
2.2.0 (**current stable**) | 2016-07-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.0](https://github.com/swagger-api/swagger-codegen/tree/v2.2.0)
|
||||
2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6)
|
||||
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17)
|
||||
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
|
||||
|
||||
@ -69,7 +69,7 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes
|
||||
If you're looking for the latest stable version, you can grab it directly from maven central (you'll need java 7 runtime at a minimum):
|
||||
|
||||
```
|
||||
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.1.6/swagger-codegen-cli-2.1.6.jar -O swagger-codegen-cli.jar
|
||||
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.0/swagger-codegen-cli-2.2.0.jar -O swagger-codegen-cli.jar
|
||||
|
||||
java -jar swagger-codegen-cli.jar help
|
||||
```
|
||||
@ -148,7 +148,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
|
||||
```
|
||||
(if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`)
|
||||
|
||||
You can also download the JAR (latest relesae) directly from [maven.org]( http://central.maven.org/maven2/io/swagger/swagger-codegen/2.1.6/swagger-codegen-2.1.6.jar)
|
||||
You can also download the JAR (latest relesae) directly from [maven.org]( http://central.maven.org/maven2/io/swagger/swagger-codegen/2.2.0/swagger-codegen-2.2.0.jar)
|
||||
|
||||
To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate`
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>swagger-codegen-maven-plugin</artifactId>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -1195,7 +1195,35 @@ public class DefaultCodegen {
|
||||
allRequired = null;
|
||||
}
|
||||
// parent model
|
||||
final RefModel parent = (RefModel) composed.getParent();
|
||||
RefModel parent = (RefModel) composed.getParent();
|
||||
|
||||
// interfaces (intermediate models)
|
||||
if (composed.getInterfaces() != null) {
|
||||
if (m.interfaces == null)
|
||||
m.interfaces = new ArrayList<String>();
|
||||
for (RefModel _interface : composed.getInterfaces()) {
|
||||
Model interfaceModel = null;
|
||||
if (allDefinitions != null) {
|
||||
interfaceModel = allDefinitions.get(_interface.getSimpleRef());
|
||||
}
|
||||
// set first interface with discriminator found as parent
|
||||
if (parent == null && interfaceModel instanceof ModelImpl && ((ModelImpl) interfaceModel).getDiscriminator() != null) {
|
||||
parent = _interface;
|
||||
} else {
|
||||
final String interfaceRef = toModelName(_interface.getSimpleRef());
|
||||
m.interfaces.add(interfaceRef);
|
||||
addImport(m, interfaceRef);
|
||||
if (allDefinitions != null) {
|
||||
if (supportsInheritance) {
|
||||
addProperties(allProperties, allRequired, interfaceModel, allDefinitions);
|
||||
} else {
|
||||
addProperties(properties, required, interfaceModel, allDefinitions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parent != null) {
|
||||
final String parentRef = parent.getSimpleRef();
|
||||
m.parentSchema = parentRef;
|
||||
@ -1210,24 +1238,7 @@ public class DefaultCodegen {
|
||||
}
|
||||
}
|
||||
}
|
||||
// interfaces (intermediate models)
|
||||
if (composed.getInterfaces() != null) {
|
||||
if (m.interfaces == null)
|
||||
m.interfaces = new ArrayList<String>();
|
||||
for (RefModel _interface : composed.getInterfaces()) {
|
||||
final String interfaceRef = toModelName(_interface.getSimpleRef());
|
||||
m.interfaces.add(interfaceRef);
|
||||
addImport(m, interfaceRef);
|
||||
if (allDefinitions != null) {
|
||||
final Model interfaceModel = allDefinitions.get(_interface.getSimpleRef());
|
||||
if (supportsInheritance) {
|
||||
addProperties(allProperties, allRequired, interfaceModel, allDefinitions);
|
||||
} else {
|
||||
addProperties(properties, required, interfaceModel, allDefinitions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// child model (properties owned by the model itself)
|
||||
Model child = composed.getChild();
|
||||
if (child != null && child instanceof RefModel && allDefinitions != null) {
|
||||
|
@ -259,7 +259,10 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
|
||||
private Model getParent(Model model) {
|
||||
if (model instanceof ComposedModel) {
|
||||
return definitions.get(((ComposedModel) model).getParent().getReference());
|
||||
Model parent = ((ComposedModel) model).getParent();
|
||||
if(parent != null) {
|
||||
return definitions.get(parent.getReference());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -117,6 +117,18 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
|
||||
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
|
||||
} else if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
|
||||
// guess from api package
|
||||
String derviedInvokerPackage = deriveInvokerPackageName((String)additionalProperties.get(CodegenConstants.API_PACKAGE));
|
||||
this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derviedInvokerPackage);
|
||||
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
|
||||
LOGGER.info("Invoker Package Name, originally not set, is now dervied from api package name: " + derviedInvokerPackage);
|
||||
} else if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) {
|
||||
// guess from model package
|
||||
String derviedInvokerPackage = deriveInvokerPackageName((String)additionalProperties.get(CodegenConstants.MODEL_PACKAGE));
|
||||
this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derviedInvokerPackage);
|
||||
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
|
||||
LOGGER.info("Invoker Package Name, originally not set, is now dervied from model package name: " + derviedInvokerPackage);
|
||||
} else {
|
||||
//not set, use default to be passed to template
|
||||
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||
@ -845,4 +857,23 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
return input.replace("*/", "*_/").replace("/*", "/_*");
|
||||
}
|
||||
|
||||
/*
|
||||
* Derive invoker package name based on the input
|
||||
* e.g. foo.bar.model => foo.bar
|
||||
*
|
||||
* @param input API package/model name
|
||||
* @return Derived invoker package name based on API package/model name
|
||||
*/
|
||||
private String deriveInvokerPackageName(String input) {
|
||||
String[] parts = input.split(Pattern.quote(".")); // Split on period.
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String delim = "";
|
||||
for (String p : Arrays.copyOf(parts, parts.length-1)) {
|
||||
sb.append(delim).append(p);
|
||||
delim = ".";
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -188,7 +188,7 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<jersey-version>2.22.2</jersey-version>
|
||||
<jackson-version>2.7.5</jackson-version>
|
||||
{{^java8}}
|
||||
|
@ -142,7 +142,7 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<retrofit-version>1.9.0</retrofit-version>
|
||||
<okhttp-version>2.7.5</okhttp-version>
|
||||
<jodatime-version>2.9.3</jodatime-version>
|
||||
|
@ -111,7 +111,7 @@
|
||||
</repositories>
|
||||
<properties>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<swagger-inflector-version>1.0.4</swagger-inflector-version>
|
||||
<swagger-inflector-version>1.0.8</swagger-inflector-version>
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<logback-version>1.0.1</logback-version>
|
||||
<junit-version>4.8.2</junit-version>
|
||||
|
@ -145,7 +145,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<resteasy-version>3.0.11.Final</resteasy-version>
|
||||
<slf4j-version>1.6.3</slf4j-version>
|
||||
|
@ -217,7 +217,7 @@
|
||||
<akka-version>2.3.9</akka-version>
|
||||
<joda-version>1.2</joda-version>
|
||||
<joda-time-version>2.2</joda-time-version>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<maven-plugin.version>1.0.0</maven-plugin.version>
|
||||
|
||||
<junit-version>4.8.1</junit-version>
|
||||
|
@ -145,7 +145,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<gson-version>2.3.1</gson-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
|
@ -210,7 +210,7 @@
|
||||
<joda-version>1.2</joda-version>
|
||||
<joda-time-version>2.2</joda-time-version>
|
||||
<jersey-version>1.19</jersey-version>
|
||||
<swagger-core-version>1.5.8</swagger-core-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
<jersey-async-version>1.0.5</jersey-async-version>
|
||||
<maven-plugin.version>1.0.0</maven-plugin.version>
|
||||
<jackson-version>2.4.2</jackson-version>
|
||||
|
@ -13,10 +13,14 @@ import com.google.common.collect.Sets;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class JavaInheritanceTest {
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
@Test(description = "convert a composed model")
|
||||
@Test(description = "convert a composed model with parent")
|
||||
public void javaInheritanceTest() {
|
||||
final Model model = new ComposedModel().parent(new RefModel("Base"))
|
||||
.child(new ModelImpl().additionalProperties(new StringProperty()));
|
||||
@ -29,4 +33,26 @@ public class JavaInheritanceTest {
|
||||
Assert.assertEquals(cm.parent, "Base");
|
||||
Assert.assertEquals(cm.imports, Sets.newHashSet("Base"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
@Test(description = "convert a composed model with discriminator")
|
||||
public void javaInheritanceWithDiscriminatorTest() {
|
||||
ModelImpl base = new ModelImpl();
|
||||
base.setDiscriminator("disc");
|
||||
|
||||
final Model model = new ComposedModel()
|
||||
.interfaces(Arrays.asList(new RefModel("Base")))
|
||||
.child(new ModelImpl().additionalProperties(new StringProperty()));
|
||||
|
||||
final Map<String, Model> allDefinitions = new HashMap<String, Model>();
|
||||
allDefinitions.put("Base", base);
|
||||
|
||||
final DefaultCodegen codegen = new JavaClientCodegen();
|
||||
final CodegenModel cm = codegen.fromModel("sample", model, allDefinitions);
|
||||
|
||||
Assert.assertEquals(cm.name, "sample");
|
||||
Assert.assertEquals(cm.classname, "Sample");
|
||||
Assert.assertEquals(cm.parent, "Base");
|
||||
Assert.assertEquals(cm.imports, Sets.newHashSet("Base"));
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class JavaScriptInheritanceTest {
|
||||
Assert.assertEquals(cm.vars.size(), 1);
|
||||
Assert.assertEquals(cm.vars.get(0).name, "childProp");
|
||||
Assert.assertEquals(cm.allVars.size(), 4);
|
||||
String[] allVars = {"baseProp", "intf1Prop", "intf2Prop", "childProp"};
|
||||
String[] allVars = {"intf1Prop", "intf2Prop", "baseProp", "childProp"};
|
||||
for (int i = 0; i < allVars.length; i++) {
|
||||
Assert.assertEquals(cm.allVars.get(i).name, allVars[i]);
|
||||
}
|
||||
@ -91,7 +91,7 @@ public class JavaScriptInheritanceTest {
|
||||
Assert.assertEquals(cm.imports, Sets.newHashSet("Base", "Interface1", "Interface2"));
|
||||
Assert.assertEquals(cm.vars.size(), 4);
|
||||
Assert.assertEquals(cm.allVars.size(), 4);
|
||||
String[] allVars = {"baseProp", "intf1Prop", "intf2Prop", "childProp"};
|
||||
String[] allVars = {"intf1Prop", "intf2Prop", "baseProp", "childProp"};
|
||||
for (int i = 0; i < allVars.length; i++) {
|
||||
Assert.assertEquals(cm.vars.get(i).name, allVars[i]);
|
||||
Assert.assertEquals(cm.allVars.get(i).name, allVars[i]);
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>swagger-generator</artifactId>
|
||||
|
4
pom.xml
4
pom.xml
@ -10,7 +10,7 @@
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>swagger-codegen-project</name>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<url>https://github.com/swagger-api/swagger-codegen</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
|
||||
@ -704,7 +704,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-parser-version>1.0.19</swagger-parser-version>
|
||||
<swagger-parser-version>1.0.21</swagger-parser-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>2.3.4</felix-version>
|
||||
<swagger-core-version>1.5.9</swagger-core-version>
|
||||
|
@ -2,6 +2,7 @@ package io.swagger.client.api;
|
||||
|
||||
import io.swagger.client.ApiClient;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -16,6 +17,19 @@ import feign.*;
|
||||
public interface FakeApi extends ApiClient.Api {
|
||||
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Client
|
||||
*/
|
||||
@RequestLine("PATCH /fake")
|
||||
@Headers({
|
||||
"Content-type: application/json",
|
||||
"Accept: application/json",
|
||||
})
|
||||
Client testClientModel(Client body);
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@JsonProperty("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
10
samples/client/petstore/java/jersey1/docs/Client.md
Normal file
10
samples/client/petstore/java/jersey1/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -4,10 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
||||
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClientModel(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
|
||||
|
@ -32,6 +32,7 @@ import io.swagger.client.Configuration;
|
||||
import io.swagger.client.model.*;
|
||||
import io.swagger.client.Pair;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -62,6 +63,47 @@ public class FakeApi {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client testClientModel(Client body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@JsonProperty("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
10
samples/client/petstore/java/jersey2-java8/docs/Client.md
Normal file
10
samples/client/petstore/java/jersey2-java8/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -4,10 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
||||
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClientModel(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
|
||||
|
@ -7,6 +7,7 @@ import io.swagger.client.Pair;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -36,6 +37,47 @@ public class FakeApi {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client testClientModel(Client body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@JsonProperty("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
10
samples/client/petstore/java/jersey2/docs/Client.md
Normal file
10
samples/client/petstore/java/jersey2/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -4,10 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
||||
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClientModel(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
|
||||
|
@ -7,6 +7,7 @@ import io.swagger.client.Pair;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -36,6 +37,47 @@ public class FakeApi {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client testClientModel(Client body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@JsonProperty("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
10
samples/client/petstore/java/okhttp-gson/docs/Client.md
Normal file
10
samples/client/petstore/java/okhttp-gson/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -4,10 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
||||
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClientModel(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
|
||||
|
@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -67,6 +68,112 @@ public class FakeApi {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/* Build call for testClientModel */
|
||||
private com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)");
|
||||
}
|
||||
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
||||
@Override
|
||||
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
||||
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.build();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Client
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public Client testClientModel(Client body) throws ApiException {
|
||||
ApiResponse<Client> resp = testClientModelWithHttpInfo(body);
|
||||
return resp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return ApiResponse<Client>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Client> testClientModelWithHttpInfo(Client body) throws ApiException {
|
||||
com.squareup.okhttp.Call call = testClientModelCall(body, null, null);
|
||||
Type localVarReturnType = new TypeToken<Client>(){}.getType();
|
||||
return apiClient.execute(call, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model (asynchronously)
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testClientModelAsync(Client body, final ApiCallback<Client> callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener);
|
||||
Type localVarReturnType = new TypeToken<Client>(){}.getType();
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
/* Build call for testEndpointParameters */
|
||||
private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, LocalDate date, DateTime dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@SerializedName("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import retrofit.Callback;
|
||||
import retrofit.http.*;
|
||||
import retrofit.mime.*;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -16,6 +17,31 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FakeApi {
|
||||
/**
|
||||
* To test \"client\" model
|
||||
* Sync method
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Client
|
||||
*/
|
||||
|
||||
@PATCH("/fake")
|
||||
Client testClientModel(
|
||||
@Body Client body
|
||||
);
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
* Async method
|
||||
* @param body client model (required)
|
||||
* @param cb callback method
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@PATCH("/fake")
|
||||
void testClientModel(
|
||||
@Body Client body, Callback<Client> cb
|
||||
);
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Sync method
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@SerializedName("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
10
samples/client/petstore/java/retrofit2/docs/Client.md
Normal file
10
samples/client/petstore/java/retrofit2/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -4,10 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** fake | To test enum query parameters
|
||||
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClientModel(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
|
||||
|
@ -8,6 +8,7 @@ import retrofit2.http.*;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -18,6 +19,18 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FakeApi {
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Call<Client>
|
||||
*/
|
||||
|
||||
@PATCH("fake")
|
||||
Call<Client> testClientModel(
|
||||
@Body Client body
|
||||
);
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@SerializedName("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
10
samples/client/petstore/java/retrofit2rx/docs/Client.md
Normal file
10
samples/client/petstore/java/retrofit2rx/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -4,10 +4,54 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** fake | To test enum query parameters
|
||||
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClientModel(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
|
||||
|
@ -8,6 +8,7 @@ import retrofit2.http.*;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
@ -18,6 +19,18 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FakeApi {
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @param body client model (required)
|
||||
* @return Call<Client>
|
||||
*/
|
||||
|
||||
@PATCH("fake")
|
||||
Observable<Client> testClientModel(
|
||||
@Body Client body
|
||||
);
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Swagger 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
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* 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 io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
@SerializedName("client")
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user