95 Commits

Author SHA1 Message Date
Joscha Feth
0b32c5025e
chore: update github workflow checkput plugin references (#19676) 2024-09-29 21:23:02 +08:00
Mike Phillips
34aeb16c5e
Improve urllib3 semver flexibility (#19458) 2024-09-18 16:54:43 +08:00
Jonathan Ballet
40967a3d38
python: test with more modern versions (#19452)
Python 3.12 has been released in October 2023, it should be tested in
the CI.

Python 3.7 is not maintained anymore, removing it from the minimum
required version in `pyproject.toml` files.
2024-09-18 16:53:51 +08:00
ふぁ
69cce249f6
[python] fix content_type deserialize (#19317)
* [Python] fix: #19285

* [python] update sample

* [python] add test

* [python] remove test
2024-08-24 23:40:15 +08:00
Rory Schadler
cc98333d87
feat(python): handle multiple file parameters (#19329)
* test: fix broken python test

* fix: handle multiple file parameters

Previously an array of files was not handled correctly, despite the type
annotation implying it was.

* feat: handle filename,filedata tuples in file param

This allows for users to pass filenames with their data in file params,
which is useful for multipart formdata requests. Without this, the list
of files added in the previous commit would have the same filename for
all files (the parameter name).
2024-08-21 15:09:10 +08:00
William Cheng
91da2fd240
Prepare 7.9.0 snapshot (#19386)
* Revert "v7.8.0 release (#19385)"

This reverts commit 6bdc452f92d49dcac7ac21dfe8751c8cc4267b98.

* update samples for v7.9.0-snapshot
2024-08-19 16:14:51 +08:00
VelorumS
f082a35d2e
[Python] fix object arrays giving mypy error "Incompatible types in assignment" in to_dict() (#19223)
* [python] mypy fix for multiple arrays of objects

* [python] mypy test for multiple arrays of objects
2024-07-29 16:34:27 +08:00
m-standfuss
6ad5864d28
Adding decimal support for python client generation (#19203)
* Adding decimal to template for Python generator

* Rerunning the build steps

* Add tests for decimal serialization and deserialization.

* Move test to python not legacy pydantic sample

* readd old imports

---------

Co-authored-by: Adam <abolfik@pollyex.com>
2024-07-23 16:16:23 +08:00
Jeremy Audet
722be84cac
Update call to assertDictContainsSubset() (#19122)
`TestCase.assertDictContainsSubset()` was deprecated in Python 3.2,
which went EOL in 2016. Rewrite the assertion to target Python 3.8+.

See: https://docs.python.org/3.2/library/unittest.html#unittest.TestCase.assertDictContainsSubset

See: https://devguide.python.org/versions/
2024-07-13 18:28:26 +08:00
Jeremy Audet
a4292c5db5
Update poetry lockfile (#19123)
Updated with `poetry lock`. This makes it possible to execute `poetry
run -- python -m unittest discover` and the like.
2024-07-10 17:22:01 +08:00
William Cheng
20cfce0b4a
Prepare v7.8.0 (#19048)
* Revert "v7.7.0 release"

This reverts commit f3dd32385e02065ad298801ca11b8871bcb3a92a.

* prepare v7.8.0

* update readme

* update doc

* update samples
2024-07-02 16:45:53 +08:00
Cameron Koegel
53f1094765
[Python] Allow Overriding Accept Header (#19025)
* [Python] Allow Overriding Accept Header

* generate samples

* add tests
2024-06-28 19:27:10 +08:00
Cameron Koegel
0d05ee35f0
[Python] Add Flag to Allow Ignoring Operation Servers (#18981)
* [Python] Add Flag to Allow Ignoring Operation Servers

* generate samples

* add tests
2024-06-26 15:08:13 +08:00
Vito De Tullio
e5ae07c2b4
avoid setting debug property if not needed (#18872)
* avoid setting debug property if not needed

* update samples

* fix compatibility with python 3.7

* always set Configuration.__debug

* update samples

* check `Configuration` behavior when debug parameter is / is not set

* address PR requests
2024-06-20 18:23:34 +08:00
Oleg Gromiak
c3a2fe0592
[Python] Add retries option to Configuration constructor (#18919)
* Python: add retries option to Configuration constructor

* Update autogenerated sample clients
2024-06-19 17:06:33 +08:00
ふぁ
6ae8a8f4c7
[python] fix deserialize on basic str fails (#18800)
* [python] fix #18774 Deserialize on basic str fails

* [python] update sample

* [python] update test

* [python] remove type

* [python] fix test

* [python] add top level type test

* Update deserialize content_type parameter and quote

* [python] restore echo_api test

* [python] add allow empty json in Response
2024-06-06 16:15:50 +08:00
Lars van Leeuwen
8783ad8a18
[Python] List enum members in docs (#18804)
* List enum values in docs

* Remove newline

* Remove another newline

* Generate samples
2024-06-01 17:00:11 +08:00
William Cheng
741bf0c035
Prepare 7.7.0-SNAPSHOT (#18709)
* Revert "7.6.0 release"

This reverts commit d76f9d32d11a03be2b40ebff728ef0ff86332fcb.

* prepare 7.7.0 snapshot in master

* update samples
2024-05-20 17:27:17 +08:00
William Cheng
807250a430
Prepare 7.6.0 (#18412)
* Revert "v7.5.0 release"

This reverts commit 1eafe2aebf33b13bee0ead66d62a6436e7db059d.

* update master to v7.6.0 snapshot

* update readme

* update samples
2024-04-17 19:05:37 +08:00
Kathryn DiPippo
0b3e6edb98
[python] Update docs/ Markdown files for Classes to fix _form_ typo and correct casing for class name when calling from_dict() (#18359)
* Update Python mustache templates to fix _form_ typo and correct casing for class name when calling from_dict()

* Results of 'build the project' checklist step
2024-04-12 12:29:20 +08:00
BaptisteSaves
6bcc28d06e
Python: Correctly serialize enum with its value (#18327) (#18328) 2024-04-10 21:12:37 +08:00
ふぁ
5e9546451c
[Python] Add echo_api test object serialization for multipart requests (#18176)
* [python] echo add test object serialization for multipart requests

* [echo api] update samples

* [echo api] update samples
2024-03-23 21:40:10 +08:00
ふぁ
e39b99051c
[python] add test Missing the important statement for Datetime in Python binding generation (#18175)
* [python] add test on datetime response import

* [python] update sample

* [python] update sample
2024-03-21 15:40:33 +08:00
William Cheng
7aeb952565 update samples 2024-03-21 11:42:51 +08:00
Zishun (Zack) WEI
43ca5fcac9
Fix issue 18088: Missing the important statement for Datetime in Python binding generation (#18173)
* fix issue 18088

* update samples
2024-03-21 11:39:19 +08:00
Artur Zdolinski
c15e267e22
Fix problem in sanitize_for_serialization for Python (pydantic type SecretStr ) BUG#16086 (2nd pull) (#18023)
* fix-for-bug-16086

* add to_dict alternative

* fix assertEqual

* remove extra blank line + test_model Argument SecretStr set

* update samples / remove extra blank line

* restore sanitize test for serialization with different data types

* remove empty line in api_client.mustache

* remove 2nd empty line in api_client.mustache
2024-03-20 19:14:43 +08:00
Poolmann
b7ea139f77
[Python] Fix object serialization for multipart requests (#18140)
* Fix multipart object serialization

* Update samples
2024-03-19 18:31:08 +08:00
ふぁ
1586c698c9
[python] Fix multipart requests with type file fails with binary data (#18079)
* [python] fix Multipart requests with type file fails with binary data #18073

* [python] update sample
2024-03-12 19:24:55 +08:00
ふぁ
678db1e4af
[python] json like str response (#18069)
* [python] json like str response

* [python] fix response deserialize

* [python] update sample

* [python] fix echo_api test quotes
2024-03-11 20:27:26 +08:00
William Cheng
4ff7e0ec3f
Prepare 7.5.0 snapshot (#18068)
* Revert "7.4.0 release"

This reverts commit eda049348425171df772a7b9087cc97db718cfda.

* prepare 7.5.0 snapshot version

* update samples

* update doc
2024-03-11 11:10:52 +08:00
Ross Bender
cf2435f335
Add support for controlling output of OpenAPI Generator version in generated files (#17952)
* add initial openapi config and java generated files

* add java implementation for adding generator version

* regenerate sample client files

* remove tabs

* only show generated version if build info exists

* set build info for batch generation

* update generator doc for new global flag

* use existing property for generator version

* update templates to include generator version

* update templates for better generator version syntax

* revert undesired changes

* regenerate samples for openapi client

* update templates to correct formatting/newlines

* correct description text and add to usage doc

* add generator cli option for all codegen types

* use more concise version info; update existing codegens to support new prop

* correct wrong prop reference

* add initial test coverage for new prop

* update last (scala) templates with new prop

* update samples after upstream merge

* use consistent version output

* use better sample project id/name

* revert using option for generator version in templates
2024-03-09 15:52:08 +08:00
Kathryn DiPippo
c10c9146b9
[python] Update Markdown files for Models with fixed Python print() syntax (#17993)
* Update Markdown file with fixed Python example

* ./bin/generate-samples.sh ./bin/configs/*.yaml
2024-02-29 10:54:54 +08:00
ふぁ
c99a5cfeb6
[python] update model_config from dict to ConfigDict (#17900)
* [python] rewrite dict as ConfigDict

* [python] update sample

* [python] undo unwanted changes

* [python] update sample
2024-02-20 17:53:13 +08:00
Simon Podlipsky
1e9bccca16
feat: generate EOL in VERSION file (#17829)
The EOL is missing so let's add it in order to comply with POSIX standard:

Line
> A sequence of zero or more non- <newline> characters plus a terminating <newline> character.
2024-02-12 15:40:55 +08:00
William Cheng
783e68c7ac
7.4.0 snapshot (#17818)
* Revert "7.3.0-release (#17817)"

This reverts commit d617b46c86b9075c5e0d63fe3798e2982f5259ac.

* update samples, docs, readme
2024-02-08 16:07:22 +08:00
Jonathan
f323a3e788
[Python] deserialize enum json response (fix #17789) (#17791)
* deserialize enum json response (python)

* adapt python samples: adding enum deserialization

* add echo test for enum json response deserialization (python)

* update samples
2024-02-08 10:52:43 +08:00
William Cheng
c9204c4330
Update model_generic.mustache, tuple notation breaks when there is only one element in the tuple (#17749)
* Update model_generic.mustache, tuple notation breaks when there is only one element in the tuple

In this excerpt of the mustache template, the matching behaviour is bugged when there is only one element in the tuple notation. A single string with the tuple notation, e.g., `("string")`, will result in a string, and when values are compared with the string, it will do a `contains` match instead of an exact match, which is unintended behaviour.

* Update with samples, step 3

* Add test spec and regenerate samples

* Update samples

* Update spec and samples

* update samples

---------

Co-authored-by: Edmund Loo <edmundloo@users.noreply.github.com>
Co-authored-by: Edmund Loo <github.yn0u9@simplelogin.com>
2024-01-31 11:29:15 +08:00
William Cheng
d0187ab359
Add tests for query parameters (array of integer/string) (#17686)
* add tests for query parameters in python client

* update other samples

* update samples
2024-01-24 10:20:18 +08:00
masudanaokinino
0357a1b1dd
fix "parameters_to_url_query" throws an error (#17638) 2024-01-23 16:31:47 +08:00
Roi Shacham
406bc28a3d
Fix parameters_to_url_query doesn't properly convert lists to string (#17592)
* fix parameters_to_url_query to properly handle lists

* fix query parameters bug in sample clients

* add tests for url query list value

* build project

* tests fix

* Revert "build project"

This reverts commit a486a6de7528302db92c36e64dcd20d41ada51b9.
2024-01-13 11:36:01 +08:00
Jonathan Ballet
df7976c1a3
python: enable more mypy checks 1/n (#17556)
* python: more mypy checks

* mypy: check_untyped_defs

* mypy: disallow_subclassing_any

* mypy: disallow_untyped_decorators

* mypy: disallow_any_generics
2024-01-09 16:45:05 +08:00
Jonathan Ballet
22a0fc1727
python: adjust basic typing information (#17511)
* python: adjust basic typing information

This is an initial pass to fix and adjust the typing information for the
generated client. This is enough to have mypy runnning without complains
on all the (modern) generated clients (Pydantic v1 code is not checked
for instance)

mypy is also now run directly in the CI, so further changes will also be
checked and thus, will need to be compliant with good typing
information.

Note that this doesn't *fully* type all the code: mypy is not run in
"strict" mode and there are still many functions/methods/attributes
which are still not fully typed, but it's a first good step in that
direction.

* ApiResponse's raw_data can't be None

* Fix indentation

* Revert test changes

* run mypy on tests/ directory

* don't forcefully convert the client response headers to dict

* override petstore ApiResponse model

* adjust type of 'any/one_of_schemas' fields
2024-01-06 15:40:42 +08:00
Jonathan Ballet
063865973d
python: simplify module imports (#17507)
In #16624, I introduced a new mechanism to record imports to other
modules, instead of having specialized datetime/typing/pydantic objects
to manage imports for these modules.

This change reuses the mechanism from #16624 and replace the specialized
import managers by the generic one. Unused imports from various
.mustache templates are also cleaned up.
2024-01-03 21:22:53 +08:00
Milad
8c014372aa
[Java RESTEasy client] updating test to use the Java RESTEasy echo api client (#17367) (#17470)
* updating test to use the Java RESTEasy echo api client (#17367)

* regenerated samples

* set source and target to 1.8 to fix workflow failure, adapted parser
2023-12-26 09:32:51 +08:00
William Cheng
5eab3cef19
Prepare 7.3.0-SNAPSHOT (#17456)
* Revert "v7.2.0 release (#17455)"

This reverts commit fe638d009363c142c246ff089032f243e0b4ee01.

* set version to 7.3.0-SNAPSHOT

* update doc
2023-12-22 16:55:58 +08:00
William Cheng
a62132ecd9
fix exception in request body with enum ref (#17438) 2023-12-21 15:22:28 +08:00
Robert Schweizer
6a43a371f1
fix: Configure python urllib3 connection pool size (#17323)
This was removed in #16802, but using a higher value than 1,
or at least making this configurable makes complete sense.

Without this, we get a lot of these log messages:

[ WARNING] Connection pool is full, discarding connection:
2023-12-06 15:49:10 +08:00
William Cheng
8e36014ae6 update samples 2023-11-19 17:36:25 +08:00
William Cheng
d9920a5b81 update samples 2023-11-16 00:56:05 +08:00
Tomohiko Ozawa
37451fa569
[Java][resttemplate] Add test for bearer auth (#17081)
* add bearer auth API to echo-api

* run generate-samples.sh

* add resttemplate echo-api sample

* add bearer auth test

* remove @Ignore
2023-11-16 00:38:49 +08:00