Update java client samples OAS2 (#140)

* Update java client examples
* Rename artifactId in json config files
* Add imports in api.mustache for play24 and play25
This commit is contained in:
Jérémie Bresson
2018-04-24 09:51:50 +02:00
committed by GitHub
parent 5340c35ce1
commit c8c316e41e
873 changed files with 17421 additions and 16058 deletions

View File

@@ -9,7 +9,7 @@ Method | HTTP request | Description
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
> Client testSpecialTags(client)
To test special tags
@@ -27,14 +27,14 @@ AnotherFakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSuppl
.setBaseUri("http://petstore.swagger.io:80/v2"))).anotherFake();
api.testSpecialTags()
.body(body).execute(r -> r.prettyPeek());
.body(client).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
**client** | [**Client**](Client.md)| client model |
### Return type

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
@@ -19,6 +20,15 @@ LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumStringRequiredEnum"></a>
## Enum: EnumStringRequiredEnum
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
<a name="EnumIntegerEnum"></a>
## Enum: EnumIntegerEnum
Name | Value

View File

@@ -8,6 +8,7 @@ Method | HTTP request | Description
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
@@ -17,7 +18,7 @@ Method | HTTP request | Description
<a name="fakeOuterBooleanSerialize"></a>
# **fakeOuterBooleanSerialize**
> Boolean fakeOuterBooleanSerialize(body)
> Boolean fakeOuterBooleanSerialize(booleanPostBody)
@@ -41,7 +42,7 @@ api.fakeOuterBooleanSerialize().execute(r -> r.prettyPeek());
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional]
**booleanPostBody** | **Boolean**| Input boolean as post body | [optional]
### Return type
@@ -54,11 +55,11 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
- **Accept**: */*
<a name="fakeOuterCompositeSerialize"></a>
# **fakeOuterCompositeSerialize**
> OuterComposite fakeOuterCompositeSerialize(body)
> OuterComposite fakeOuterCompositeSerialize(outerComposite)
@@ -82,7 +83,7 @@ api.fakeOuterCompositeSerialize().execute(r -> r.prettyPeek());
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
@@ -95,7 +96,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
- **Accept**: */*
<a name="fakeOuterNumberSerialize"></a>
# **fakeOuterNumberSerialize**
@@ -123,7 +124,7 @@ api.fakeOuterNumberSerialize().execute(r -> r.prettyPeek());
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional]
**body** | **BigDecimal**| Input number as post body | [optional]
### Return type
@@ -136,7 +137,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
- **Accept**: */*
<a name="fakeOuterStringSerialize"></a>
# **fakeOuterStringSerialize**
@@ -164,7 +165,7 @@ api.fakeOuterStringSerialize().execute(r -> r.prettyPeek());
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**String**](String.md)| Input string as post body | [optional]
**body** | **String**| Input string as post body | [optional]
### Return type
@@ -177,11 +178,53 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
<a name="testBodyWithQueryParams"></a>
# **testBodyWithQueryParams**
> testBodyWithQueryParams(query, user)
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testBodyWithQueryParams()
.queryQuery(query)
.body(user).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **String**| |
**user** | [**User**](User.md)| |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testClientModel"></a>
# **testClientModel**
> Client testClientModel(body)
> Client testClientModel(client)
To test \&quot;client\&quot; model
@@ -199,14 +242,14 @@ FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testClientModel()
.body(body).execute(r -> r.prettyPeek());
.body(client).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
**client** | [**Client**](Client.md)| client model |
### Return type
@@ -255,12 +298,12 @@ Name | Type | Description | Notes
**_double** | **Double**| None |
**patternWithoutDelimiter** | **String**| None |
**_byte** | **byte[]**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**integer** | **Integer**| None | [optional] [enum: ]
**int32** | **Integer**| None | [optional] [enum: ]
**int64** | **Long**| None | [optional]
**_float** | **Float**| None | [optional]
**string** | **String**| None | [optional]
**binary** | **byte[]**| None | [optional]
**binary** | **File**| None | [optional]
**date** | **LocalDate**| None | [optional]
**dateTime** | **OffsetDateTime**| None | [optional]
**password** | **String**| None | [optional]
@@ -276,12 +319,12 @@ null (empty response body)
### 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
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testEnumParameters"></a>
# **testEnumParameters**
> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble)
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
To test enum parameters
@@ -305,14 +348,14 @@ api.testEnumParameters().execute(r -> r.prettyPeek());
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumFormStringArray** | [**List&lt;String&gt;**](String.md)| 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&lt;String&gt;**](String.md)| 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&lt;String&gt;**](String.md)| 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]
**enumFormStringArray** | [**List&lt;String&gt;**](List.md)| Form parameter enum test (string array) | [optional] [enum: >, $]
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [enum: _abc, -efg, (xyz)]
### Return type
@@ -324,17 +367,15 @@ No authorization required
### HTTP request headers
- **Content-Type**: */*
- **Accept**: */*
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testInlineAdditionalProperties"></a>
# **testInlineAdditionalProperties**
> testInlineAdditionalProperties(param)
> testInlineAdditionalProperties(requestBody)
test inline additionalProperties
### Example
```java
// Import classes:
@@ -347,14 +388,14 @@ FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testInlineAdditionalProperties()
.body(param).execute(r -> r.prettyPeek());
.body(requestBody).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **Object**| request body |
**requestBody** | [**String**](String.md)| request body |
### Return type
@@ -375,8 +416,6 @@ No authorization required
test json serialization of form data
### Example
```java
// Import classes:
@@ -410,6 +449,6 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined

View File

@@ -9,7 +9,7 @@ Method | HTTP request | Description
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
> Client testClassname(client)
To test class name in snake case
@@ -27,14 +27,14 @@ FakeClassnameTags123Api api = ApiClient.api(ApiClient.Config.apiConfig().withReq
.setBaseUri("http://petstore.swagger.io:80/v2"))).fakeClassnameTags123();
api.testClassname()
.body(body).execute(r -> r.prettyPeek());
.body(client).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
**client** | [**Client**](Client.md)| client model |
### Return type

View File

@@ -12,7 +12,7 @@ Name | Type | Description | Notes
**_double** | **Double** | | [optional]
**string** | **String** | | [optional]
**_byte** | **byte[]** | |
**binary** | **byte[]** | | [optional]
**binary** | [**File**](File.md) | | [optional]
**date** | [**LocalDate**](LocalDate.md) | |
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**uuid** | [**UUID**](UUID.md) | | [optional]

View File

@@ -7,7 +7,7 @@ Name | Type | Description | Notes
**name** | **Integer** | |
**snakeCase** | **Integer** | | [optional]
**property** | **String** | | [optional]
**_123Number** | **Integer** | | [optional]
**_123number** | **Integer** | | [optional]

View File

@@ -0,0 +1,9 @@
# OuterBoolean
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@@ -0,0 +1,9 @@
# OuterNumber
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@@ -0,0 +1,9 @@
# OuterString
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@@ -16,12 +16,10 @@ Method | HTTP request | Description
<a name="addPet"></a>
# **addPet**
> addPet(body)
> addPet(pet)
Add a new pet to the store
### Example
```java
// Import classes:
@@ -34,14 +32,14 @@ PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.addPet()
.body(body).execute(r -> r.prettyPeek());
.body(pet).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -54,7 +52,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="deletePet"></a>
# **deletePet**
@@ -62,8 +60,6 @@ null (empty response body)
Deletes a pet
### Example
```java
// Import classes:
@@ -97,7 +93,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="findPetsByStatus"></a>
# **findPetsByStatus**
@@ -227,12 +223,10 @@ Name | Type | Description | Notes
<a name="updatePet"></a>
# **updatePet**
> updatePet(body)
> updatePet(pet)
Update an existing pet
### Example
```java
// Import classes:
@@ -245,14 +239,14 @@ PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.updatePet()
.body(body).execute(r -> r.prettyPeek());
.body(pet).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -265,7 +259,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="updatePetWithForm"></a>
# **updatePetWithForm**
@@ -273,8 +267,6 @@ null (empty response body)
Updates a pet in the store with form data
### Example
```java
// Import classes:
@@ -309,7 +301,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="uploadFile"></a>
# **uploadFile**
@@ -317,8 +309,6 @@ null (empty response body)
uploads an image
### Example
```java
// Import classes:

View File

@@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**specialPropertyName** | **Long** | | [optional]
**$specialPropertyName** | **Long** | | [optional]

View File

@@ -50,7 +50,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="getInventory"></a>
# **getInventory**
@@ -117,7 +117,7 @@ api.getOrderById()
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **Long**| ID of pet that needs to be fetched |
**orderId** | **Long**| ID of pet that needs to be fetched | [enum: ]
### Return type
@@ -134,12 +134,10 @@ No authorization required
<a name="placeOrder"></a>
# **placeOrder**
> Order placeOrder(body)
> Order placeOrder(order)
Place an order for a pet
### Example
```java
// Import classes:
@@ -152,14 +150,14 @@ StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
api.placeOrder()
.body(body).execute(r -> r.prettyPeek());
.body(order).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type

View File

@@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="createUser"></a>
# **createUser**
> createUser(body)
> createUser(user)
Create user
@@ -34,14 +34,14 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.createUser()
.body(body).execute(r -> r.prettyPeek());
.body(user).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object |
**user** | [**User**](User.md)| Created user object |
### Return type
@@ -54,16 +54,14 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="createUsersWithArrayInput"></a>
# **createUsersWithArrayInput**
> createUsersWithArrayInput(body)
> createUsersWithArrayInput(user)
Creates list of users with given input array
### Example
```java
// Import classes:
@@ -76,14 +74,14 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.createUsersWithArrayInput()
.body(body).execute(r -> r.prettyPeek());
.body(user).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
**user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type
@@ -96,16 +94,14 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="createUsersWithListInput"></a>
# **createUsersWithListInput**
> createUsersWithListInput(body)
> createUsersWithListInput(user)
Creates list of users with given input array
### Example
```java
// Import classes:
@@ -118,14 +114,14 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.createUsersWithListInput()
.body(body).execute(r -> r.prettyPeek());
.body(user).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
**user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type
@@ -138,7 +134,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="deleteUser"></a>
# **deleteUser**
@@ -180,7 +176,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="getUserByName"></a>
# **getUserByName**
@@ -188,8 +184,6 @@ No authorization required
Get user by user name
### Example
```java
// Import classes:
@@ -230,8 +224,6 @@ No authorization required
Logs user into the system
### Example
```java
// Import classes:
@@ -274,8 +266,6 @@ No authorization required
Logs out current logged in user session
### Example
```java
// Import classes:
@@ -304,11 +294,11 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
<a name="updateUser"></a>
# **updateUser**
> updateUser(username, body)
> updateUser(username, user)
Updated user
@@ -327,7 +317,7 @@ UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
api.updateUser()
.usernamePath(username)
.body(body).execute(r -> r.prettyPeek());
.body(user).execute(r -> r.prettyPeek());
```
### Parameters
@@ -335,7 +325,7 @@ api.updateUser()
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object |
**user** | [**User**](User.md)| Updated user object |
### Return type
@@ -348,5 +338,5 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined