Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions modules/swagger-codegen/src/main/resources/dart/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ class {{classname}} {
/// {{summary}}
///
/// {{notes}}
{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}, {{/required}}{{/allParams}} { {{#allParams}}{{^required}} {{{dataType}}} {{paramName}}, {{/required}}{{/allParams}} bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
{{#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 {
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};

// verify required params are set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Map;

public class DartClientOptionsProvider implements OptionsProvider {
public static final String SORT_PARAMS_VALUE = "false";
public static final String SORT_PARAMS_VALUE = "true";
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
public static final String BROWSER_CLIENT_VALUE = "true";
public static final String PUB_NAME_VALUE = "swagger";
Expand Down
48 changes: 8 additions & 40 deletions samples/client/petstore/dart/swagger/lib/api/pet_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ class PetApi {
/// Add a new pet to the store
///
///
Future addPet(Pet body, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future addPet(Pet body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -65,11 +61,7 @@ class PetApi {
/// Deletes a pet
///
///
Future deletePet(int petId, { String apiKey, bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future deletePet(int petId, { String apiKey }) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -121,11 +113,7 @@ class PetApi {
/// Finds Pets by status
///
/// Multiple status values can be provided with comma separated strings
Future<List<Pet>> findPetsByStatus(List<String> status, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<List<Pet>> findPetsByStatus(List<String> status) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -177,11 +165,7 @@ class PetApi {
/// 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, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<List<Pet>> findPetsByTags(List<String> tags) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -233,11 +217,7 @@ class PetApi {
/// Find pet by ID
///
/// Returns a single pet
Future<Pet> getPetById(int petId, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<Pet> getPetById(int petId) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -288,11 +268,7 @@ class PetApi {
/// Update an existing pet
///
///
Future updatePet(Pet body, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future updatePet(Pet body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -343,11 +319,7 @@ class PetApi {
/// Updates a pet in the store with form data
///
///
Future updatePetWithForm(int petId, { String name, String status, bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future updatePetWithForm(int petId, { String name, String status }) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -412,11 +384,7 @@ if (status != null)
/// uploads an image
///
///
Future<ApiResponse> uploadFile(int petId, { String additionalMetadata, MultipartFile file, bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<ApiResponse> uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async {
Object postBody = null;

// verify required params are set
Expand Down
24 changes: 4 additions & 20 deletions samples/client/petstore/dart/swagger/lib/api/store_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ class StoreApi {
/// 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, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future deleteOrder(String orderId) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -65,11 +61,7 @@ class StoreApi {
/// Returns pet inventories by status
///
/// Returns a map of status codes to quantities
Future<Map<String, int>> getInventory( { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<Map<String, int>> getInventory() async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -117,11 +109,7 @@ class StoreApi {
/// 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, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<Order> getOrderById(int orderId) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -172,11 +160,7 @@ class StoreApi {
/// Place an order for a pet
///
///
Future<Order> placeOrder(Order body, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<Order> placeOrder(Order body) async {
Object postBody = body;

// verify required params are set
Expand Down
48 changes: 8 additions & 40 deletions samples/client/petstore/dart/swagger/lib/api/user_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ class UserApi {
/// Create user
///
/// This can only be done by the logged in user.
Future createUser(User body, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future createUser(User body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -65,11 +61,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future createUsersWithArrayInput(List<User> body, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future createUsersWithArrayInput(List<User> body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -120,11 +112,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future createUsersWithListInput(List<User> body, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future createUsersWithListInput(List<User> body) async {
Object postBody = body;

// verify required params are set
Expand Down Expand Up @@ -175,11 +163,7 @@ class UserApi {
/// Delete user
///
/// This can only be done by the logged in user.
Future deleteUser(String username, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future deleteUser(String username) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -230,11 +214,7 @@ class UserApi {
/// Get user by user name
///
///
Future<User> getUserByName(String username, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<User> getUserByName(String username) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -285,11 +265,7 @@ class UserApi {
/// Logs user into the system
///
///
Future<String> loginUser(String username, String password, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future<String> loginUser(String username, String password) async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -345,11 +321,7 @@ class UserApi {
/// Logs out current logged in user session
///
///
Future logoutUser( { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future logoutUser() async {
Object postBody = null;

// verify required params are set
Expand Down Expand Up @@ -397,11 +369,7 @@ class UserApi {
/// Updated user
///
/// This can only be done by the logged in user.
Future updateUser(String username, User body, { bool justIgnoreThisFlag: true}) async {
if (!justIgnoreThisFlag) {
print('Why??? Just trust me, I only need this variable inside the mustache codegen template.');
// This code may be removed as soon as dart accepts trailing spaces (has already been implemented).
}
Future updateUser(String username, User body) async {
Object postBody = body;

// verify required params are set
Expand Down