1199 Commits

Author SHA1 Message Date
Justin Black
fc58adee31
Fixes serialization of array items in model_to_dict [python] (#9153)
* Adds tests of endpoint with inline and refed model

* Regen samples

* Samples regenerated
2021-04-01 13:34:19 -07:00
Justin Black
71f67c3d40
Samples regenerated (#9154) 2021-04-01 11:31:21 -07:00
sforst
7bf792a348
[typescript-axios] handle uniqueItems in query and header parameters (#8965)
* [typescript-axios] handle uniqueItems in query and header parameters

add endpoint /fake/test-unique-paramters to petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml for demonstration

* update samples

* [typescript-axios] update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-04-01 16:57:36 +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
Justin Black
6cc270633b
[python] Fixes additional_properties_type for models (#8802)
* Fixes additionalProperties values for models, updates docs, adds tag test of it, fixes frit and gmfruit tests

* Moves this.setDisallowAdditionalPropertiesIfNotPresent higher

* Makes setting additional_properties_model_instances contingent on the presence of addprosp in schema, updates sample spec composed schemas to remove addprops False form two

* Fixes oneOf anyOf allOf instantiation logic

* Removes Address from Cat definition

* Adds required vars for apple and banana, removes required vars from composed schema init sig

* Updates composed schema vars to be set on self and all composed instances

* Removes get_unused_args, get_var_name_to_model_instances, and get_additional_properties_model_instances

* Fixes fruit + deserilization tests, creates ComposedSchemaWithPropsAndNoAddProps

* Fixes FruitReq tests

* Fixes GmFruit tests

* Fixes discard_unknown_keys tests

* Samples updated

* Removes additionalproperties False in Child

* Samples updated

* Improves handling of v2 and v3 specs for isFreeFormObject, v2 sample spec updated with link to bug

* Adds cli option disallowAdditionalPropertiesIfNotPresent to python

* Adds getAdditionalProperties method so the value for addProps will be correct

* Reverts file

* Reverts file

* Updates python doc

* Reverted anytype_3 definition

* Updates test_deserialize_lizard

* Updates test_deserialize_dict_str_dog

* Updates testDog

* Updates testChild

* Adds v2 python_composition sample

* Adds needed files for python testing

* Adds existing tests into the new python sample

* Fixes test_dog

* Removes addProps false form Dog

* Fixes testChild

* Updates how additionalProperties are set

* Fixes empty_map type

* Type generation fixed for v2 and v3 specs

* Refactors getTypeString, updates artifactids in pom.xml files

* Adds new python sample to CI testing I think

* Fixes artifactId collision, regenrates docs
2021-03-31 08:48:12 -07:00
Peter Leibiger
47e292c0e7
[dart][dart-dio] Remove sample formatting from dart-dio-next (#9121) 2021-03-31 16:45:47 +08:00
William Cheng
de5651adac
[C#] fix integer enum without format (#9136)
* fix inner enum integer without format

* add line break, update samples

* remove line break

* add line break

* update SHA
2021-03-31 15:11:10 +08:00
Justin Black
ae099330b9
Feature fixed, samples regenerated (#9131) 2021-03-29 23:42:14 -07:00
William Cheng
a35e9b590c Merge remote-tracking branch 'origin/5.2.x' into 6.0.x 2021-03-30 13:18:35 +08:00
William Cheng
3973d4c831 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-03-30 12:00:41 +08:00
William Cheng
a3072680cd update samples 2021-03-30 11:54:37 +08:00
William Cheng
99ddd6d2f2 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-03-30 11:41:09 +08:00
Jakob
0af45b3823
[Java] add jackson annotations to setters (#9041)
* [Java] add jackson annotations to setters

Closes #6856

* [Java] fix conflictiong setter with JsonNullable
2021-03-30 11:17:15 +08:00
Peter Leibiger
f66fbf6969
[dart][dart-dio] Update dependencies (#9122)
* [dart-dio] Update dio

* [dart-dio] Update to dio 4.0.0

* [dart-dio] Fix dependency problems with Dart 2.12 SDK during build

* Revert changes to analyzer

This only fails locally, not sure why. CI only shows a warning.

* Fix compile error after http_mock update
2021-03-30 00:17:37 +08:00
William Cheng
a078b1d826 Merge branch '5.2.x' into 6.0.x 2021-03-29 12:56:33 +08:00
linnefromice
70616b541e
[Ruby] remove duplicated supportingFiles.add (#9108)
* remove duplicated supportingFiles

* modify examples - remove duplicated supportingFiles
2021-03-29 11:31:24 +08:00
William Cheng
9fb97c6c29
postpone require models with parent (#9103) 2021-03-29 11:07:57 +08:00
Justin Black
fe52529f05
[python] fix custom model template feature (#9118)
* Removes colliding __init__model.mustache in PythonClientCodegen.java

* Removes unused files

* Regenerates samples
2021-03-28 11:28:25 -07:00
tomred-net
38b49e77af
fix #8755 [BUG] Java (jersey2) ApiClient debug cannot be enabled (#8756)
* fix #8755 [BUG] Java (jersey2) ApiClient debug cannot be enabled

* fix #8755 updating samples
2021-03-27 10:01:39 +08:00
William Cheng
16b141e402 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-03-26 10:20:36 +08:00
Florian Kamella
03be3c612d
Fix default value generation for composed schemas in AbstractJavaCodegen (#8918) 2021-03-24 00:36:54 +08:00
William Cheng
d438d797da
[C#][netcore] Fix model, property name check (#9049)
* fix model, property name check in c# generator

* remove file

* remove file

* specify name
2021-03-23 20:00:26 +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
de8b344a34
[dart] Generic docs update and fixes (#8999)
* [dart] Generic docs update and fixes

* none of the dart generators supports XML
* jaguar is no longer maintained
* dart and dart-dio support bearer token
* none of the dart generators supports composition atm.

* [dart-dio] Supports customization of authorizations and userAgent

* Remove deprecation of dart-jaguar for now
2021-03-19 21:15:13 +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
Thomas Hervé
a1392305f1
Skip examples on complex body in Java (#8887)
* Skip examples on complex body in Java

This removes complex examples in Java which would not result in valid
code.

* Warn example being skip
2021-03-16 10:09:03 +08:00
Oleh Kurpiak
cfe86d9594
[Java][Server] fix default value (#8577)
* [Java][Server] fix default value

* [Java][Server] fix default value
2021-03-15 21:25:48 +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
Peter Leibiger
bf35ceee25
[dart][dart-dio] Lower upper bound for built_value (#8947)
The `8.x` versions are no longer compatible with the current generated code. An update is also not possible without breaking change and null-safety support.
2021-03-11 12:10:58 +08:00
Justin Black
786c71f339
Adds hasVars (#8928)
* Adds getHasVars and setHasVars to IJsonSchemaValidationProperties

* Updates CodegenModel

* Updates CodegenProperty

* Updates codegenparameter

* Updates codegenresponse

* Adds testHasVarsInModel

* Adds testHasVarsInProperty

* Updates testHasVarsInProperty

* Adds testHasVarsInParameter

* Adds testHasVarsInResponse

* Samples update
2021-03-09 12:14:02 -08:00
Justin Black
8226269101
Fixes legacyDiscriminatorBehavior description (#8931)
* Fixes description

* Samples and docs updated
2021-03-08 13:39:12 -08:00
Tyler Ballast
f5151de9fc
Add whitespace to SDK documentation where necessary (#8919)
* Add a space between table title and the line above it to resolve issues when translating markdown to asciidoc

* Regenerate Samples

Co-authored-by: Tyler Ballast <tyler.ballast@reportix.com>
Co-authored-by: tballast <tyler.ballast@gmail.com>
2021-03-08 21:40: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
Justin Black
101da6e434
Adds getAdditionalPropertiesIsAnyType to java schema classes (#8908)
* Adds getter and setter for AdditionalPropertiesIsAnyType in IJsonSchemaValidationProperties

* Removes venv

* Implements getter and setter in CodegenModel

* Implements getter and setter in CodegenProperty

* Implements getter and setter in CodegenParameter

* Adds getter and setter in CodegenResponse

* Creates setAddProps

* Removes comment

* Adds setAdditionalPropertiesIsAnyType invocations

* Updates samples

* Updates tests in testAdditionalPropertiesPresentInResponses

* Updates tests in testAdditionalPropertiesPresentInParameters

* Updates testAdditionalPropertiesPresentInModelProperties to check getAdditionalPropertiesIsAnyType

* Updates testAdditionalPropertiesPresentInModels
2021-03-07 09:42:47 -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
Peter Leibiger
d31875f505
[dart][dart-dio] Fix failing master due to unstable test dependency (#8870)
* replace branch ref with commit ref (new release of http_mock_adapter coming soon)
2021-03-03 13:00:22 +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
5ce64756a6
[dart][dart-dio] Handle nullable/required header/query parameters (#8837) 2021-03-02 11:09:47 +08:00
Peter Leibiger
2ed702b339
[bug][dart][dart-dio] Improve parameterToString handling (#8372)
* [dart][dart-dio] Improve parameterToString handling

* add tests
* not sure this is complete but it is better than before and can serve as a baseline with the test cases

* Add a map parameter to FormData test

* Rename method to clarify what it actually does

* Couple more tests
2021-03-02 11:08:47 +08:00
Thomas Hervé
3cf93226fa
Make nullable fix on all vars in Go (#8820)
* Make nullable fix on all vars in Go

This applies the Nullable change to all variables on the model, instead
of just the ones in vars.

* Add sample showing the issue
2021-02-27 18:12:51 +08:00
Peter Leibiger
3e9c1e1fc3
[dart] Remove old leftover format parameter from path (#8834) 2021-02-25 20:29:34 +08:00