2145 Commits

Author SHA1 Message Date
Jean-François Côté
7dfd844f13 Fix based on code review 2023-05-31 12:39:49 -04:00
Jean-François Côté
8efcc2c62d Update samples for aspnetcore 2023-05-31 07:46:01 -04:00
William Cheng
8bad27e0ab
update python fastapi server dependencies (#15650) 2023-05-29 17:16:15 +08:00
William Cheng
7006b388de
Update go-gin dockerfile to newer version: 1.19 (#15597)
* update go-gin dockerfile to newer version: 1.19

* add go.sum

* fix

* update go mod
2023-05-29 16:55:14 +08:00
devhl-labs
0350d0e313
fixed example values (#15666) 2023-05-28 11:51:14 +08:00
William Cheng
bbb6f4e6a0
[go-server] Update Dockerfile go version to 1.19 (#15596)
* update dockerfile go version to 1.19

* Update modules/openapi-generator/src/main/resources/go-server/Dockerfile.mustache

Co-authored-by: Ween Jiann <16207788+lwj5@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/go-server/Dockerfile.mustache

Co-authored-by: Ween Jiann <16207788+lwj5@users.noreply.github.com>

* update samples

---------

Co-authored-by: Ween Jiann <16207788+lwj5@users.noreply.github.com>
2023-05-26 10:51:07 +08:00
Nikita Vakula
3db7169959
[python-fastapi] Added a base class for the actual implementation (#14470)
It is very difficult to "merge" the changes, made by code generation,
and the changes, made by developers. It would be very useful to
separate the generated code and the code written by developers. In
addition this would remove the necessity to track the generated code.
Pyhton (since 3.6) has a hook, __init_subclasses__, that could be used
to solve exactly this problem.
The classes from *_base.py should be implemented in an ns package that is specified
by the additional parameter ("-p fastapiImplementationPackage=example_name").

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
2023-05-26 08:58:39 +08:00
William Cheng
1145197fad
Add workflow to tests C# projects with .net 6 (#15629)
* add workflow to tests C# projects with dotnet 6

* trigger build

* fix cmd
2023-05-25 21:06:51 +08:00
devhl-labs
63c26fc794
upgarded test project framework (#15634) 2023-05-25 11:00:38 +08:00
aramflo
2042fb222a
CASS-399: Adds {{>partial_header}} to missing mustache files in aspnetcore. (#15616) 2023-05-24 16:37:46 +08:00
Stephan Strate
9890f076a9
[kotlin-server] add support for jakarta ee namespace (#15593) 2023-05-24 08:44:39 +01:00
Tiffany Marrel
cbcf3d36f6
[Java] [Kotlin] (#14876) fix use of isBasic conditions - do not use HttpBearerAuth (or HttpBasicAuth) for other http auth methods (such as http signature auth or custom schemes) (#15220)
* remove http signature from test yaml when not supported

* do not use HttpBearerAuth for signature auth or other unsupported http auth method

ignore unsupported http auth method unless generated code would not compile (in which case, an exception is thrown)

* [Java] fix use of isBasic condition

* [kotlin] fix use of isBasic condition
2023-05-22 16:08:08 +08:00
Rustam
7881482161
[Ktor] Update generator to latest Ktor version #14061 (#14296) 2023-05-21 23:11:01 +08:00
William Cheng
54c8bf8733
[go-server] Add tests for boolean query parameter (#15563)
* add tests for boolean query parameter

* fix test
2023-05-18 15:39:43 +08:00
William Cheng
d8ed253439 update C# samples 2023-05-18 11:21:16 +08:00
Jean-François Côté
b7dc6ce598
[Aspnetcore] Fix nullable warnings part 1 (#15555)
* Fix nullable errors in attribute and filters

* Add missing samples
2023-05-18 11:14:55 +08:00
rledisez
44ad6d5eac [go-server] Support min/max/defaults for values (#15185)
* [go-server] Support min/max/defaults for values

Enforce, for the go-server, to check the minimum and maximum values
specified in the openapi description. Also apply the default if the
parameter is not passed.

Fix #14013

* Fix merge conflict

Co-authored-by: Ween Jiann <16207788+lwj5@users.noreply.github.com>

* Improve UnmarshalJSON implementation

Co-authored-by: Ween Jiann <16207788+lwj5@users.noreply.github.com>

* Improve default value handling for string

Co-authored-by: Ween Jiann <16207788+lwj5@users.noreply.github.com>

* Fix suggested changes

* rework option pattern

* add imports based on types/min max values

---------

Co-authored-by: Ween Jiann <16207788+lwj5@users.noreply.github.com>
2023-05-17 01:58:28 +08:00
Jean-François Côté
842ca3db69
Fix warning when building because of the missing documentation (#15543) 2023-05-17 00:44:58 +08:00
Sylvain Joubert
3a172c3753
[C++][Pistache] Add missing 'override' on virtual methods (#15469)
This is following #15279
Marking those methods 'override' should avoid producing
'-Winconsistent-missing-override' warnings or similar.
2023-05-16 17:13:34 +08:00
Sylvain Joubert
48d257b5c9
[C++][Pistache] Generate empty JSON object instead of a null value (#15468) 2023-05-16 17:05:44 +08:00
William Cheng
1c6decb394
minor enhancements to the aspnetcore server generator (#15518) 2023-05-16 15:24:48 +08:00
Jean-François Côté
edad90e794
Bugfixes/12952 fix newtonsoft using (#15515)
* Fix #12952: Handle useNewtonsoft parameter correctly
Next commit will have all modified samples.

* Fix #12952: Add generated samples

* Fix #12952: Add missing files
2023-05-16 14:41:51 +08:00
Andrii Serkes
fbf42de200
Fix JsonNullable issue for Helidon generators (#15423)
* fix JsonNullable issue

Signed-off-by: aserkes <andrii.serkes@oracle.com>

* update samples

Signed-off-by: aserkes <andrii.serkes@oracle.com>

* update samples, refactoring

Signed-off-by: aserkes <andrii.serkes@oracle.com>

* update samples, refactoring

Signed-off-by: aserkes <andrii.serkes@oracle.com>

* update samples

Signed-off-by: aserkes <andrii.serkes@oracle.com>

---------

Signed-off-by: aserkes <andrii.serkes@oracle.com>
2023-05-16 14:34:37 +08:00
martin-mfg
dd6ccaa84f
import @Valid in Spring delegates (#15330) (fix #15213) 2023-05-15 14:55:21 +03:00
Oleh Kurpiak
54cb33c6a1
[Spring] remove deprecated annotation from no-args constructor (#15512) 2023-05-15 14:13:18 +03:00
Ween Jiann
78bffff8f3
[Go] Update API naming to follow Golang standard pkg (1 line change) (#15331)
* Add apiNameSuffix to AbstractGoCodegen

* Regenerate files

* Update tests

* Regenerate files

* Update test files

* Regenerate for CI test

* Regenerate for CI test

* Remove some docs

* Add files back
2023-05-13 09:40:26 +08:00
William Cheng
9ace780eac update samples 2023-05-10 15:14:29 +08:00
William Cheng
0c3460f95b Merge remote-tracking branch 'origin/master' into 7.0.x 2023-05-10 15:00:56 +08:00
Tiffany Marrel
8a6c708884
[Java] Cleanup documentation (#15300)
* [Java] fix documentation of API authorization in README files

fix hierarchy level + add internal links + align wording across generators

* [Java] fix anchor links in documentation
2023-05-10 14:14:44 +08:00
Nuno Miguel Micaelo Borges
4e27041bdc
Add microprofile OpenApi annotations to JavaRxSpec (quarkus library). Add OpenID support (core) (#15407)
* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

---------

Co-authored-by: Nuno Borges <Nuno.Borges@ctw.bmwgroup.com>
2023-05-10 00:55:41 +08:00
Tiffany Marrel
ef35e6d7ea
[rust] fix documentation of API authorization in README files (#15352)
fix hierarchy level + align wording across generators
2023-05-09 14:30:54 +08:00
Tiffany Marrel
9cb14aeb8c
[php] fix documentation of API authorization in README files (#15306)
fix hierarchy level + align wording across generators
2023-05-09 14:25:14 +08:00
William Cheng
4e8d41bd79
Fix circleci test failures (#15317)
* fix circleci test failures

* trigger test

* update circleici pom.xml

* rearrange test

* comment out tests

* fix test

* comment out python-prior

* comment out test

* fix import

* comment out tests
2023-05-03 15:17:25 +08:00
Beppe Catanese
61aadb32bd
[GO] Add go.mod in go-gin-server generator (#15339)
* Add go.mod

* Add test

* Generate import path

* Update samples
2023-05-03 11:45:24 +08:00
Oleh Kurpiak
1f23b019fa
[Spring] fix Paginated without params (#15315) (fix #15265) 2023-04-27 14:32:11 +03:00
Tiffany Marrel
da96058f5b
[kotlin] cleanup documentation (#15307)
* [kotlin] fix documentation of API authorization in README files

fix hierarchy level + add internal links + align wording across generators

* [kotlin] fix anchor links in documentation

---------

Co-authored-by: Tiffany Marrel <tiffany.marrel@flowable.com>
2023-04-27 11:33:15 +01:00
CTerasa-ep
b847140834
[C++][Pistache] Generate API generalization interface (#15279)
* [C++][Pistache] Refactor setupSupportingFiles

Supporting files are set up in the CppPistacheServerCodegen()
constructor as well as in processOpts(). Refactor the code and extract a
method setupSupportingFiles().

* [C++][Pistache] Refactor: Simplify isQueryParam condition

Both branches of the if/else do the same steps. Refactor this out and
invert logic.

* [C++][Pistache] Refactor: Add injectImplInFilename

Both branches of the if/else if do the similar steps and are dependent
on the suffix. Make this obvious by introducing a new method
injectImplInFilename(String result, String suffix).

* [C++][Pistache] Refactor: injectImplInFilename: remove index search

We do not need the separatorChar index to inject the "Impl" string.
Simply truncate the whole string.

Also rename the parameter from 'result' to' filename'.

* CppPistacheServer: Refactor postProcessOperationsWithModels

Pull out the post-processing for a single operation, and also pull out
post-processing for parameters.

Introduce boolean expressions for supported parsing per parameter, and
consumption of JSON.

Reorder code to make locality more explicit i.e. how consumeJSON and
isParsingSupported is generated and used.

* CppPistacheServer: Refactor to use functional matching

Functional matching like anyMatch() directly state what boolean value is
 searched.

 However, the Predicates deserve to heave names themselves.

* CppPistacheServer: Add base class for Api

Looking at the generated main-api-server.cpp code it gets obvious that
the API classes are self similar with a similar interface.
Only the construction and teh initialization is called in the main()
function. Leverage this fact to create a generalization ApiBase.

Introduce ApiBase as a pure virtual base class to the concrete API
classes and declare init() as virtual.

Pull the route member into the base class.

With this change we could have a container hold all the ApiImpl
objects later and call init() on all of them using a for_each loop.

* CppPistacheServer: Use ApiBase for ApiImpl storage

Refactor the main-api-server template to use a vector for ApiImpl
storage instead of separate objects. This leverages the previously
added ApiBase generalization.

 We push all concrete ApiImpl objects into a vector and call init() on
  each of them.

* [C++][Pistache]: Update generated sample

Due to teh addition of ApiBase class update the generated sample.

* [C++][Pistache] Add comment for postProcessSingleParam

* [C++][Pistache] Rename and comment implFilenameFromApiFilename

While writing the comment, I realized that the method name could be more
precise. Thus rename injectImplInFilename to implFilenameFromApiFilename
and add comment.
2023-04-26 20:01:58 +08:00
Rodrigo de Almeida - RMA3
2c78ff78ed
Fix issue 15264 - Replace @Controller with @RestController when using useSpringController (#15266)
* fix issue 15264

* If useResponseEntity true then keep @Controller if not @RestController

---------

Co-authored-by: Rodrigo Maciel de Almeida <rodrigo.almeida@wefin.com.br>
2023-04-20 18:35:09 +03:00
Rodrigo de Almeida - RMA3
9b2917f3a9
Fix issue 12341 (#15234)
* if method return type is void then no return

* build the project

* fix build the project

* fix build the project

* fix return

* fix build the project

* fix build the project

* fix build the project

---------

Co-authored-by: Rodrigo Maciel de Almeida <rodrigo.almeida@wefin.com.br>
2023-04-18 23:56:12 +03:00
William Cheng
5832731c0e
[java] Update undertow to newer version (#15222)
* update undertow to newer version

* fix
2023-04-15 14:56:48 +08:00
Ween Jiann
1163b9cd3b
[go-server] Fix: name declared and not used (#15201)
* Fix: name declared and not used

* Update samples

* Re-enable workflow
2023-04-13 11:04:00 +08:00
William Cheng
935146d187 Merge remote-tracking branch 'origin/master' into 7.0.x 2023-04-12 17:51:47 +08:00
Ween Jiann
04441188c6
[go-server] Update dependencies and use generics (#15087)
* Update dependecies and go version

* Use generics for recurse

* Fix helpers.mustache

* Regenerate samples
2023-04-12 16:37:39 +08:00
William Cheng
f8cb5fde97
Add tests for aspnetcore 6.0 useSwashBuckle option (#15176)
* add test for aspnetcore 6.0 useSwashBuckle option

* update samples

* update petstore with more tests

* add options

* update samples

* remove unused files
2023-04-11 17:43:39 +08:00
Ween Jiann
792c49a0ce
[go-server] Change Routes type from []Route to map[string]Route (#15084)
* Change Routes to map[string]Route

* Fix linting issues

* Regenerate samples
2023-04-11 15:40:06 +08:00
Ween Jiann
8ce990d3d7
[go-server] Add ability to handle parameters of number type (#15079)
* Add ability to handle parameters of number type

* Generate samples

* Add handling for number without format

* Regenerate samples

* Fix indentation
2023-04-11 15:38:58 +08:00
William Cheng
5d1e18306a
Prepare 6.6.0-SNAPSHOT (#15100)
* set 6.6.0 snapshot version

* update samples

* update readme
2023-04-01 18:48:01 +08:00
William Cheng
7417432a54
Prepare 6.5.0 release (#15099)
* 6.5.0 release

* update samples
2023-04-01 15:03:35 +08:00
William Cheng
9fa032b365
add isOverridden, update java pojo with setter for parent prop (#15051) 2023-03-29 10:57:49 +08:00
William Cheng
a4dd90c01d
Better allOf handling in fromProperty (#15035)
* fix allOf handling in fromProperty

* add null check, update samples

* update dart generator to handle allof with a single ref
2023-03-26 15:06:27 +08:00