110 Commits

Author SHA1 Message Date
Justin Black
ac3bb6830a
[python] Fixes endpoint overload type hint + required property not in properties (#13790)
* Adds endpoint overload type hint fix to template

* Samples regenerated

* Adds fix for required property not in properties

* Regenerates samples
2022-10-21 18:50:30 -07:00
David Chaiken
c22715ad1f
fix for issue #13722: send body for application/x-www-form-urlencoded data (#13723)
* fix for issue #13722: send body for application/x-www-form-urlencoded data

* fix python test_application_x_www_form_urlencoded_serialization

* x-www-form-urlencoded data needs to be percent encoded

* add verification endpoint test for x-www-form-urlencoded data

Co-authored-by: David Chaiken <dchaiken@pinterest.com>
2022-10-18 18:51:35 -07:00
Justin Black
ef8e55ca21
[python] client bug fixes + type hint improvements (#13665)
* Adds python client, template, and spec updates for query param content type json

* Samples regenerated

* Finishes adding test cases for query param json content type

* Uses newest templates

* Templates replaced, spec replaces, sample replaced

* Samples updated
2022-10-10 20:13:31 -07:00
Justin Black
57f5cc4000
[python] fixes bugs (#13581)
* Adds bug fixes

* Samples and docs regenerated

* Samples regenerated
2022-10-03 11:15:16 -07:00
William Cheng
ac7ebf67dd
Prepare 6.2.1 (#13517)
* update to 6.2.1-SNAPSHOT

* update samples

* update doc
2022-09-25 00:10:30 +08:00
William Cheng
24f476a381
prepare 6.2.0 release (#13514)
* set release version to 6.2.0

* update samples

* comment out rust server test in travis
2022-09-24 21:44:42 +08:00
Justin Black
7e73645303
Switches python-experimental in as the primary python client (#13501)
* Changes python to python-prior

* python -> python-prior, python-experimental->python

* Renames sample spec directories

* Samples regnerated

* Regenerates docs

* Fixes test

* Samples regenerated

* Updates renerators list

* Fixes made to python paths in pom.xml

* Fixes node4 sh file paths
2022-09-24 16:19:38 +08:00
William Cheng
928070c57a
Prepare 6.1.1 SNAPSHOT version (#13399)
* prepare v6.1.1

* update samples

* update doc
2022-09-11 19:08:23 +08:00
William Cheng
43dbb5ff9c
6.1.0 release (#13398) 2022-09-11 17:16:07 +08:00
jtvmatos
4f94d449dc
fix: Deepcopy fail for allOf schemas (#13130) 2022-08-23 23:07:37 -07:00
William Cheng
6cae0fbb78 Merge remote-tracking branch 'origin/6.1.x' 2022-07-04 01:22:51 +08:00
William Cheng
9e412edb64
Prepare 6.0.1 release (#12762)
* update to v6.0.1

* update doc

* update samples
2022-07-03 23:36:46 +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
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
Cameron Koegel
0c825ad301
update exceptions output (#11989) 2022-03-30 08:54:20 -07: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
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
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
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
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
William Cheng
12e03b1937 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-02 15:41:37 +08:00
Justin Black
ac55ac9d55
Samples and docs regenerated (#11194) 2021-12-28 11:39:13 -08:00
William Cheng
6269a9810c
Prepare 5.3.1 release (#11161)
* prepare v5.3.1 release

* update samples
2021-12-21 18:20:13 +08:00
Tomasz Prus
b755ae288a
[Python] Add option to select/detect content-type. (#10978)
* [Python] Add option to select/detect content-type.

* Regenerate samples after rebase.

* Update samples.

* test: fix assertion
2021-12-08 13:15:26 -08:00
WILLIAM CHENG
4f2b5ee36d Merge remote-tracking branch 'origin/5.4.x' into 6.0.x 2021-11-01 00:54:44 +08:00
WILLIAM CHENG
ab603a7322 Merge remote-tracking branch 'origin/master' into 5.4.x 2021-11-01 00:49:06 +08:00
itaru2622
97e079fde0
add no_proxy support to python client (#10648)
* add no_proxy support to python client

* add unittest for no_proxy supporting, python client

* update samples for no_proxy supporting, python client

* fix input parameter in samples/openapi3/.../tests_manual/test_extra_pool_config_options.py

* re-implement no_proxy support to python client according to PR conversation #10648

* re-update samples for no_proxy supporting, python client
2021-10-26 10:12:42 +02:00
WILLIAM CHENG
42f4e863b7 prepare 5.4.0-SNAPSHOT 2021-10-25 12:13:33 +08:00
William Cheng
378465702c
Prepare v5.3.1 in the master (#10681)
* prepare v5.3.1

* update doc

* update readme
2021-10-25 01:16:07 +08:00
William Cheng
0bfa28f844 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-10-06 12:00:02 +08:00
romanblack1
7384a1e513
Define content type only if the body is not empty (#9766)
* define content type iff the body is not empty

* update samples
2021-09-25 15:05:38 +08:00
William Cheng
acd747ca6d Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-22 12:13:44 +08:00
bflaton
9479d35081
Python client docstring (#10339)
* Updated template so that generated code now renders docstrings and function parameters nicely in IDE.

Endpoints are still accessible in generated code, mainly to satisfy some test cases.

* fixed manual tests
2021-09-14 09:38:48 -07:00
Mike Marchetti
9464999d9c
fix: handle deepcopy of openapi objects (#9735) (#9735)
- Add __deepcopy__ and __copy__ to OpenApiModel
- pass discriminator inside deepcopy if exists
- add test cases for deepcopy of models
2021-09-09 09:16:59 -07:00