fix doc warning in java retrofit2 client

This commit is contained in:
wing328
2016-07-05 17:49:50 +08:00
parent 907361cded
commit dfc05f4bba
9 changed files with 15 additions and 120 deletions

View File

@@ -188,7 +188,7 @@ public class ApiClient {
/** /**
* Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return * @return Token request builder
*/ */
public TokenRequestBuilder getTokenEndPoint() { public TokenRequestBuilder getTokenEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) { for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -202,7 +202,7 @@ public class ApiClient {
/** /**
* Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return * @return Authentication request builder
*/ */
public AuthenticationRequestBuilder getAuthorizationEndPoint() { public AuthenticationRequestBuilder getAuthorizationEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) { for(Interceptor apiAuthorization : apiAuthorizations.values()) {

View File

@@ -68,6 +68,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions> <executions>
<execution> <execution>
<id>add_sources</id> <id>add_sources</id>
@@ -152,6 +153,7 @@
</dependency> </dependency>
</dependencies> </dependencies>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version> <java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>

View File

@@ -7,13 +7,6 @@ Name | Type | Description | Notes
**arrayOfString** | **List&lt;String&gt;** | | [optional] **arrayOfString** | **List&lt;String&gt;** | | [optional]
**arrayArrayOfInteger** | [**List&lt;List&lt;Long&gt;&gt;**](List.md) | | [optional] **arrayArrayOfInteger** | [**List&lt;List&lt;Long&gt;&gt;**](List.md) | | [optional]
**arrayArrayOfModel** | [**List&lt;List&lt;ReadOnlyFirst&gt;&gt;**](List.md) | | [optional] **arrayArrayOfModel** | [**List&lt;List&lt;ReadOnlyFirst&gt;&gt;**](List.md) | | [optional]
**arrayOfEnum** | [**List&lt;ArrayOfEnumEnum&gt;**](#List&lt;ArrayOfEnumEnum&gt;) | | [optional]
<a name="List<ArrayOfEnumEnum>"></a>
## Enum: List&lt;ArrayOfEnumEnum&gt;
Name | Value
---- | -----

View File

@@ -4,54 +4,10 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** fake | To test code injection &#x3D;end
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** fake | To test enum query parameters [**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** fake | To test enum query parameters
<a name="testCodeInjectEnd"></a>
# **testCodeInjectEnd**
> Void testCodeInjectEnd(testCodeInjectEnd)
To test code injection &#x3D;end
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
String testCodeInjectEnd = "testCodeInjectEnd_example"; // String | To test code injection =end
try {
Void result = apiInstance.testCodeInjectEnd(testCodeInjectEnd);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testCodeInjectEnd");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**testCodeInjectEnd** | **String**| To test code injection &#x3D;end | [optional]
### Return type
[**Void**](.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json, */ =end'));(phpinfo('
- **Accept**: application/json, */ end
<a name="testEndpointParameters"></a> <a name="testEndpointParameters"></a>
# **testEndpointParameters** # **testEndpointParameters**
> Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) > Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)

View File

@@ -68,6 +68,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions> <executions>
<execution> <execution>
<id>add_sources</id> <id>add_sources</id>
@@ -138,6 +139,7 @@
</dependency> </dependency>
</dependencies> </dependencies>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version> <java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>

View File

@@ -53,10 +53,10 @@ public class ApiClient {
this(); this();
for(String authName : authNames) { for(String authName : authNames) {
Interceptor auth; Interceptor auth;
if (authName == "petstore_auth") { if (authName == "api_key") {
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else if (authName == "api_key") {
auth = new ApiKeyAuth("header", "api_key"); auth = new ApiKeyAuth("header", "api_key");
} else if (authName == "petstore_auth") {
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else { } else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
} }
@@ -175,7 +175,7 @@ public class ApiClient {
/** /**
* Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return * @return Token request builder
*/ */
public TokenRequestBuilder getTokenEndPoint() { public TokenRequestBuilder getTokenEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) { for(Interceptor apiAuthorization : apiAuthorizations.values()) {
@@ -189,7 +189,7 @@ public class ApiClient {
/** /**
* Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one)
* @return * @return Authentication request builder
*/ */
public AuthenticationRequestBuilder getAuthorizationEndPoint() { public AuthenticationRequestBuilder getAuthorizationEndPoint() {
for(Interceptor apiAuthorization : apiAuthorizations.values()) { for(Interceptor apiAuthorization : apiAuthorizations.values()) {

View File

@@ -9,8 +9,8 @@ import retrofit2.http.*;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import java.math.BigDecimal;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@@ -18,19 +18,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public interface FakeApi { public interface FakeApi {
/**
* To test code injection &#x3D;end
*
* @param testCodeInjectEnd To test code injection &#x3D;end (optional)
* @return Call<Void>
*/
@FormUrlEncoded
@PUT("fake")
Call<Void> testCodeInjectEnd(
@Field("test code inject */ &#x3D;end") String testCodeInjectEnd
);
/** /**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

View File

@@ -9,8 +9,8 @@ import retrofit2.http.*;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import io.swagger.client.model.ModelApiResponse;
import java.io.File; import java.io.File;
import io.swagger.client.model.ModelApiResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View File

@@ -48,31 +48,6 @@ public class ArrayTest {
@SerializedName("array_array_of_model") @SerializedName("array_array_of_model")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>(); private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
/**
* Gets or Sets arrayOfEnum
*/
public enum ArrayOfEnumEnum {
@SerializedName("UPPER")
UPPER("UPPER"),
@SerializedName("lower")
LOWER("lower");
private String value;
ArrayOfEnumEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
}
@SerializedName("array_of_enum")
private List<ArrayOfEnumEnum> arrayOfEnum = new ArrayList<ArrayOfEnumEnum>();
public ArrayTest arrayOfString(List<String> arrayOfString) { public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString; this.arrayOfString = arrayOfString;
return this; return this;
@@ -127,24 +102,6 @@ public class ArrayTest {
this.arrayArrayOfModel = arrayArrayOfModel; this.arrayArrayOfModel = arrayArrayOfModel;
} }
public ArrayTest arrayOfEnum(List<ArrayOfEnumEnum> arrayOfEnum) {
this.arrayOfEnum = arrayOfEnum;
return this;
}
/**
* Get arrayOfEnum
* @return arrayOfEnum
**/
@ApiModelProperty(example = "null", value = "")
public List<ArrayOfEnumEnum> getArrayOfEnum() {
return arrayOfEnum;
}
public void setArrayOfEnum(List<ArrayOfEnumEnum> arrayOfEnum) {
this.arrayOfEnum = arrayOfEnum;
}
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
@@ -157,13 +114,12 @@ public class ArrayTest {
ArrayTest arrayTest = (ArrayTest) o; ArrayTest arrayTest = (ArrayTest) o;
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel) && Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
Objects.equals(this.arrayOfEnum, arrayTest.arrayOfEnum);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel, arrayOfEnum); return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
} }
@Override @Override
@@ -174,7 +130,6 @@ public class ArrayTest {
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
sb.append(" arrayOfEnum: ").append(toIndentedString(arrayOfEnum)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }