1542 Commits

Author SHA1 Message Date
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
William Cheng
d6749f8a0e update samples 2024-04-09 20:49:23 +08:00
Joakim Holm
3cb3fc2898
Add Generated annotations to more classes (#17736) 2024-04-09 16:39:53 +08:00
Zishun (Zack) Wei
453facc81c
Fix 18271: Circular imports on AllOf generation with REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=True (#18272)
* fix issue 18271

* the same update for python-pydantic-v1

* add test

* update samples

* update samples

* put properties under allOf for python client tests

* update samples

* add a test in test model
2024-04-08 19:01:01 +08:00
William Cheng
494d74ab82
remove duplicated (#18320) 2024-04-07 22:25:03 +08:00
Viswajith Venugopal
650e119f22
Update go-server template to include the conventional generated code line (#18304)
* Update go-server template to include the conventional generated code line

Follow the convention from https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source.

The generated go client code already follows this: f357be480e/modules/openapi-generator/src/main/resources/go/partial_header.mustache (L18)

* gen files

* Move to top
2024-04-07 21:23:24 +08:00
William Cheng
2a39b29684
[python] Add field as a reserved word (#18279)
* add field as a reserved word

* remove tabs

* update
2024-04-03 16:43:51 +08:00
William Cheng
88204b247a
[Java] Sync jersey2 jersey3 template (#18281)
* sync jersey2 and 3 templates

* add deprecated

* update samples
2024-04-03 16:32:39 +08:00
B4ckslash
807aa5d3ae
[Java][jersey2] Fix generated client code for oneOf models if datatype includes arrays (#18042)
* Add java-jersey2 sample with mixed oneOf

* [java][jersey2]Fix client generation if oneOf contains an array type

Changes:
* Change jersey2/oneof_model template to use composed schema data
* Change adding of imports in AbstractJavaCodegen to use composed schema data
* Add escapedDataType property to CodegenProperty so that the data type
  may be part of identifiers (e.g. in getters)
* Update samples

* Add sample for multiple array in oneOf

* Fix generation of constructors with same erasures

* Update samples again

* Version bump

* Add new sample folders to CI

* Make primitive handling more explicit

* Replace escapedDataType property with Mustache lambda

* Update samples with new primitive handling and sanitization lambda
2024-03-30 21:08:41 +08:00
Dennis Melzer
309918d03e
Fix compile error in client properties configuration (#18232)
* Fix config

* Add tests

* Remove unused import

* Sort imports

* Add new workflow
2024-03-26 22:02:19 +08:00
Nick Cooper
8acf9b779d
Specify named param for field defaults in Python Pydantic V1 generator (#18187)
* Use named parameter

* Regenerate samples
2024-03-24 11:36:15 +08:00
ふぁ
9acd620bbb
[Python] Add test object serialization for multipart requests (#18156)
* [Python] add test object serialization for multipart requests #18140

* [python] update samples

* [python] update samples
2024-03-24 09:37:44 +08:00
William Cheng
e17777044e
Use systemPropertyVariables in pom.xml (#18213)
* use system property variables in pom.xml

* update
2024-03-23 21:45:29 +08:00
Flemming Nørnberg Larsen
a4508f6817
#18058 Fix the Java generator to generate valid @RequestMappings where the produce field takes list of string parameters instead of a single comma-separated string (#18092)
* #18058 Fix AbstractJavaCodegen.getAccepts() so it returns a String array instead of a comma-separated string, and fixed api.mustache so the @RequestMapping annotation generated produces for x-accepts as a parameter list instead of a (single) string.

* #18058 Updated test case to accept a string array instead of a comma-separated list.

* #18058 Reverted changes on imported compared to the main branch.

* #18058 getAccepts() is now hybrid, and can return both a single String or a String[].

* #18058 Rolled back the hybrid getAccepts(), so it only returns a String array.

* #18058 Updated mustache files to cope with vendorExtensions.x-accepts being a string array instead of a comma-separated string.

* #18058 Generated new sample files with by running `./bin/generate-samples.sh ./bin/configs/*.yaml`

* #18058 Optimization of getAccepts()

* #18058 Regenerated scripts that got broken after resolving conflicts on GitHub

* #18058 Fixed introduced issue with api.mustache causing a redundant accept with @HttpExchange with the PetApi.java, StoreApi.java, and UserApi.java.
2024-03-21 17:53:18 +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
William Cheng
09af44eca3
[java] update jakarta.validation-api to 3.0.2 (#18124)
* fix: jersey3 library

fix issue that library failed in case pattern matching was used in
the api.

* add tests, update version

* update

* fix tag

* fix, update samples

* update build

* more update

* update workflow

* test useJakarta

---------

Co-authored-by: holomekc <30546982+holomekc@users.noreply.github.com>
2024-03-20 12:55:19 +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
ふぁ
3137b3da77
[python-pydantic-v1] Fix unnamed dicts with additional properties (#18112)
* [python-pydantic-v1] pick #16779

* [python] update sample
2024-03-16 15:26:06 +08:00
Petar Karadzhov
4f4237393f
[dart] fix: Bearer and Basic auth interceptors case-insensitive scheme comparison (17073) (#17074)
* [dart] fix: Bearer and Basic auth interceptors case-insensitive scheme comparison

* Update samples
2024-03-16 10:49:43 +08:00
Dennis Melzer
96bf7ac915
Fix default empty collections when collection is optional (#18080)
* Fix optional empty collection as default

* Fix test

* Fix test
2024-03-14 20:28:27 +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
BaptisteSaves
82fcf28a2b
Remove pydantic warnings when using model_dump by fixing one_of_schemas type (#17941) 2024-03-11 20:26:46 +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
William Cheng
d801bfdb84
remove poetry.lock (#17994) 2024-02-29 10:54:08 +08:00
0xNF
275ed9296d
[dart2] [client] Bump test package version to >=1.21.6<1.22.0 to enable running tests on Dart3 projects. Also bumped minimum Dart version to 2.18 to accomodate this change. (#17563) (#17816) 2024-02-28 18:37:33 +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
ふぁ
ad08581f16
[python] Fix Circular imports on inherited discriminators. (#17886)
* [python] add inheritance discriminators test #16808

* [python] update samples

* [python] fix assert in test

* [python] fix inheritance discriminators circular import

* [python] update samples

* [python] undo type changes related to discriminator

* [python] remove extraneous processing

* [python-pydantic-v1] fix inheritance discriminators circular import

* [python] remove type ignore comment

* [python] update samples

* [python] fix avoid the empty line break

* [python] update samples
2024-02-20 12:17:32 +08:00
Dennis Melzer
7d76d0af61
Fix configuration handling with Feign (#17860)
* Fix configuration handling with Feign

* Fix test

* Fix compile error

* Fix compile error
2024-02-15 17:01:01 +08:00
William Cheng
4e39f12e29
[Go] fix isNil check (#17870)
* #17835 changed to return !IsNil

* update samples

---------

Co-authored-by: sagar khot <sagarkhot74@gmail.com>
2024-02-15 14:17:31 +08:00
Yannick Wiesner
41bb5cd331
[Dart] Make dependency on intl package less strict (#17862) 2024-02-15 12:54:20 +08:00
s-jepsen
487b856c11
Fix java-spring equals generation (#17837) 2024-02-15 12:27:33 +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
Ash Berlin-Taylor
5334014098
[go] Fix panic from marshalling Nil NullableTime (#17772) 2024-02-08 11:25:09 +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
Jonathan Klaassen
6bcf8cd332
Fix Python codegen in specific additionalProperties case. (#17659)
* Fix Python codegen is specific additionalProperties case.

* Add generated test files.

* Apply fix to AbstractPythonPydanticV1Codegen.java.
2024-02-05 22:17:14 +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
martin-mfg
9afea50cab
use map/array model class only if it is generated (#17612)
* fix

* tests

* generate samples

* refactor
2024-01-29 21:35:21 +08:00
Paul Horton
5055ebade9
fix: ensure models that have variables that contain a complexType of time.Time import the time module (#17452)
* fix: handle variables that have items that contain a complexType of `time.Time` properly

Signed-off-by: Paul Horton <phorton@sonatype.com>

* chore: trigger new CI runs

Signed-off-by: Paul Horton <phorton@sonatype.com>

* test: added test change an regenerated samples

Signed-off-by: Paul Horton <phorton@sonatype.com>

* resolved merge issues with upstream main

Signed-off-by: Paul Horton <phorton@sonatype.com>

* regenerated samples

Signed-off-by: Paul Horton <phorton@sonatype.com>

---------

Signed-off-by: Paul Horton <phorton@sonatype.com>
2024-01-28 11:36:05 +08:00
dabdirb
66a6af5ca4
add lombok model support on spring (#17622)
* add lombok model support on spring

* use regex to adapt annotation with parenthesis

* add ut case

* add samples

* add samples

* fix github workflow

* fix github workflow
2024-01-27 10:45:44 +08:00
Jesenko Mehmedbasic
a092bbd83b
[BUG] [Java] Remove deprecation and serial warnings in ApiException.java and JSON.java (#17716)
* Add serialVersionUID to Java apiException.mustache templates

* Use 'enable()' and 'disable()' methods to handle object mapper features in JSON.mustache for the "native" Java generator instead of the deprecated 'configure()'

* Update samples
2024-01-27 10:42:27 +08:00
masudanaokinino
0357a1b1dd
fix "parameters_to_url_query" throws an error (#17638) 2024-01-23 16:31:47 +08:00
Robert Schweizer
a0418c2855
[python][client] Clean up samples and CI (#17509)
* chore: Remove leftover Github action file

This was probably added by mistake. A similar file is active in
.github/workflows/samples-python-pydantic-v1-petstore.yaml.

* chore: Remove leftover VERSION from old python-experimental sample

* ci: Stop running Python integration tests in Circle CI

These Python clients are all tested with Github Actions already, which
is faster, more cleanly separated and only runs on modifications.

I'm not cleaning up the pydantic-v1 client, I expect it to be removed soon anyway.

* chore: Remove true from sample folder name

python-disallowAdditionalPropertiesIfNotPresent-true
-> python-disallowAdditionalPropertiesIfNotPresent
2024-01-16 10:34:04 +08:00