267 Commits

Author SHA1 Message Date
William Cheng
c982421495
[Go] use EqualFold instead instead of comparing strings in lower case (#12741)
* use EqualFold instead in the go client

* update samples
2022-06-30 23:09:10 +08:00
William Cheng
29ea48ee96
update jackson-databind-nullable to 0.2.3 (#12693) 2022-06-25 12:45:17 +08:00
William Cheng
3bc4416554 update go samples 2022-06-11 09:24:50 +08:00
Beppe Catanese
aeb40ab0ae
[Go] Address Gosec vulnerabilities in Go client mustache template (#12540)
* Fix potential file inclusion via variable

* Fix deferring unsafe method "Close" on type "*os.File"

* Update samples

* Correction to use existing variable

* Correction generated samples
2022-06-11 09:10:48 +08:00
Jean-François Côté
45f430f5c8
Fix problem when uploading file using form-data in jersey2 client (#12563)
* Fix problem when uploading file using form-data in jersey2 client

* Remove serialization that is not required for most cases

* Small fix
2022-06-11 09:08:51 +08:00
Akhil Nair
e823290c8f
[PYTHON] GetItem not working for Client generated allOf model and broken since 5.2.0 (#12239)
* I feel the issue is due to the creation of self._var_name_to_model_instances while doing the deserialization of the data.

Earlier the Python SDK code was using get_var_name_to_model_instances function which was adding var name to model instances that contain it. So <class 'openapi_client.model.stream_options_all_of'> will not part of mapping in self._var_name_to_model_instances for variable name stream_options.

Now with the latest Python SDK code following is the way through which var_name_to_model_instances is created:

    for prop_name in model_args:
        if prop_name not in discarded_args:
            var_name_to_model_instances[prop_name] = [self] + composed_instances
Now as we can see that the var_name_to_model_instances is populated with self and composed_instance which will also contain stream_options_all_of as a composed instance and there will be no check that if stream_options is present in composed_instances or not.

As there is no attribute_mapping found for stream_options in stream_options_all_of, the type for stream_options will be treated as dict for mapping stream_options_all_of as mentioned by @Chekov2k.

So what I suggest is the following code:

    for prop_name in model_args:
        if prop_name not in discarded_args:
           var_name_to_model_instances[prop_name] = [self] + list(
                filter(
                    lambda x: prop_name in x.openapi_types, composed_instances))
This way we can check if the property name is present in that composed instance or not. If it's okay for @spacether I can raise a PR for this.

* [get_item_all_of_bug]
Added samples, test cases to validate all_of schema.

* [getiem_all_of_bug]

Updated docs and samples.

* [getiem_all_of_bug]

Updated test cases, docs and samples.
2022-05-27 21:09:48 -07:00
William Cheng
5bd94b8fa0 prepare 6.1.x 2022-05-26 12:58:25 +08:00
William Cheng
36a9cf394d
update samples (#12466) 2022-05-26 12:13:59 +08:00
William Cheng
69f79fb789
Prepare 6.0.0 release (#12463)
* prepare 6.0.0 release

* update samples

* update meta codegen
2022-05-26 10:28:01 +08:00
William Cheng
b6a8037f62 update samples 2022-04-27 20:45:24 +08:00
William Cheng
e0d8d0f5d6
better code format for python cilent (#12251) 2022-04-27 16:00:44 +08:00
William Cheng
23ee8fdf7a
better code format for python client (#12231) 2022-04-25 23:25:42 +08:00
Dmitry Vasilev
6f1fa4592b
[BUG][python] Fix PEP8 E111 issue in rest.mustache (#12229)
* Fix PEP8 E111 issue

* Update samples
2022-04-25 17:00:27 +08:00
William Cheng
2abdd3acb7 set follow_location default to true 2022-04-16 17:46:55 +08:00
Connor Moore
7b1795a159
[REQ][Ruby] Ruby Allow Follow Redirect (#12047)
* Add `follow_location` option

Implementation of https://github.com/OpenAPITools/openapi-generator/issues/10028

* regenerated clients
2022-04-16 16:51:01 +08:00
Dennis Kliban
e783e9b780
Adds 'params_encoder' config option for Ruby clients using Faraday (#9839)
The partial templates were renamed because they no longer hold tls
settings exclusively.

fixes: #9838
2022-04-09 10:14:38 +08:00
William Cheng
a596d5aec0
update jackson databind to newer version (#12053) 2022-04-05 18:09:23 +08:00
Katsuyuki Omuro
efc1a66ebc
[Ruby] Fix incorrectly capitalized identifier in apis template (#12045) 2022-04-05 17:50:44 +08:00
William Cheng
2d4a01aa70 Revert "Prepare 6.0.0 beta release (#12039)"
This reverts commit 914b539eea7097ad2b4323d20c8f95144782cb68.
2022-04-04 12:17:12 +08:00
William Cheng
914b539eea
Prepare 6.0.0 beta release (#12039)
* update to 6.0.0-beta

* update samples
2022-04-04 10:29:49 +08:00
William Cheng
b54257d7ab
Support binary return format only in Ruby faraday client (#11974)
* support binary return format on  in ruby faraday client

* add option to return binary data

* update condition
2022-04-03 16:55:15 +08:00
Cameron Koegel
0c825ad301
update exceptions output (#11989) 2022-03-30 08:54:20 -07:00
William Cheng
7370c4d3f8 update java samples 2022-03-25 00:42:07 +08:00
Cameron Koegel
2c4daeae0b
[Ruby] Added Support for Binary Media Data Return (#11254)
* update template files

* fixed binary data return

* update samples

* apply change to file download logic and regenerate samples
2022-03-23 21:19:31 +08:00
LeComptoirDesPharmacies
87a5182c24
[Python] - Migrate enable per request authentification in new python codegen (#11279)
* LDS-2166 : add request auth to api client and api call

Can now overwrite request auth by request

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : Add samples

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : fix test

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : Fixing test in python_disallowAdditionalPropertiesIfNotPresent

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : add removed line break

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : add name for _request_auth params

Add None when _content_type is not set

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : add tabulation

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : fix missing values

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : generate sample

Add _request_auth in sample

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* Request auth can now use multiple auth

Request auth is now a list of dict

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* Add request_auths in test

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

Co-authored-by: Géry THRASIBULE <g.thrasibule@lecomptoirdespharmacies.fr>
2022-03-20 13:12:59 -07:00
tuanchien
1fe2eb6b7a
Fix undefined object in Python model __copy__ template (#11792)
* Fix new_cls in methods_shared copy template

* Add generated files
2022-03-18 21:34:06 -07:00
William Cheng
7cbdf4c163
[java][jersey2] update junit from 4.x to 5.x (major upgrade) (#11898)
* update java jersey2 junit to 5.x

* update jersey2-java8-special-characters

* update jersey2-java8-localdatetime

* update samples/openapi3/client/petstore/java/jersey2-java8

* better code format
2022-03-18 09:50:26 +08:00
William Cheng
82b7dee480
update java jersey2 dependencies to newer versions (#11878) 2022-03-15 18:38:34 +08:00
Cameron Koegel
fd1ede6a73
[Python] Added Ability to Initialize Models by Passing in Dictionaries (#11125)
* [Python] Added Ability to Initialize Models by Passing in Dictionaries

* formatting change

* generate new python samples
2022-03-09 09:41:15 -08:00
wirthual
7ed7930bab
fixed wrong intendation error (#11834) 2022-03-09 11:21:54 +08:00
Cameron Koegel
94b1440074
[Python] Add Support for Content-Disposition Header without filename (#11055)
* [Python] Add Support for CD header w/o filename

* updated documentation per PR instructions

* fixed formatting and updated samples and docs

* revert docs changes

* regenerate python samples

* updated sample python test
2022-03-09 01:10:49 +08:00
William Cheng
683984896e
update maven-javadoc-plugin to newer version (#11737) 2022-02-27 16:57:16 +08:00
Chris White
d153134dec
Fixed RFC3999DateFormat clone NPE (#11705) 2022-02-24 12:29:23 +08:00
Kuan-Yin Chen
ab63786610
[Python] remove default content-type in the request (#10782)
* remove default content-type in the request

* add remove default content-type test

* fix duplicate content type

* update sample

* add missing params

* update sample

* only assign content type if exist

* update sample

* update sample

* format code

* update sample
2022-02-24 12:08:49 +08:00
William Cheng
d530e1baec
minor enhancement to code format in go client (#11657) 2022-02-19 13:11:28 +08:00
moznion
d6a97b0c39
Remove dummy variable declaration for context.Context from generated go code (#11641)
Originally, this dummy declaration was needed because there was the
possibility of the generated code doesn't use `context.Context` and then
if it imported that package, go compiler complains that and makes an error.
ref: 3ed1aa8e79/modules/swagger-codegen/src/main/resources/go/api.mustache (L30)

However, now this dummy placement is no longer needed because the
generated code always uses `context.Context`.

Signed-off-by: moznion <moznion@mail.moznion.net>
2022-02-18 11:34:05 +08:00
William Cheng
b979eccf68
Add Github action file to test Java clients (#11633)
* add github action file to test java clients

* update tests
2022-02-17 15:49:34 +08:00
William Cheng
8455c1cd23
Remove the option to support JDK7 from Java generator and templates (#11547)
* remove java8 from java client generator and templates

* update tests

* remove threetenbp

* update spring templates to remove java8

* remove java8 from jaxrs template

* fix jaxrs spec

* fix feign

* remove CustomInstantDeserializer.java

* fix jersey1

* fix undertow

* various update

* fix jaxrs jersey1

* fix java inflector

* fix jaxrs cxf

* add new files

* update doc
2022-02-10 10:35:29 +08:00
William Cheng
b6c445cdc3
update swagger core, jackson to newer version (#11545) 2022-02-08 13:31:20 +08:00
William Cheng
e177a4b757 update samples 2022-02-05 16:37:56 +08:00
William Cheng
c8b84c4d03 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-30 18:01:35 +08:00
jiangyuan
8b3cad0692
[Python] fix model to dict (#11234)
* fix model to dict

* add unit test

* add unit test

* update sample files
2022-01-25 09:50:59 -08:00
William Cheng
b7c8de9425 update samples 2022-01-21 17:45:53 +08:00
hackerman
93488f4195
Resolve several issues in generated Go code (#8491)
* [go] use regular stdlib import names

* [go] support primitive oneOf types

See #8489

* [go] improve pbv/pbr handling

Improves the way pass-by-value and pass-by-reference variables are used.

Closes #8489

* [go] improve generated documentation

* [go] adopt pointer changes in interface

* [go] regenerate sample

* [go] resolve pointer issues

* [go] regenerate clients and avoid pointers on primitive return values

* [go] improve Exec() return value handling

* [go] regernate files

* [go] use go modules

* [go] properly handle polymorph decode

If polymorphism without discriminator was used, the previous code was unable to properly decode the vaules. By using a strict decoder, which rejects unknown fields, type guessing now works.

* [go] make GetActualInstance not panic on nil

* [go] return GenericOpenAPIError as pointer

* [go] clarify helper function godoc

* [go] address test regression error type

* [go] regenerate go samples

* [go] resolve go mod issues and test regressions

* [go] resolve merge conflicts and regenerate

* [go] resolve merge conflicts

* [go] Replace spaces with tabs

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>

* [go] Replace spaces with tabs

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>
2022-01-21 16:54:09 +08:00
Justin Black
de036e211e
Improves generator docs: stability + language version added (#11270)
* Adds generatorLanguageVersion and uses it in python generators

* Regenerates docs

* Adds stability to generator docs

* Triple braces generatorLanguageVersion

* Regenerates samples

* Fixes the python-experimental setup.py file so it works with generatorLanguageVersion

* Updates generators readme
2022-01-10 18:16:53 -08:00
Matthew
e7ca67071e
[python] Fix 10773 - Use base_name for file uploads in form data (#11182)
* Use base_name for file uploads in form data

* Added missed sample changes
2022-01-09 08:19:57 -08:00
jiangyuan
e1902257b3
[Python] add '_spec_property_naming' param (#11226)
* add '_spec_property_naming' param

* add '_spec_property_naming' comment

Co-authored-by: jiangyuan04 <jiangyuan04@baidu.com>
2022-01-05 14:26:10 -08:00
S2021Git
361b593da2
Not creating "Accept:null" header for Java-Jersey2 generator (#11084)
* updated ApiClient.mustache for jersey2

* updated samples

* corrected indentation

* updated samples
2022-01-04 16:41:24 +08:00
William Cheng
d17a472b89 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-03 18:03:00 +08:00
William Cheng
238639a500 update java sampes 2022-01-02 17:28:17 +08:00