1230 Commits

Author SHA1 Message Date
William Cheng
73564bc046 update samples 2021-04-28 17:57:26 +08:00
William Cheng
37eaf70755 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-04-28 17:48:21 +08:00
William Cheng
f572125b30
[Python] Fix exclusive min and max (#9340)
* [Python] Fix exclusiveMinimum and exclusiveMaximum conditions

* add tests, update samples

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>
2021-04-26 14:01:40 +08:00
Moshe Elisha
af992e4b29
[Java] [Native] Add response body to exception message (#9169)
* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Revert "Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true"

This reverts commit 56e2b1fb

* Revert "Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true"

This reverts commit 335c304d

* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Fix #8027 - import the auto generated supporting JSON class only when discriminator is needed

* Fix #8027 - import the auto generated supporting JSON class only when discriminator is needed

* Fix #8027 - import the auto generated supporting JSON class only when discriminator is needed

* [Java] [Native] Add response body to exception message

* [Java] [Native] Use default base URI if baseUri param is null

* [Java] [Native] Use default base URI if baseUri param is null
2021-04-16 11:02:56 +08:00
Thomas Hervé
60dcf8613f
Don't include read-only properties in Python examples. (#9252)
* Don't include read-only properties in Python examples.

When using a schema with read-only fields as API inputs, Python
generates examples for those: this excludes them.

* Fix tests
2021-04-14 11:43:28 -07:00
Peter Leibiger
b4ea00ed42
[dart][dart-dio] Add built_value date support w/o timemachine (#9180)
* [dart][dart-dio] Add built_value date support w/o timemachine

* Test improvements

* Fix lists of dates not working
2021-04-13 16:52:27 +08:00
Peter Leibiger
29c1688860
[dart][dart-dio] Update pubspec/readme templates (#9201)
* Add homepage option to pubspec.yaml

package validation fails when trying to publish to pub.dev

See: https://dart.dev/tools/pub/pubspec
Blocking https://github.com/bigpanther/trober/pull/108

cc: @kuhnroyal

* Add missing fields

* Update templates and generate samples

Co-authored-by: Harsimran Singh Maan <maan.harry@gmail.com>
2021-04-13 14:37:15 +08:00
gbmarc1
8e0955fd3c
Bug - python client deserialization when attribute named self (#9006)
* fix by mapping outside of class

* tests

* regeneration and tests

* server

* INDENT

* a

* enable mapping

* Revert "server"

This reverts commit 6fc9712fb550d258d0332df243ea5080565c6770.

* Samples regenerated

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2021-04-10 19:00:32 -07:00
mazrean
01ff635139
[Go] Fix golang comment typos (#9207)
* fix go comment typo insensitive

* fix go comment typo response

* update samples
2021-04-08 09:59:31 +08:00
Peter Leibiger
065c0281fa
[dart] Improve types & imports (#9167)
* [dart] Improve types & imports

* don't use importMapping as it is intended for something different that is not possible in dart
* introduce imports map for dart specific features
* always import `dart:core`
* get rid of additionalReservedWords
* fix `--type-mappings` not working
* use required type mappings in samples
* no longer define additional reserved words  as it is impossible to list all anyways, they can now be configured via type-mapping parameter
* simplify dio imports

* Don't use guava for map instantiation

* Update docs
2021-04-07 00:33:35 +08:00
Peter Leibiger
29c131e781
[dart][dart-dio] Update dependencies (#9178)
* finally use released versions for http mocking
2021-04-05 23:39:18 +08:00
Yuri Orlov
659b00a4f9
use standard constant for UTF8 charset in generated java api clients (#7828) 2021-04-05 20:02:28 +08:00
Hippolyte HENRY
f8202df9aa
[go] Add constructor and IsValid method to enum types (#8224)
* Add constructor and IsValid method to enum types

* Add samples
2021-04-04 17:32:17 +08:00
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