Skip to content

Commit 524344e

Browse files
committed
Generate java okhttp client samples
1 parent 25ab645 commit 524344e

File tree

193 files changed

+5376
-5635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+5376
-5635
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.1-SNAPSHOT
1+
3.0.0-SNAPSHOT

samples/client/petstore/java/okhttp-gson-parcelableModel/README.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,27 @@ Please follow the [installation](#installation) instruction and execute the foll
6161
import io.swagger.client.*;
6262
import io.swagger.client.auth.*;
6363
import io.swagger.client.model.*;
64-
import io.swagger.client.api.FakeApi;
64+
import io.swagger.client.api.AnotherFakeApi;
6565

6666
import java.io.File;
6767
import java.util.*;
6868

69-
public class FakeApiExample {
69+
public class AnotherFakeApiExample {
7070

7171
public static void main(String[] args) {
72+
ApiClient defaultClient = Configuration.getDefaultApiClient();
73+
74+
75+
76+
AnotherFakeApi apiInstance = new AnotherFakeApi();
77+
78+
Client client = ; // Client | client model
7279

73-
FakeApi apiInstance = new FakeApi();
74-
Boolean body = true; // Boolean | Input boolean as post body
7580
try {
76-
Boolean result = apiInstance.fakeOuterBooleanSerialize(body);
81+
Client result = apiInstance.testSpecialTags(client);
7782
System.out.println(result);
7883
} catch (ApiException e) {
79-
System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize");
84+
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
8085
e.printStackTrace();
8186
}
8287
}
@@ -90,13 +95,17 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
9095

9196
Class | Method | HTTP request | Description
9297
------------ | ------------- | ------------- | -------------
98+
*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
9399
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
94100
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
95101
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
96102
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
97103
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
98104
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
99105
*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
106+
*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
107+
*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
108+
*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
100109
*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
101110
*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
102111
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
@@ -123,14 +132,15 @@ Class | Method | HTTP request | Description
123132

124133
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
125134
- [Animal](docs/Animal.md)
126-
- [AnimalFarm](docs/AnimalFarm.md)
127135
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
128136
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
129137
- [ArrayTest](docs/ArrayTest.md)
130138
- [Capitalization](docs/Capitalization.md)
139+
- [Cat](docs/Cat.md)
131140
- [Category](docs/Category.md)
132141
- [ClassModel](docs/ClassModel.md)
133142
- [Client](docs/Client.md)
143+
- [Dog](docs/Dog.md)
134144
- [EnumArrays](docs/EnumArrays.md)
135145
- [EnumClass](docs/EnumClass.md)
136146
- [EnumTest](docs/EnumTest.md)
@@ -151,8 +161,6 @@ Class | Method | HTTP request | Description
151161
- [SpecialModelName](docs/SpecialModelName.md)
152162
- [Tag](docs/Tag.md)
153163
- [User](docs/User.md)
154-
- [Cat](docs/Cat.md)
155-
- [Dog](docs/Dog.md)
156164

157165

158166
## Documentation for Authorization
@@ -164,18 +172,37 @@ Authentication schemes defined for the API:
164172
- **API key parameter name**: api_key
165173
- **Location**: HTTP header
166174

175+
176+
177+
178+
### api_key_query
179+
180+
- **Type**: API key
181+
- **API key parameter name**: api_key_query
182+
- **Location**: URL query string
183+
184+
185+
186+
167187
### http_basic_test
168188

189+
169190
- **Type**: HTTP basic authentication
170191

192+
193+
171194
### petstore_auth
172195

196+
197+
173198
- **Type**: OAuth
174199
- **Flow**: implicit
175200
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
176201
- **Scopes**:
177-
- write:pets: modify pets in your account
178-
- read:pets: read your pets
202+
- :
203+
204+
205+
179206

180207

181208
## Recommendation

samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') {
3232
targetSdkVersion 25
3333
}
3434
compileOptions {
35+
36+
3537
sourceCompatibility JavaVersion.VERSION_1_7
3638
targetCompatibility JavaVersion.VERSION_1_7
39+
3740
}
3841

3942
// Rename the aar correctly
@@ -98,7 +101,9 @@ dependencies {
98101
compile 'com.squareup.okhttp:okhttp:2.7.5'
99102
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
100103
compile 'com.google.code.gson:gson:2.8.1'
101-
compile 'io.gsonfire:gson-fire:1.8.0'
104+
105+
102106
compile 'org.threeten:threetenbp:1.3.5'
107+
103108
testCompile 'junit:junit:4.12'
104109
}

samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ lazy val root = (project in file(".")).
1313
"com.squareup.okhttp" % "okhttp" % "2.7.5",
1414
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
1515
"com.google.code.gson" % "gson" % "2.8.1",
16+
17+
1618
"org.threeten" % "threetenbp" % "1.3.5" % "compile",
17-
"io.gsonfire" % "gson-fire" % "1.8.0" % "compile",
19+
1820
"junit" % "junit" % "4.12" % "test",
1921
"com.novocode" % "junit-interface" % "0.10" % "test"
2022
)

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Name | Type | Description | Notes
99

1010

1111

12+

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Name | Type | Description | Notes
99

1010

1111

12+

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnimalFarm.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ Method | HTTP request | Description
77
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
88

99

10+
11+
1012
<a name="testSpecialTags"></a>
1113
# **testSpecialTags**
12-
> Client testSpecialTags(body)
14+
> Client testSpecialTags(client)
1315
1416
To test special tags
1517

@@ -22,10 +24,13 @@ To test special tags
2224
//import io.swagger.client.api.AnotherFakeApi;
2325

2426

27+
2528
AnotherFakeApi apiInstance = new AnotherFakeApi();
26-
Client body = new Client(); // Client | client model
29+
30+
Client client = ; // Client | client model
31+
2732
try {
28-
Client result = apiInstance.testSpecialTags(body);
33+
Client result = apiInstance.testSpecialTags(client);
2934
System.out.println(result);
3035
} catch (ApiException e) {
3136
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
@@ -37,7 +42,8 @@ try {
3742

3843
Name | Type | Description | Notes
3944
------------- | ------------- | ------------- | -------------
40-
**body** | [**Client**](Client.md)| client model |
45+
**client** | [**Client**](.md)| client model |
46+
4147

4248
### Return type
4349

@@ -52,3 +58,5 @@ No authorization required
5258
- **Content-Type**: application/json
5359
- **Accept**: application/json
5460

61+
62+

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Name | Type | Description | Notes
88

99

1010

11+

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Name | Type | Description | Notes
88

99

1010

11+

0 commit comments

Comments
 (0)