2258 Commits

Author SHA1 Message Date
Ween Jiann
b7f31ddda4
Regenerate (#17389) 2023-12-13 22:17:15 +08:00
Aliaksei
809b3331a9
[4947][java]: adds support for validation of primitives in arrays (#17165)
* [4947][java]: adds support for validation of primitives in arrays

* [4947][java]: prevents generation '@Valid' for Object

* [4947][java]: test against different codegens and stick to primitive

* [4947][java]: code review

* [4947][java]: enhance getBeanValidation

* [4947][java]: adds email

* [4947][java]: removes unnecessary override

* [4947][java]: adds postProcessResponseWithProperty

* [4947][java]: adds missing import {{javaxPackage}}.validation.Valid

* [4947][java]: adds missing useBeanValidation

* [4947][java]: fix use rootJavaEEPackage for helidon
2023-12-11 20:55:38 +08:00
Beppe Catanese
9eb5882f94
OpenAPI 3.1.0 Add webhooks support (#17174)
* Add support for webhooks

* Test webhook generation with Go Gin server

* Generate samples

* Removing \t

* Remove tabs
2023-12-11 11:21:23 +08:00
TAKAHiRO TOMiNAGA
004c7e8c8d
[Style][Go] standardize the format of mustache (tiny change) (#17363)
* fix: change indent style to tab in the mustache to generate Go code

* docs: standardize the language names for code blocks

* docs: change indent style to tab in the code blocks

* update: regenerate samples

* `./bin/generate-samples.sh ./bin/configs/*.yaml`
2023-12-10 10:13:49 +08:00
William Cheng
dd36fa09f8
update logbak core to newer version (#17360) 2023-12-09 21:59:50 +08:00
Dennis Melzer
e37decff7b
Add Java Optional for POJOs in JavaSpring templates (#17202)
* Add optional parameter for request body

* Adapt Test

* Add test

* Format code

* Remove extra method

* Add optional for pojos

* Add optional for pojos

* Add bean validation for Optional

* Add default values + test

* Rename test
2023-12-08 21:46:13 +08:00
Viktor Szépe
39d5b4ebf9
Replace stray TAB characters with spaces (#17311)
* Replace stray TAB characters with spaces

* update samples

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2023-12-05 18:01:25 +08:00
William Cheng
391df3b81c update samples 2023-12-05 15:36:33 +08:00
William Cheng
f033b11408
Update JAX-RS client samples (#17262)
* update jaxrs client samples

* move configs
2023-11-30 21:39:42 +08:00
William Cheng
4c4d0e485a
[java] Update logback to newer versions (#17259)
* update logback to newer versions

* update
2023-11-30 18:51:46 +08:00
William Cheng
46dd87525e
Add tests for max,min items in array (rust-server) (#17215)
* add tests for max,min items in array (rust server)

* fix both min, max items
2023-11-29 16:21:54 +08:00
Makoto Suzuki
baaf759440
[python-fastapi]Add an alias keyword parameter for Query parameter (#17111)
* add alias to endpoint_definition

* regenerate source code
2023-11-21 11:34:43 +08:00
Robert Schweizer
75ff110449
[python] Some cleanup of samples folder (#17127)
* Delete sample folders of discontinued clients

* Remove duplicate python-flask server sample

The python-flask sample actually lives in samples/server/petstore/python-flask.

* Move hand-written test to "tests" folder

Now, "test" only contains generated stubs and all hand-written tests are in "tests".

* Delete left-over files in Python samples

These are not created by the generators (anymore) and not hand-written
for testing.

* Regenerate test file to fix import error
2023-11-19 14:43:34 +08:00
Markus Lenger
1ce95ff41e
Map type date to correct rust type NaiveDate (#17095)
* Fix clippy errors (rustc 1.73.0)

* Add feature docker-in-docker

* Fix mapping of "date"

See issue #9769

The type
  type: string
  format: date
was mapped to DateTime<Utc> which violates the OpenAPI spec

see https://swagger.io/docs/specification/data-models/data-types/
2023-11-18 10:33:45 +08:00
Aurélien Joga
1f5b590d5a
Python-server workflow fixes + pytest (#17060)
* Fix referenced path for tests

* Explicit dependencies

Flask 2.3 has breaking changes

* Marks all async tests with pytest.mark.asyncio

Otherwise they are skipped by pytest and coverage is zero

* Fix path for pytest

On suggestion from https://github.com/OpenAPITools/openapi-generator/pull/17060#discussion_r1392666369
2023-11-18 10:10:10 +08:00
William Cheng
53289263d9
Prepare v7.2.0 (#17050)
* update version to 7.2.0-SNAPSHOT

* update samples

* update doc
2023-11-13 18:53:20 +08:00
Ian Cubbon
c9f7af752f
Verify Path params that fall into the string bucket are supplied (#17032) 2023-11-13 11:02:33 +08:00
Ian Cubbon
2f655f1a9c
Time parameters in the path resulted in code that would not compile (#17021)
This is probably a pretty rare case as it just seems weird to have a time
path parameter, but it's good to fix.
2023-11-13 10:01:32 +08:00
Ian Cubbon
291ce353ce
[Go][Server] FormParams - Generic Array Type Handling (#17001)
* If a form param is an array and isn't caught in the previous checks, treat it as a slice of strings.

* Add an example of a FormParam that is an array
2023-11-08 14:09:12 +08:00
loicconan
d945499073
[PHP-SYMFONY] Support BackedEnum for enum ref (16846) (#16847)
* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)
2023-11-07 22:40:35 +08:00
Dennis Melzer
f83cb60f27
Add optional parameter for request body (#16972)
* Add optional parameter for request body

* Adapt Test
2023-11-04 16:54:50 +08:00
Kapil Gupta
c4b18f206d
[Server][Spring] fix support interface and implementation classes for API controllers (#16945)
* [Server][Spring] support interface and implementation classes for API controllers

* Omitted new string calls

* Added Log messages

* remove else

* Removed redundant if

* Update missed ;
2023-11-04 16:52:17 +08:00
dabdirb
739390a682
java exclude password field from toString (#16942) 2023-10-31 17:50:30 +08:00
devhl-labs
5a5ee163dc
fixed lambda to not strip line breaks (#16930) 2023-10-29 11:08:04 +08:00
Ian Cubbon
677b6e64c1
If parsing a boolean fails, return a ParsingError instead of a straight 500 (#16910)
Add an example endpoint that covers Required, Default, and Not Required cases
2023-10-28 20:32:04 +08:00
Artem
05b796aadc
Fix type hint for array in comments. (#16926) 2023-10-28 20:30:16 +08:00
Nathaniel Cook
fbd02554f5
fix(rust-server): remove redundant clone (#16906)
The generated example code would clone the context. However as context
is a generic type and is not declared to implement Clone, a clone of a
reference is just a copy of the reference and therefore unnecessary.
This change removes the redundant call and therefore avoids the `cargo
clippy` warning.
2023-10-27 11:06:34 +08:00
loicconan
cb85358aa5
[PHP-SYMFONY] Debug Date and DateTime Assert (#16874) 2023-10-23 22:26:27 +08:00
Ian Cubbon
bf9fae641e
[Go-Server] Add support for DateTime Query Parameters (#16749)
* Add support for DateTime objects in the Path, Query Params, and as a List

* Fix indentation

* Add an exaple that has dateTimes
Move the date parsing into a common util in the routers.go file.

* Fix compilation issue and regen

* Use the `RequiredError` to handle this case

* Only split on a "," and not an extra 'space' after the ",".
2023-10-22 21:07:13 +08:00
Ian Cubbon
e0738a6e42
[Go-Server] Support for an endpoint returning a file to the client - #15206 (#16748)
* Support for an endpoint returning a file to a client.

* Spaces to tabs conversion

* Add an example endpoint for download a file

* Regenerate after merging main
2023-10-17 11:42:27 +08:00
Ian Cubbon
1dd9590064
[Go-server] - Support for Enums in the Path and Query (#16781)
* Add support for Enums to be part of the Path and Query
Supports optional Query Enums and Lists of Enums as well
Add an example endpoint that covers the added scenarios
Added an import mapping for the GoServerCodegen for "fmt"
    when a model is an enum.
Expanded the Enum Model for the Go Server to have validation.
    Copied this logic from the Go Client Enum Model.

* Fix identation of examples

* Pre-allocate the capacity of the slice of Enums to be
the correct size.

* Formatting and updated examples

* Empty-Commit

* Switch to using a map to store the valid enum values

* Fixed pointer derefs missed from previous change in PR

* More fixing of pointer to not pointer

* Create a map for validation and a list of enums for messaging
2023-10-17 11:35:39 +08:00
DaxServer
8bb473316e
[PHP-Symfony] fix #15950: Add float to deserialize (#16835)
* [PHP-Symfony] fix #15950: Add float to deserialize

* Add test sample

* Add double

---------

Co-authored-by: DaxServer <daxserver@icloud.com>
2023-10-16 22:19:33 +08:00
Gonzalo Gomez
571aefa3da
io/ioutil has been deprecated. (#16822)
Uses os.CreateTemp to create temp directory.
Uses io.Copy to avoid reading file into memory.
2023-10-14 10:04:06 +08:00
William Cheng
ba367e60e8
[go-server] Add tests, minor format change (#16805)
* add tests for #16787, minor format change

* revert

* fix typo

* use pet instead of fake

* update samples
2023-10-12 19:23:02 +08:00
SURAJ VASHISTA B K
494ee489ad
fixed a flaky test org.openapitools.codegen.DefaultCodegenTest.testVarsAndRequiredVarsPresent (#16751) 2023-10-10 13:31:22 +08:00
martin-mfg
e3db882ed4
[JAVA][KOTLIN][SPRING] upgrade dependencies (#16759)
* upgrade spring-boot-starter-parent

* upgrade springdoc and swagger-ui

* upgrade v3 swagger-annotations

* generate samples

* upgrade jackson

* fix spring cloud, remove temp comment

Putting "8" instead of "1.8" should be ok, because Spring Boot 3 requires Java 17 anyway, so it should be able to understand that 8 is the same as 1.8.

* generate samples

* upgrade JUnit 5, remove commons-io dependency, remove outdated samples/client/petstore/java/feign/feign10x/ files, generate samples

commons-io dependency was introduced in https://github.com/OpenAPITools/openapi-generator/pull/8484, but I don't see why it would be needed now or back then.

* update gson, generate samples

* update logback

* update feign

* update scribejava

* generate samples

* update httpmime

* okhttp-gson: update commons-lang & okhttp & junit-platform, remove mockito; generate samples

It seems Mockito is not used at all there.

* okhttp-gson: remove unnecessary sample files, generate sample files

* upgrade google-api-client & jersey-common, restore ClientTest, generate samples

* misc. upgrades in jersey2 and jersey3

jersey 3.1.3 is available already, but IntelliJ reports security problems in 3.1.3 and 3.1.2, so I used 3.1.1 instead.

* align some gradle&sbt files with poms, generate samples

* whitespace fix
2023-10-09 14:55:32 +08:00
dabdirb
4a0ab21ba4
[Spring] resolves #16054, resolves #15088 add vendor extension x-spring-provide-args (#16663)
* add vendor extenstion x-spring-provide-args

* add vendor extenstion x-spring-provide-args

* Revert "add vendor extenstion x-spring-provide-args"

This reverts commit 8a0cbc93eb5825651e4b97cbe83054adbaa1acce.

* catch up latest main and re-generate samples

* remove un-used import

* add vendor extenstion x-spring-provide-args (#16054,#15088)

* update  X_SPRING_PROVIDE_ARGS for better description

---------

Co-authored-by: xiangxi.chen <xiangxi.chen@cerence.com>
2023-10-05 11:11:55 +08:00
William Cheng
11771a8ccf update samples 2023-10-04 15:11:06 +08:00
Jorge Rodríguez Martín
ee5d9f6ad3
[Java][Spring] Fix RequestPart/RequestParam handling on multipart request in reactive stack (#16535)
* Fix requestpart in reactive

* Update samples
2023-10-01 23:23:24 +08:00
Artem
039c1698b0
[php-symfony] Support for default scalar value of properties in model (#16605)
* Add support for default scalar value of properties in php-symfony models. Default values now returns in getter-functions

* Revert nullable type-hinting. Move default values from getter to property initialize.
Made changes in __construct:
Now value of properties rewrites only if key exist in $data array.
2023-10-01 21:32:32 +08:00
Aarni Koskela
67b129fda9
python: Remove usage of six (#16675) 2023-09-28 19:26:42 +08:00
William Cheng
bb3096c99c
Jaxrs jersey3 server (#16676)
* Introduced Jersey3 to JavaJerseyServerCodgen and its test class

* Added date ParamConverterProvider to new jersey3 resource directory

* Copied and adjusted jaxrs-jersey2 directory to jaxrs-jersey3

* Added unit tests for Jersey2 (jakarta|javax) and jersey3 (jakarta only)

* Added Jersey3 to markdown documentation

* Added several mustache files for Jersey3

* Further adjustments in JavaJerseyServerCodegen for Jersey3

* Removed tabs from JavaJerseyServerCodegen

* Further improvements in pom and web template

* Changed to swagger-jaxrs2-servlet-initializer-v2 within the projects pom

* Changed servlet-initializer to jakarta version

* Removed tabs in JavaJerseyServerCodegenTest.java

* Removed tabs from JavaJerseyServerCodegen

* Out commented Swagger 1.x part in api.mustache (see ApiImplicitParams)

* Exchanged import of javax* by jakarta* in file verify.groovy

* Changed Parameter annotations to Schema annotations

* Added web.mustache for jersey3

According to the 'Swagger 2.X Integration and Configuration' doc at
https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Integration-and-Configuration

* Adjusted README to point to ./openapi.json instead of ./swagger.json

* Added ./bin/configs/jaxrs-jersey-jersey3.yaml as requested

* Added new jersey3 example (see ./samples/server/petstore/jaxrs/jersey3

* Corrected formParams.mustache exchanged @FormParam by QueryParam

* Resolved ModelValidationException for Map query parameter

* Improved api.mustache (layout and deprecated class instantiation )

* Updated jersey3 example under ./samples/server/petstore/jaxrs/jersey3

* fix tests

* add jeresey3 to github workflow test

* add new workflow

* remove jersey3

---------

Co-authored-by: CDerksen <christian.derksen@uni-due.de>
2023-09-28 16:53:20 +08:00
martin-mfg
1cff462d90
remove jersey 1 (#16646) 2023-09-26 09:10:11 +08:00
martin-mfg
2ca99bdf8e
use model class for request body with additionalProperties (#16613)
* try out simple fix

* add test case

* generate samples
2023-09-23 13:07:53 +08:00
William Cheng
1bcf79236f update samples 2023-09-21 17:19:35 +08:00
krasv
8f8fd85fd6
contribution #6123: add spring support for SSE conform specs (#16543)
* add spring support for SSE conform specs

see https://github.com/OpenAPITools/openapi-generator/issues/6123 for the ongoing discussion

* extend generator option documentation

* applied review suggestions

* regenerated samples

* regenerated docu

* fix code style: removed tabs
2023-09-21 17:08:24 +08:00
William Cheng
5e8e2d7f6d
Prepare v7.1.0 in master (#16608)
* prepare v7.1.0 in master

* update
2023-09-18 17:37:36 +08:00
William Cheng
8c8be7482b
Update java undertow to newer version (#16606)
* update java undertow to newer version

* update compiler plugin to newer version

* test undertow in circleci

* use 3.0 spec
2023-09-18 11:26:33 +08:00
William Cheng
5f0d7053e4
Update go gin to newer version (#16593)
* update go gin to newer version

* update test
2023-09-15 15:50:25 +08:00
William Cheng
9170e1030f
fix enum in python flask (#16576) 2023-09-13 15:49:38 +08:00