Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f266380
First version of Nim Client
hokamoto Sep 1, 2019
18d367a
Add some codes
hokamoto Sep 5, 2019
9639569
Add some codes
hokamoto Sep 5, 2019
a999b5e
Add some codes
hokamoto Sep 8, 2019
5d73b11
Add some codes
hokamoto Sep 8, 2019
3880039
Add some codes
hokamoto Sep 12, 2019
c48f0a0
First version of Nim Client
hokamoto Sep 1, 2019
c5e4713
Add some codes
hokamoto Sep 5, 2019
feb96b1
Add some codes
hokamoto Sep 5, 2019
5fdc0ab
Add some codes
hokamoto Sep 8, 2019
ae33303
Add some codes
hokamoto Sep 8, 2019
ba35508
Add some codes
hokamoto Sep 12, 2019
fc74ece
[Dart] Fix README template and update testing doco (#3809)
nickmeinhold Sep 3, 2019
7b4a201
Support custom git repository (#3757)
qmuntal Sep 3, 2019
2451702
Add links to article and video (#3820)
wing328 Sep 3, 2019
9ef73eb
Better Go code format (#3819)
wing328 Sep 4, 2019
c90c6c8
Add gRPC Protobuf schema generator (#3818)
wing328 Sep 4, 2019
bdfed92
1792 fix remote spec handling and hash calculation (#3440)
Sep 4, 2019
7c5cfb7
fixed bug where nullApi.java would be generated. Instead, generated …
bensimpson-ch Sep 4, 2019
99eb680
Revert "1792 fix remote spec handling and hash calculation (#3440)"
wing328 Sep 4, 2019
ac1f19d
Add nickmeinhold to Dart technical committee (#3830)
wing328 Sep 4, 2019
9cbcebc
Bug #2845 typescript angular inheritance (#3812)
mnahkies Sep 5, 2019
9ba0dd0
fix warnings in csharp-netcore client (#3831)
wing328 Sep 5, 2019
5d21a8f
Add missing files to the form request (#3834)
etherealjoy Sep 5, 2019
8c637fb
[client][go] avoid duplicated reflect imports (#3847)
qmuntal Sep 6, 2019
f26f726
Following up for #3440 (1792 fix remote spec handling and hash calcul…
fuj1g0n Sep 6, 2019
4a1eb91
Add a link (#3850)
ackintosh Sep 7, 2019
3228ca2
Add Element AI to the list (#3856)
wing328 Sep 7, 2019
2fb08fb
maven-plugin-plugin 3.6.0 (#3854)
sullis Sep 7, 2019
221443a
[Java][okhttp-gson] fix failure to deserialize floats (#3846)
bensimpson-ch Sep 7, 2019
adf1297
Adds Http Info To Dart Api (#3851)
austbot Sep 7, 2019
86adb0a
[C++][Pistache] Add missing setter for arrays (#3837)
muttleyxd Sep 7, 2019
82f00f2
typescript-inversify: improve check for required parameters, support …
bodograumann Sep 9, 2019
0f10987
[typescript-angular] allow empty string basePath (#3489)
martinnovak Sep 9, 2019
bf441c2
Fix/r/serialization fix and minor 3xx resp fix (#3817)
Ramanth Sep 10, 2019
e51ffbe
typescript-axios: Fix baseoptions (#3866)
7474 Sep 10, 2019
0396bb4
Rename gRPC generator to "protobuf-schema" (#3864)
wing328 Sep 10, 2019
3dd0ebd
Prepare v4.1.2 release (#3873)
wing328 Sep 11, 2019
58ec946
fix version in readme
macjohnny Sep 11, 2019
580ca11
BugFix #2053 Spring Boot fails to parse LocalDate query parameter (#3…
peyerroger Sep 11, 2019
fbb3b27
update doc, samples (#3875)
wing328 Sep 11, 2019
549fc8f
update stable release
wing328 Sep 11, 2019
bface47
Update the batch for Windows
hokamoto Sep 12, 2019
5a28be0
Merge branch 'nim-client' of github.com:hokamoto/openapi-generator in…
hokamoto Sep 12, 2019
19cc13b
Merge remote-tracking branch 'upstream/master' into nim-client
hokamoto Sep 12, 2019
2db44c7
Add a test snippet
hokamoto Sep 12, 2019
bcec49b
Update ensure-up-to-date
hokamoto Sep 12, 2019
7276034
Add Nim to README.md
hokamoto Sep 12, 2019
090875b
Ran ensure-up-to-date to pass CircleCI tests
hokamoto Sep 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adds Http Info To Dart Api (#3851)
  • Loading branch information
austbot authored and hokamoto committed Sep 12, 2019
commit adf12973ab11021ea0b4f6008a14d79eca70e574
12 changes: 10 additions & 2 deletions modules/openapi-generator/src/main/resources/dart2/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class {{classname}} {
{{classname}}([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;

{{#operation}}
/// {{summary}}
/// {{summary}} with HTTP info returned
///
/// {{notes}}
{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async {
{{#returnType}}Future<Response> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}WithHttpInfo({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async {
Object postBody{{#bodyParam}} = {{paramName}}{{/bodyParam}};

// verify required params are set
Expand Down Expand Up @@ -87,7 +87,14 @@ class {{classname}} {
formParams,
contentType,
authNames);
return response;
}

/// {{summary}}
///
/// {{notes}}
{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async {
Response response = await {{nickname}}WithHttpInfo({{#allParams}}{{#required}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} {{/hasOptionalParams}});
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -112,6 +119,7 @@ class {{classname}} {
return{{#returnType}} null{{/returnType}};
}
}

{{/operation}}
}
{{/operations}}
96 changes: 80 additions & 16 deletions samples/client/petstore/dart2/openapi/lib/api/pet_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class PetApi {

PetApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;

/// Add a new pet to the store
/// Add a new pet to the store with HTTP info returned
///
///
Future addPet(Pet body) async {
Future addPetWithHttpInfo(Pet body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -48,18 +48,26 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// Add a new pet to the store
///
///
Future addPet(Pet body) async {
Response response = await addPetWithHttpInfo(body);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
} else {
return;
}
}
/// Deletes a pet

/// Deletes a pet with HTTP info returned
///
///
Future deletePet(int petId, { String apiKey }) async {
Future deletePetWithHttpInfo(int petId, { String apiKey }) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -98,18 +106,26 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// Deletes a pet
///
///
Future deletePet(int petId, { String apiKey }) async {
Response response = await deletePetWithHttpInfo(petId, apiKey: apiKey );
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
} else {
return;
}
}
/// Finds Pets by status

/// Finds Pets by status with HTTP info returned
///
/// Multiple status values can be provided with comma separated strings
Future<List<Pet>> findPetsByStatus(List<String> status) async {
Future<Response> findPetsByStatusWithHttpInfo(List<String> status) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -148,7 +164,14 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// Finds Pets by status
///
/// Multiple status values can be provided with comma separated strings
Future<List<Pet>> findPetsByStatus(List<String> status) async {
Response response = await findPetsByStatusWithHttpInfo(status);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -157,10 +180,11 @@ class PetApi {
return null;
}
}
/// Finds Pets by tags

/// Finds Pets by tags with HTTP info returned
///
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Future<List<Pet>> findPetsByTags(List<String> tags) async {
Future<Response> findPetsByTagsWithHttpInfo(List<String> tags) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -199,7 +223,14 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// Finds Pets by tags
///
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Future<List<Pet>> findPetsByTags(List<String> tags) async {
Response response = await findPetsByTagsWithHttpInfo(tags);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -208,10 +239,11 @@ class PetApi {
return null;
}
}
/// Find pet by ID

/// Find pet by ID with HTTP info returned
///
/// Returns a single pet
Future<Pet> getPetById(int petId) async {
Future<Response> getPetByIdWithHttpInfo(int petId) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -249,7 +281,14 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// Find pet by ID
///
/// Returns a single pet
Future<Pet> getPetById(int petId) async {
Response response = await getPetByIdWithHttpInfo(petId);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -258,10 +297,11 @@ class PetApi {
return null;
}
}
/// Update an existing pet

/// Update an existing pet with HTTP info returned
///
///
Future updatePet(Pet body) async {
Future updatePetWithHttpInfo(Pet body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -299,18 +339,26 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// Update an existing pet
///
///
Future updatePet(Pet body) async {
Response response = await updatePetWithHttpInfo(body);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
} else {
return;
}
}
/// Updates a pet in the store with form data

/// Updates a pet in the store with form data with HTTP info returned
///
///
Future updatePetWithForm(int petId, { String name, String status }) async {
Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -360,18 +408,26 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// Updates a pet in the store with form data
///
///
Future updatePetWithForm(int petId, { String name, String status }) async {
Response response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status );
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
} else {
return;
}
}
/// uploads an image

/// uploads an image with HTTP info returned
///
///
Future<ApiResponse> uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async {
Future<Response> uploadFileWithHttpInfo(int petId, { String additionalMetadata, MultipartFile file }) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -420,7 +476,14 @@ class PetApi {
formParams,
contentType,
authNames);
return response;
}

/// uploads an image
///
///
Future<ApiResponse> uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async {
Response response = await uploadFileWithHttpInfo(petId, additionalMetadata: additionalMetadata, file: file );
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -429,4 +492,5 @@ class PetApi {
return null;
}
}

}
48 changes: 40 additions & 8 deletions samples/client/petstore/dart2/openapi/lib/api/store_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class StoreApi {

StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;

/// Delete purchase order by ID
/// Delete purchase order by ID with HTTP info returned
///
/// For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
Future deleteOrder(String orderId) async {
Future deleteOrderWithHttpInfo(String orderId) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -48,18 +48,26 @@ class StoreApi {
formParams,
contentType,
authNames);
return response;
}

/// Delete purchase order by ID
///
/// For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
Future deleteOrder(String orderId) async {
Response response = await deleteOrderWithHttpInfo(orderId);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
} else {
return;
}
}
/// Returns pet inventories by status

/// Returns pet inventories by status with HTTP info returned
///
/// Returns a map of status codes to quantities
Future<Map<String, int>> getInventory() async {
Future<Response> getInventoryWithHttpInfo() async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -94,7 +102,14 @@ class StoreApi {
formParams,
contentType,
authNames);
return response;
}

/// Returns pet inventories by status
///
/// Returns a map of status codes to quantities
Future<Map<String, int>> getInventory() async {
Response response = await getInventoryWithHttpInfo();
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -104,10 +119,11 @@ class StoreApi {
return null;
}
}
/// Find purchase order by ID

/// Find purchase order by ID with HTTP info returned
///
/// For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
Future<Order> getOrderById(int orderId) async {
Future<Response> getOrderByIdWithHttpInfo(int orderId) async {
Object postBody;

// verify required params are set
Expand Down Expand Up @@ -145,7 +161,14 @@ class StoreApi {
formParams,
contentType,
authNames);
return response;
}

/// Find purchase order by ID
///
/// For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
Future<Order> getOrderById(int orderId) async {
Response response = await getOrderByIdWithHttpInfo(orderId);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -154,10 +177,11 @@ class StoreApi {
return null;
}
}
/// Place an order for a pet

/// Place an order for a pet with HTTP info returned
///
///
Future<Order> placeOrder(Order body) async {
Future<Response> placeOrderWithHttpInfo(Order body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -195,7 +219,14 @@ class StoreApi {
formParams,
contentType,
authNames);
return response;
}

/// Place an order for a pet
///
///
Future<Order> placeOrder(Order body) async {
Response response = await placeOrderWithHttpInfo(body);
if(response.statusCode >= 400) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
} else if(response.body != null) {
Expand All @@ -204,4 +235,5 @@ class StoreApi {
return null;
}
}

}
Loading