* dart2: Use the correct classname in test generation
At present test generation has a stray hard-coded reference to the pet
store Pet() class, which should reflect the actual classname under test.
* dart2: Call toDouble() in generated code for double types
At present the generated code does not correctly handle transitioning
to double when dealing with non-integer types in JSON deserialization.
This ends up with dart raising an unhandled type mismatch exception:
Unhandled exception: type 'int' is not a subtype of type 'double' where
...
Using the .toDouble() conversion when a double type is expected fixes
this up by making the typing explicit.
* dart2: Drop use of deprecated 'new' keyword in generated code
The use of the 'new' keyword in dart2 is deprecated and should be
avoided, as per the official guidance of the dart2 authors:
https://dart.dev/guides/language/effective-dart/usage#dont-use-new
* dart2: Regenerate samples for mustache template changes
* Use isNotEmpty instead of length in dart2 validity checks
In dart2 the preferred method of checking whether an object is empty or
not is to use the .isNotEmpty property. An aspect that is now warned
about by the linter.
While not an issue in this particular case - testing length can also
have negative performance implications for Iterable collections, which
are not required to know or provide their length deterministically.
* Prefer equals for default values in dart2
The dart2 linter complains about m({a: 1}) style assignments, preferring
m({a = 1}) instead. Update the api_client generation to follow this.
* Regenerate dart2 samples for mustache template changes
* [dart] Fix authentication so all forms of Swagger 2.0 authentication work
* Run changes on petstore examples
* Amend dart2 generated README to cover basic authentication
* Amend dart2 generated README to cover authentication methods
* [dart] Fix authentication so all forms of Swagger 2.0 authentication work
* Run changes on petstore examples
* fix: set fields to null if json value is null.
* rebuild dart2 petstore
* rebuild dart petstore
* rebuild petstore
* [DART]fix: set fields to null if json value is null.
* copy mustache templates from dart generator
* Start with generator by copying the DartClientCodegen for now
* at least we know this is not for a browser..
* First working version for a simple swagger configuration
* remove browserClient parameter, since it doesn't make sense for flutter
* Take care of complex types to support object hierarchies
* add null safety
* add small test for options
* add flutter-petstore scripts
* generate flutter petstore output
* Add new flutter test project
* move generated client to make it usable
* use generated swagger petstore plugin
* add support for lists of objects
* add DateTime support
* fix listFromJson implementation
* fix NPEs in DateTime operations + place order in sample
* Small readme changes
* bugfixes
* Use flutter-compatible implementation as default dart implementation
* fix generated samples
* Make lists serializable, now all dart test cases are working again
* better list implementation
* use StringBuffer
* removed FlutterClientCodegen
* fix browser client
* fix dependencies
* swagger-browser-client for browserClient testcases
* fix scripts
* removed flutter scripts
* add map support and simplify code via using .toJson contract
* remove unneeded devDependencies
* Regenerated samples
* fix call to mapFromJson, it is not a constructor
* remove pointless string serialization
* regenerated dart samples
* Added support for enums in Dart.
* Pick non-private names for enum values.
The _ prefix denotes a private member in Dart, so avoid generating enum values starting with this character.
* Properly encode enum values into query paramters.
* Various cleanups.
* Add support for x-enum-values extension.
Use class instead of enum for better ergonomy.
Better generated enum names.
* Fixed test.
* Support enum descriptions.
* Update samples for several languages.
Just whitespace changes and some reordering where the order doesn't matter.
* Adding generated .swagger-codegen/VERSION files.
* fix: query params may be ints as well
don't assume query params are Strings or List<String>s
* fix dart: use correct type for QueryParams
type is Iterable, not List
only check params for != null if they haven't been checked already
add some casts to make strong mode happy
update petstore
* feat dart: enable strong mode
* feat dart: generate both browser and vm library
move petstore client into subdirectory and reference
generated libraries using path in pubspec.yaml
* feat dart: refactor petstore test.
The new layout resembles a real project.
petstore test is now strong mode compatible.
* feat: add DateTimerParser transformer
* feat: improved exception reporting
* feat[dart]: handle patch requests
* fix[dart]: typo
* fix dart: remove findPetsByTag test; enable strong-mode
find pets by tag call is deprecated and returns 500
generated library is now strong mode compatible
* 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.