* Include request body on DELETE call
This change updates the generated `ApiClient` to include the request body on DELETE calls. [Per the RFC on page 2][1], DELETE calls are allowed to have a request body, even though the behavior may be undefined. I've not come across many APIs that use this behavior but there are a few, in particular the [Ory Kratos API][2] does so, not forwarding the body prevents such an API from being used. An API spec that does not define a request body should continue to function as expected.
[1] https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5
[2] https://www.ory.sh/kratos/docs/reference/api/#operation/submitSelfServiceLogoutFlowWithoutBrowser
* Samples generated with dart2 template change
Refs #3358
Ensure `deprecated` operations are annotated/documented as such on the
generated methods. Libraries updated:
* [feign]
* [google-api-client]
* [microprofile]
* [okhttp-gson]
* [resttemplate]
* [retrofit]
* [retrofit/play*]
* [webclient]
* [vertx]
Ensure `deprecated` schemas are annotated/documented as such on the
generated classes/fields. Libraries updated:
* [feign]
* [google-api-client]
* [jersey2]
* [microprofile]
* [native]
* [okhttp-gson]
* [rest-assured]
* [resteasy]
* [resttemplate]
* [retrofit*]
* [webclient]
* [vertx]
Also fix two minor bugs to get the java sample tests working:
* Fix an invalid jackson-datatype-threetenbp version number in vertx/pom.mustache
* Fix a bad return type in webclient/api_test.mustache when uniqueItems=true
Since this commit updates petstore-with-fake-endpoints-models-for-testing.yaml,
several other samples were updated, but it's just new files to reflect the
deprecated schemas, so there should be no consequential differences.
Relevant bits of the spec:
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-operationdeprecated
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-schemadeprecated
* remove deprecated author field from all pubspec templates
* improve dart-dio-next readme/markdown documentation
* add a lot of dart-doc to model and API classes
* Fix go-echo-server sample not running in CircleCI
* remove wrong argument
* [dart] Fix petstore sample tests & Multipart not working
* follow up to #9392
* `MultipartRequest(null, null)` is no longer valid after `http` package upgrade
* fix petstore sample project not compiling
* disable live petstore tests
* use template to strip out unused code blocks
* Change signature of deserialize() to be a Future.
* Grammar tlc for a couple of sentences.
* Make serialize() use a Future also.
* Add useCompute as a parameter to ApiClient, adjust to use compute when serializing/deserializing.
* Updated Pet Store client code.
* Ordered imports.
* Remove Flutter-specific implementation.
* Rename global functions to serialize/deserialize JSON.
* Fix return type for apiClientSerialize.
* Updated pet store client code.
* Remove remark for _deserialize.
* Make _decodeBodyBytes a Future function.
* Updated pet store client code.
* Use await when calling serialize().
* Fix a grammatical error.
* Adjust doc.
* Centralize deserialization code in one function.
* Updated pet store client code.
* Add await to serialize() in few more tests.
* Make output look better for linting and humans.
* Updated pet store code.
* Add an empty line.
* Updated pet store code.
* Call the right serializer.
* Reuse same variable.
* Updated pet store code.
* Fix a logical error when deserializing.
* Calculate growable once.
* Ignore reassignment.
* Adjust a test.
* Regenerate petstore code.
* Revert back previous test.
* Use serialize() for testing.
* Revert using serialize() for testing.
* Add removal deprecation for serialize/deserialize.
* Updated petstore code.
* Updated deprecation note.
* Adjust tests to wait for futures.
* [dart-dio] Remove old Dart 1.x templates
* [dart-dio] Initial version of a next-gen Dart Dio generator
* Fix a couple readme links and examples
* Fix import in testcase
* Add integration tests to master POM
* Run initial dart format and improve some base formatting
* Generate docs
* Use integer matchers in test for content-length
* Separate more built_value specific files
* Fix mustache partial path
* Update pubspec template
* Fix tests after mock lib updates
* Generate with new built_value pre-release
This solves the problem of not being able to serialize null.
* Update built_value dependency
* Regenerate after merge
* Regenerate tests
* Fix missing byte response cast
* Update dio to 4.0.0-prev1
* Run format
* Ignore unused imports in inheritance classes
* Update mock test library
* Update docs
* Make a couple variables final
* Update and freeze dio dependency
* Update generator doc
* Add a new option to post processes all dart output at once
This is much faster than individual files. The committed samples should be formatted since Dart is very opinionated and it makes diffs in PRs much easier to read.
Due to this, we also need to format in CI, otherwise there is a git diff.
* Test some CI stuff
* Fix api-client deserialization for json_serializable
* Use raw string for url path
* Use Set/List.of
* Use returnTypeIsPrimitive in template
* Regenerate all templates
* Fix casting map to Iterable of things
* Add json_serializable to maven modules
* Run build_runner before pub run test
* Return future of type for strong linter mode
* Add Dart configuration flag to set new generator
* Change templates to add json_serializable generator
* Fix dart tests
* Add custom serialization for standard generator
* this change opens us a way to allow adding more than 2 generators
* Add sample project for json_serializer
* Use basename for json field name
* Update samples with basename as json key
* Update dart generator docs
* Create AbstractDartCodegen class
* Update docs, dart-dio and dart-jaguar dont get json_serializable yet
* Deduplicate method calls
* Dix dart-dio generation
* Revert formatting change in dart mustache
* Fix formatting changes again
* Improve dart serialization documentation
specify default serializer
* Better name for cli option
* Rename default dart generator to 'native'
* Another attempt to reduce whitespace noise
* Fix api-client and api-helper
* Rename default serialization mode to include word serialization
* Remove trailing whitespace in enums
* [dart][dart-dio] Remove manual json encode/decode calls in API classes
Dio automatically adds a default transformer which does call `json.encode` and `json.decode` when the content-type is `application/json`. When the content-type is different, then it is up to the consumer to configure the Dio instance correctly to support custom content-types.
Also tests!!!
* [dart] Constraint test library to < 1.16.0 as it requires Dart 2.12.0
* Fix more constraint problems for the new test project
* [dart-dio] Disable nullable fields by default
This is not in line with the OAS and will prevent future Dart nullabilty features (NNBD) from being useful as all types would be optional.
Users can still opt-in for this.
* [dart-dio] Properties are nullable when not required AND not nullable
* [dart][dart-dio] Support nullable/required fields
* properties in built_value need to be nullable when they are nullable in OAS or when they are not required in OAS
* built_value does not support serializing `null` values by default as it is based on a serialization format based on iterables/lists and not maps
* dart-dio uses the built_value json plugin to convert the built_value format to regular json
* by generating a custom serializer for each class we can add support for serializing `null` values if the property is required AND nullable in OAS
* this is a breaking change as not all properties in the models are nullable by default anymore
* Implement required/nullable for dart
* Changes for set types and enum names after rebase
* Add some comments and fix built_value fields with default being nullable
* More rebase changes and regenerate docs