openapi-generator/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md
Paŭlo Ebermann db71d97370 Updating samples after #5232. (#5243)
* Updating samples after #5232.

* Fix tests after #5232.

* Fix Javascript client tests.

* JaxRS server: set serverPort only when not given from outside.

* Update JaxRS sample creator scripts to fix serverPort.

* Preliminary test fix for JaxRS server generators.

* Updating samples for JaxRS with Jersey1/2.

* Updating JaxRS samples again.
2017-03-30 01:28:53 +08:00

7.2 KiB

FakeApi

All URIs are relative to http://petstore.swagger.io:80/v2

Method HTTP request Description
testClientModel PATCH /fake To test "client" model
testEndpointParameters POST /fake Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
testEnumParameters GET /fake To test enum parameters

testClientModel

Client testClientModel(body)

To test "client" model

To test "client" model

Example

// 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 model

Return type

Client

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

testEndpointParameters

testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.FakeApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: http_basic_test
HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
http_basic_test.setUsername("YOUR USERNAME");
http_basic_test.setPassword("YOUR PASSWORD");

FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = B; // byte[] | None
Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | None
Long int64 = 789L; // Long | None
Float _float = 3.4F; // Float | None
String string = "string_example"; // String | None
byte[] binary = B; // byte[] | None
LocalDate date = new LocalDate(); // LocalDate | None
DateTime dateTime = new DateTime(); // DateTime | None
String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None
try {
    apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
} catch (ApiException e) {
    System.err.println("Exception when calling FakeApi#testEndpointParameters");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
number BigDecimal None
_double Double None
patternWithoutDelimiter String None
_byte byte[] None
integer Integer None [optional]
int32 Integer None [optional]
int64 Long None [optional]
_float Float None [optional]
string String None [optional]
binary byte[] None [optional]
date LocalDate None [optional]
dateTime DateTime None [optional]
password String None [optional]
paramCallback String None [optional]

Return type

null (empty response body)

Authorization

http_basic_test

HTTP request headers

  • Content-Type: application/xml; charset=utf-8, application/json; charset=utf-8
  • Accept: application/xml; charset=utf-8, application/json; charset=utf-8

testEnumParameters

testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble)

To test enum parameters

To test enum parameters

Example

// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;


FakeApi apiInstance = new FakeApi();
List<String> enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List<String> | Form parameter enum test (string array)
String enumFormString = "-efg"; // String | Form parameter enum test (string)
List<String> enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List<String> | Header parameter enum test (string array)
String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
List<String> enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List<String> | Query parameter enum test (string array)
String enumQueryString = "-efg"; // String | Query parameter enum test (string)
Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
try {
    apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
} catch (ApiException e) {
    System.err.println("Exception when calling FakeApi#testEnumParameters");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
enumFormStringArray List<String> Form parameter enum test (string array) [optional] [enum: >, $]
enumFormString String Form parameter enum test (string) [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
enumHeaderStringArray List<String> Header parameter enum test (string array) [optional] [enum: >, $]
enumHeaderString String Header parameter enum test (string) [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
enumQueryStringArray List<String> Query parameter enum test (string array) [optional] [enum: >, $]
enumQueryString String Query parameter enum test (string) [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
enumQueryInteger Integer Query parameter enum test (double) [optional] [enum: 1, -2]
enumQueryDouble Double Query parameter enum test (double) [optional] [enum: 1.1, -1.2]

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: /
  • Accept: /