dart: fix required params. add 'multi' query params. better deserialization.#3325
Conversation
other features: - remove crypto dependency. base64 encoding is now part of dart.convert. - port Java query param handling to dart. → allows us to use 'multi' collectionFormat for queryParams - use async await where possible.
* added api_helper.dart for a helper function. * defaultApiClient is now a variable instead of a static field inside ApiClient * a lot of functions inside ApiClient are no longer static. * optional params are now named params (needed to introduce a justIgnoreFlag as hack) * queryParams now support the multi format and are therefore no longer a Map<String, String>, but a List<QueryParam> * renamed apiException.mustache to api_exception.mustache to conform with other file names. * removed unused import: 'dart:html' * removed 'package:crypto/crypto.dart' dependency. 'dart:convert' has a base64 converter now. * use null-aware operator for apiClient assignment in xxxApi constructors. * enable testStoreApi (which returned a Future nobody waited for) * fix types in tests. Some ids were passed as Strings instead of ints. * adapt tests to use the optional named arguments (for optional query args) * generate random ids in tests. Otherwise insertion will always succeed if the test has been called once.
|
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/swagger-api/swagger-codegen/graphs/contributors. Let me know if you need help fixing it. Ref: http://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit |
|
|
||
| # for dart vm lib generation: | ||
| #ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart --additional-properties browserClient=false" | ||
|
|
There was a problem hiding this comment.
You may want to create another dart petstore shell script (e.g. dart-vmlib-petstore.sh) for the --additional-properties browserClient=false option (similar to what we've done for other langauges, e.g. java)
There was a problem hiding this comment.
And you may consider later adding a CLI option (e.g. dartBrowserClient) instead of using additional properties.
|
Hi, (from another account) I don't really care about being listed in the contributers file. I have opened an issue for the cli option and dartvm shell script. |
Changing the basePath is pretty annoying otherwise, because you would need to set the basePath for every Api.
Otherwise projects may not use different apis generated by swagger, because library names must be unique.
|
@close2 the commit authorship is fixed. Thanks for the PR, which has been merged into master. |
see commit messages for more details