131 Commits

Author SHA1 Message Date
William Cheng
0357b80f19 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-01 14:16:17 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
William Cheng
0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3ed f8ff8c87609
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c87609b1ca36fa26fb8474806999638195e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709d6a3f846a9fe4520b78c3d637051d9
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e2333f3ae19ef6fc89318b7e263a80c
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f48227d55531b94e307d72671373737
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722c34aa094b4aeb11c22664529c3a219
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e3594bf0d30e580bc9408e45b018a57
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +08:00
agilob
7edddb6531
Add map property in url params (#10154)
* Add map property in request params

* Regenerate samples to include map in url property
2021-08-17 18:31:53 +08:00
William Cheng
eaa76f8e1f Merge remote-tracking branch 'origin/master' into 6.0.x 2021-08-17 18:10:59 +08:00
William Cheng
764a462711 Merge remote-tracking branch 'origin/5.3.x' 2021-08-16 21:38:34 +08:00
William Cheng
8403e59aa0
Prepare 5.2.1 release (#10161)
* prepare for 5.2.1 release

* update samples
2021-08-16 19:08:29 +08:00
Yorick Holkamp
189b44b191
[dart2] Include request body on DELETE call (#10100)
* 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
2021-08-07 21:11:03 +08:00
William Cheng
b799ca9ee0 Merge remote-tracking branch 'origin/5.3.x' into 6.0.x 2021-07-27 11:52:19 +08:00
William Cheng
56aafe30d9 Merge remote-tracking branch 'origin/master' into 5.3.x 2021-07-27 11:33:35 +08:00
Jon Jensen
bd070308d9
[Java][*] Annotate deprecated operations and schemas (#9478)
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
2021-07-19 10:27:03 +08:00
Peter Leibiger
5920bbd6df
[dart] Fix tests failing in CI after automatic dependency update (#9961)
* prevent future problems of this kind by adding the pubspec.lock file to VCS for all 3 test projects
2021-07-16 21:05:23 +08:00
William Cheng
05e4c3cf64 update samples 2021-07-12 17:15:22 +08:00
William Cheng
35f933b27f Merge remote-tracking branch 'origin/5.3.x' into 6.0.x 2021-07-12 17:11:35 +08:00
William Cheng
39fbf53150 create v5.3.0 2021-07-10 00:12:23 +08:00
William Cheng
02835b35bc
Prepare v5.2.1 (#9922)
* bump verions to 5.2.1-SNAPSHOT

* update samples

* update readme

* fix gradle properties
2021-07-09 22:42:31 +08:00
William Cheng
90f7bcd909
Prepare v5.2.0 release (#9920)
* 5.2.0 release

* update samples

* update meta codegen
2021-07-09 17:06:55 +08:00
Gabriel Rohden
44c1fee3e2
[dart] fix some compilation issues and added casts for analyzer implicit-casts flag (#8244)
* fix: missing dart casts and analyzer issues

* chore: regenerate dart template files

* refactor: remove unneeded implicit-casts:false and regenerate sources

* chore: regenerate templates after merge

* chore: regenerate dart pet store codes
2021-06-24 10:24:28 +08:00
Peter Leibiger
afd65b3cb0
Update query parameter sample to include pipe delimiter (#9590) 2021-05-30 17:45:38 +08:00
Peter Leibiger
f7b93ebdf2
Update fake API to contain sample with binary body (#9610) 2021-05-29 10:26:01 +08:00
William Cheng
28c3e1d544 update samples, docs 2021-05-28 10:26:48 +08:00
adessoDpd
12c34d4658
New generator: WSDL (#9545)
* init port

* add outputDir

* fill out current .md

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-05-28 10:22:28 +08:00
Peter Leibiger
6edbc91eeb
[dart][dart-dio] Update docs for dart-dio-next (#9584)
* 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
2021-05-27 10:58:37 +08:00
William Cheng
32d5900611 update samples, docs 2021-05-27 10:40:32 +08:00
desmese
4f1d8f4699
- added localVar prefix to the contentType variable defined in the api.mustache template in the java resttemplate library (#9568)
- rerun generate-samples.sh and export_docs_generators.sh
2021-05-27 10:24:38 +08:00
alespour
e360228a76
fix: dart2 mustache templates minor improvements (#9539)
* fix: prefer_is_not_empty linter suggestion

* fix: annotate_overrides linter suggestion

* chore: update samples
2021-05-24 11:01:53 +08:00
Peter Leibiger
55b95bc9c5
Fix CircleCI failures (#9503)
* 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
2021-05-18 23:09:29 +08:00
William Cheng
5e29d61639 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-05-13 18:44:58 +08:00
Adi1231234
1961c661f3
upgrade dart generator dependencies (#9392)
* upgrade intl package

* upgrade http package and change url to uri

* update petstore sample

* update pubspec files

* upgrade http dependency

* upgrade dev dependencies

* update json_serializable and test

* delete nullable - deprecated on json_serializable 4.1.1

* fixed NNBD issue

* change test version
2021-05-10 16:07:03 +08:00
William Cheng
3e58b0908c Merge remote-tracking branch 'origin/5.2.x' into 6.0.x 2021-04-28 18:08:24 +08:00
William Cheng
917b358e27 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-04-01 09:25:19 +08:00
Noor Dawod
26ca6ab27e
[Dart2] Add initial support to use an isolate to offload JSON serialization/deserialization (#9100)
* 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.
2021-03-31 23:53:22 +08:00
William Cheng
95d356ab6b Merge remote-tracking branch 'origin/5.2.x' into 6.0.x 2021-03-21 01:10:46 +08:00
William Cheng
47483e60cb update version to 5.2.0-SNAPSHOT, update samples 2021-03-21 00:10:10 +08:00
William Cheng
0dc62e8b79
Prepare v5.1.1 in the master (#9027)
* Prepare v5.1.1 in the master

* move dart dio next to configs/other
2021-03-20 23:05:11 +08:00
William Cheng
e023eaa821
Prepare v5.1.0 release (#9017)
* prepare v5.1.0 release

* update samples (dart-dio-next)
2021-03-20 16:45:05 +08:00
Peter Leibiger
3d038b74fd
[dart][dart-dio] Next-gen dart-dio generator (#8869)
* [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
2021-03-20 12:26:56 +08:00
Peter Leibiger
d29d898774
[dart] Ensure tests compile with Dart 2.12+ (#8984) 2021-03-17 21:53:48 +08:00
agilob
8a11a1aa74
[dart] Split mustache file by serialization (#8958)
* Split mustache file by serialization

* Move specific serialization files to own directories

* Deduplicate constructor in dart client generator
2021-03-17 11:41:25 +08:00
William Cheng
3909505c5b Merge remote-tracking branch 'origin/master' into 6.0.x 2021-03-13 23:26:43 +08:00
agilob
b782cff511
[dart] Fix api client deserialization for json_serializable (#8882)
* 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
2021-03-11 21:16:54 +08:00
William Cheng
7720c9f6bd update samples 2021-03-08 19:05:16 +08:00
Jiri Kuncar
8cb4741248
[go][client] Fix example value for non string enums (#8900)
* [go][client] Fix example value for non string enums

* regenerated samples
2021-03-08 18:11:50 +08:00
William Cheng
2b3b5a71cf update samples 2021-03-03 16:29:52 +08:00
William Cheng
d96197bcbd Merge remote-tracking branch 'origin/master' into 6.0.x 2021-03-03 16:19:20 +08:00
agilob
83a5c3db1e
[dart] Default value is only available when nullable is not set (#8854)
* Default value is only available when nullable is not set (not false)

* Simplify isNullable mustache syntax
2021-03-02 18:06:45 +08:00
Peter Leibiger
3e9c1e1fc3
[dart] Remove old leftover format parameter from path (#8834) 2021-02-25 20:29:34 +08:00
agilob
9fc33f6a73
[Dart] Add configuration to add new generators and add json_serializable (#8789)
* 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
2021-02-25 17:11:16 +08:00
Peter Leibiger
4f4f1d4128
[dart][dart-dio] Remove manual json encode/decode calls in API classes (#8812)
* [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
2021-02-24 23:29:41 +08:00
Peter Leibiger
c916df9381
[dart][dart-dio] Nullable support/improvements (#8727)
* [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
2021-02-17 21:44:21 +08:00