better docstring for jersey2 client (#6104)

This commit is contained in:
William Cheng
2020-04-29 23:43:21 +08:00
committed by GitHub
parent bc097cfdde
commit 001d9cb36d
17 changed files with 195 additions and 12 deletions

View File

@@ -15,6 +15,7 @@ package org.openapitools.client;
import java.util.List;
import java.util.Map;
/** API Exception */
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;

View File

@@ -44,14 +44,29 @@ public class ApiResponse<T> {
this.data = data;
}
/**
* Get the status code
*
* @return status code
*/
public int getStatusCode() {
return statusCode;
}
/**
* Get the headers
*
* @return map of headers
*/
public Map<String, List<String>> getHeaders() {
return headers;
}
/**
* Get the data
*
* @return data
*/
public T getData() {
return data;
}

View File

@@ -43,6 +43,11 @@ public class JSON implements ContextResolver<ObjectMapper> {
return mapper;
}
/**
* Get the object mapper
*
* @return object mapper
*/
public ObjectMapper getMapper() {
return mapper;
}

View File

@@ -23,13 +23,24 @@ public class AnotherFakeApi {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test special tags To test special tags and operation ID starting with number
*

View File

@@ -23,13 +23,24 @@ public class DefaultApi {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* @return InlineResponseDefault
* @throws ApiException if fails to make API call

View File

@@ -32,13 +32,24 @@ public class FakeApi {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Health check endpoint
*

View File

@@ -23,13 +23,24 @@ public class FakeClassnameTags123Api {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test class name in snake case To test class name in snake case
*

View File

@@ -25,13 +25,24 @@ public class PetApi {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Add a new pet to the store
*

View File

@@ -23,13 +23,24 @@ public class StoreApi {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Delete purchase order by ID For valid response try integer IDs with value &lt; 1000. Anything
* above 1000 or nonintegers will generate API errors

View File

@@ -23,13 +23,24 @@ public class UserApi {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create user This can only be done by the logged in user.
*

View File

@@ -15,26 +15,49 @@ package org.openapitools.client.model;
import java.util.Map;
import javax.ws.rs.core.GenericType;
/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */
public abstract class AbstractOpenApiSchema {
// store the actual instance of the schema/object
private Object instance;
public final String schemaType;
// schema type (e.g. oneOf, anyOf)
private final String schemaType;
public AbstractOpenApiSchema(String schemaType) {
this.schemaType = schemaType;
}
/**
* * Get the list of schemas allowed to be stored in this object
*
* @return an instance of the actual schema/object
*/
public abstract Map<String, GenericType> getSchemas();
/**
* * Get the actual instance
*
* @return an instance of the actual schema/object
*/
public Object getActualInstance() {
return instance;
}
/**
* * Set the actual instance
*
* @param instance the actual instance of the schema/object
*/
public void setActualInstance(Object instance) {
this.instance = instance;
}
/**
* * Get the schema type (e.g. anyOf, oneOf)
*
* @return the schema type
*/
public String getSchemaType() {
return schemaType;
}