112 Commits

Author SHA1 Message Date
William Cheng
a4b5b85067
Update jackson nullable version to newer version v0.2.6 (#14823)
* update jackson nullable to newer version

* update samples

* update samples

* update samples
2023-02-27 18:38:31 +08:00
Dennis Melzer
92b96635bd
Fix bean validation for Collection and add unit test (#14736)
* Fix bean validation for Collection + uni test

* Fix

* Adapt examples

* Fix comments

* Merge master

* Remove Bean validation for Maps

* Remove @Valid from jakarta

* Fix example

* Fix comments

* Fix springboot-3 example
2023-02-25 22:06:31 +08:00
William Cheng
c50a775e0c
prepare 6.5.0 release (#14749) 2023-02-19 20:36:23 +08:00
William Cheng
93df0ff444
Prepare 6.4.0 release (#14748)
* prepare 6.4.0 release

* update samples
2023-02-19 18:53:20 +08:00
GregDThomas
c5d67ee042
Fix https://github.com/OpenAPITools/openapi-generator/issues/11570 by ensuring tags at the class level match tags at the method level (#13434) 2023-02-18 06:23:10 -08:00
Beppe Catanese
68b944e6e6
Preserve order of securitySchemes (#14536)
* Remove alphabetical sort

* Update integration testing expectations

* Regenerate files
2023-02-10 22:20:19 +08:00
William Cheng
31a89e35cb
Prepare 6.4.0 (#14582)
* update to 6.4.0 snapshot

* update samples

* update doc
2023-02-01 22:44:40 +08:00
William Cheng
8f2676c5c2
Prepare v6.3.0 release (#14580)
* 6.3.0 release

* fix maven plugin test

* update samples

* update doc

* fix tests in windows
2023-02-01 20:52:29 +08:00
cachescrubber
5300bff6d9
[Java][Spring] Upgrade Spring Cloud dependencies (#14285)
* Upgrade to Spring Boot 2.7.6/3.0.0

* generate samples
2022-12-20 22:02:03 +08:00
Nathan Baulch
9f1fa0e440
Fix another batch of spelling typos (#13915)
* Fix typos

* Remove repeated words

* Minor grammar fixes
2022-11-07 21:30:24 +08:00
William Cheng
4d03c9272b prepare 6.3.0 snapshot 2022-10-15 15:40:47 +08:00
Dennis Melzer
0a69f11526
Remove wrong request mapping for feign clients (#13546)
* Remove request mapping

* Fix bug for feign clients

* Fix test

* Fix test files

* Rebuild

* Revert change
2022-10-07 01:36:43 +08: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
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
RomainPruvostMHH
032e1a42d6
[Spring] Fix generated api ignore basePath (#10573)
* remove @RequestMapping from the apiController.mustache file and add it
to the api.mustache file

* move the defaultBasePath.mustache file in src/main/resources/JavaSpring
so that it commun with all Spring server-side libraries (spring-boot,
spring-mvc). The value of default context path is the value of
contextPath variable.

* added a unit test to verify it

* update the outputDir variable to samples/server/petstore/spring-stubs in
the  bin/configs/spring-stubs.yaml file because it generates Spring
server-side classes. And not on the client-side as the output directory
seemed to suggest.

* Results of "generate-samples.sh bin/configs/spring*" command

* Remove default value of url in @FeignClient

* resolve conflicts with origin/master

* merge remote/master into branch

* fix samples after a merge with master

* delete the directory samples/client/petstore/spring-stubs because it
moved to samples/openapi3/...

* add samples/client/petstore/spring-stubs just for the CI build (normally
it is unnecessary))

* delete 3 kotlin class files commited by error in
samples/server/petstore/kotlin-springboot and
samples/server/petstore/kotlin-springboot-reactive

* Update the unit test SpringCodegenTest.doAnnotateDatesOnModelParameters
because one more annotation is generated (@RequestMapping)

Co-authored-by: rpruvost <rpruvost@ITEM-S78402.emea.msad.sopra>
Co-authored-by: rpruvost <rpruvost@ITEM-S78402>
Co-authored-by: rpruvost <rpruvost>
2022-08-08 15:43:23 +08:00
Oleh Kurpiak
2e2da7bc82
[Spring] fix deprecated generation (#12832) 2022-07-13 11:08:28 +08: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
cachescrubber
8be490d130
Upgrade Spring Boot to 2.5.14 / 2.7.0 (#12408)
* Upgrade Spring Boot to 2.5.14 / 2.7.0

* Generate Samples
2022-05-20 20:24:13 +08:00
William Cheng
6bc065ec34
Specify source encoding in java/kotlin sample poms templates (#12088)
Co-authored-by: cghislai <charlyghislain@gmail.com>
2022-04-09 15:20:58 +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
cachescrubber
7fb0fcb96c
Upgrade to Spring Boot 2.6.6/2.5.12 and Spring Cloud 2021.0.1. (#12027)
* Upgrade to Spring Boot 2.6.6/2.5.12 and Spring Cloud 2021.0.1.

* Generate Samples
2022-04-01 14:19:09 +08:00
Oleh Kurpiak
c71bc25aa2
[Java][Spring] use tag description from specification (#12000) 2022-03-30 16:43:28 +08:00
cachescrubber
50bf764268
Spring Boot Dependency Upgrade (#11960)
* Dependency management: Upgrade Managed Versions

* spring-boot: add optional classifier to spring-boot maven plugin configuration

* Upgrade to spring-boot 2.5.10

* Generate Samples

* Upgrade to Spring Boot 2.5.11 / 2.6.5

* Generate Samples
2022-03-26 10:23:25 +08:00
cachescrubber
e07c7d1617
[Feature][Java/Spring] Support Discriminator Based OneOf Interface (#11650)
* Fix OpenAPITools#5381
added x-is-one-of-interface extension for oneOf interface in mustache
template

* Fix OpenAPITools#5381
fixed name of model from UNKNOWN_BASE_TYPE to right one in api: operationId + OneOf

Fix OpenAPITools#5381
parcelableModel is not required

* Fix OpenAPITools#5381
removed not needed methods

* Fix OpenAPITools#5381
catch NPE cases in preprocessOpenAPI
updated samples

* Fix OpenAPITools#5381
fixed generation of oneOf Models

* Fix OpenAPITools#5381
addOneOfInterfaceModel only for cases when useOneOfInterfaces is true and for spring

* Fix OpenAPITools#5381
NPE fix

* Fix OpenAPITools#5381
spring: fixed use of oneOf Models in API

* Fix OpenAPITools#5381
implementing oneOf for spring lib overriding methods with different behavior from default

* Fix OpenAPITools#5381
added x-is-one-of-interface extension for oneOf interface in mustache
template

* Fix OpenAPITools#5381
fixed name of model from UNKNOWN_BASE_TYPE to right one in api: operationId + OneOf

Fix OpenAPITools#5381
removed not needed methods

Fix OpenAPITools#5381
fixed generation of oneOf Models

Fix OpenAPITools#5381
addOneOfInterfaceModel only for cases when useOneOfInterfaces is true and for spring

Fix OpenAPITools#5381
NPE fix for tests

* Fix OpenAPITools#5381
fixed handing of composed schema with array

* Fix OpenAPITools#5381
fixed NPE in addOneOfInterfaceModel

* Fix OpenAPITools#5381
fixed generation of oneOf models with descriminator

* Initial merge of 5.0

* Aligned with master formatting

* Corrected spacing for class names to align with samples.

* Merged master

* Updated samples

* Consolidate methods from JavaClient and SpringCodegen (mov up to AbstractJavaCodegen)

* set useLegacyDiscriminator to false, format templates

* Suport JsonTypeName, fq class name for spring.io.Resource

* Generate Samples

* Test full qualified usage of the spring Resource interface.

* Add java-camel to samples.circleci.spring profile

* Add more complex example combining inheritance and oneof-interface

* Remove x-implements Serializable from JavaClientCodegen (moved to AbstractJavaCodegen)

* Fix spacing before opening brace after extends/implements

* Generate Samples

* Add more complex example combining inheritance and oneof-interface

* Generate Samples

* Fix JsonTypeName annotation handling in Java and JavaSpring

* Content mediatype is hardcoded in api.mustache #11511

* Generate Samples

* OAS3 incorrect data type when providing a default value #11367

* Generate Samples

* Fix JsonTypeName annotation handling in Java and JavaSpring

* Generate Samples

* getIsClassnameSanitized: use null safe equals

* Fix JsonTypeName annotation handling in Java and JavaSpring (merge)

* Generate Samples

* Generate Samples

* Add oneof sample

* Generate Samples

* Giv example oas spec a meaningful name, demo usage of oneOf in Model

* Generate Samples

* Remove unnecessary JsonTypeName include, add example for JsonTypeName (Bar_Create)

* Generate Samples

* Generate Samples

Co-authored-by: Alexej <oleksejk@gmail.com>
Co-authored-by: JBurgess <joel.burgess@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-03-16 22:50:05 +08:00
Reda
33b89148e5
[JavaSpring] Multipart causing HttpMediaTypeNotSupportedException when parameter is different than File or String (#11449)
* Generate @RequestParam when parameter is not a File

* Fix tests to use @RequestParam

* Enhance testMultipartBoot test case

* Update the Petstore sample

* Add MultipartMixedStatus files

* Use @RequestPart for spring-cloud when param is File

* Generate samples

* Delete spring-cloud formParams.mustache file

* Regenerate samples
2022-02-27 15:07:35 +08:00
cachescrubber
194b3fda26
[Bug][Java/Spring] OAS3 related bugfixes and enhancements (#11526)
* Content mediatype is hardcoded in api.mustache #11511

* Generate Samples

* OAS3 incorrect data type when providing a default value #11367

* Generate Samples

* Fix JsonTypeName annotation handling in Java and JavaSpring

* Generate Samples

* getIsClassnameSanitized: use null safe equals
2022-02-05 17:29:58 +08:00
William Cheng
0e1164ff6b Merge remote-tracking branch 'origin/6.0.x' 2022-01-31 14:26:14 +08:00
William Cheng
4a36be7002
Prepare 5.4.0 release (#11457)
* prepare 5.4.0 release

* update gradle tests
2022-01-31 13:04:25 +08:00
cachescrubber
b261b29efb
[Java/Spring] Revert to fully qualified import for org.springframework.core.io.Resource (#11461)
* Revert to fully qualified import for org.springframework.core.io.Resource

* Generate Samples
2022-01-31 11:14:34 +08:00
William Cheng
c8b84c4d03 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-30 18:01:35 +08:00
cachescrubber
e1c5b220cd
[JAVA] new Feature interface: Documentation Provider and Annotation Library (#11258)
* Implement DocumentationProviderFeatures and integrate it in AbstractJavaCodegen

* Integrate DocumentationProviderFeatures in SpringCodegen

* Run new test config spring-boot-springdoc

* Do not use Locale.ROOT

* Do not use Locale.ROOT, use NONE instead of empty list

* Revert "Do not use Locale.ROOT"

This reverts commit a0d6aac92bea2370b4f164d18ada3fd9097f3a30.

* Do not use forbidden APIs

* Fix spring maven plugin example

* Introduce DocumentationProviderFeaturesTest.java

* replace AUTO with preferredAnnotationLibrary

* remove sout.println from Test

* Apply code style.

* Update spring sample configuration to use the new property

* Update samples after merge

* fix atBean import

* Generate all samples

* Add ParameterObject to test

* Allow Subclasses to opt out

* Use OpenAPI 2 (fka Swagger RESTful API Documentation Specification) instead of just "Swagger"

* export generator docs

* Fix typo

* Fix typo - update docs.
2022-01-22 08:51:17 +08:00
cachescrubber
0f6b620817
[Java Spring OAS3] Minor fixes and general improvements (#11229)
* * Use Relative Imports for org.springframework.core.io.Resource
* api.mustache: Add operationId to atOperation annotation
* Overhaul atSchema annotation in model
* Add spring-stubs-oas3.yaml test config
* Optimize mustache templates
* Use Relative Imports for DateTimeFormat, Pageable and ApiIgnore

* Add spring-stubs-oas3.yaml test config

* Generate all samples

* Explain fromOperation override to support more logic-less templates.

* Support RootUriTemplateHandler from spring-boot

* Revert "Support RootUriTemplateHandler from spring-boot"

This reverts commit 1915f8b19e391b1c570f1025931690a67afba3ea.

* Evaluate additional property useSpringfox as Boolean

* Generate all samples after merge (java-camel)

* Fix typo

* Move java-camel test deom samples.circleci.spring to samples.circleci profile.

* re-generate all samples after merge

* Generate samples and docs after merge

* Generate samples after merge conflicts resolved
2022-01-17 15:25:50 +08:00
William Cheng
d17a472b89 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-03 18:03:00 +08:00
cachescrubber
e71ee1bf43
[Java Spring OAS3] Fix numerous OAS3 related Bugs (#11181)
* Oas3: Remove swagger2 ApiModel and ApiModelProperty from imports when oas3 is true.

* Oas3: Use either swagger v2 or v3; add test config

* Oas3: allowableValues and defaultValues belong to the Schema annotation

* Oas3: use swagger-core.version property in all pom.xml

* gh-11165 remove io.swagger.v3.oas.annotations.parameters.RequestBody

* gh-11168 add import for io.swagger.v3.oas.annotations.Hidden

* Fix formParams.mustache, add dedicated test scripts for the spring generator using oas3.

* Run ./bin/generate-samples.sh

* Run ./bin/generate-samples.sh - new samples

* fix indentation

* Revert to threetenbp 2.9.10 because customInstantDeserializer.mustache is not compatible with threetenbp > 2.9.10.

* apiController.mustache: pull in osa3 imports.

* apiDelegate.mustache: remove io.swagger.annotations.* import

* Remove Hidden (import and usage). Wrap atApiIgnore with useSpringfox.

* fully qualify org.springframework.data.domain.Pageable because endorExtensions.x-spring-paginated is not set during import processing.

* align spring-cloud and spring-boot pom.mustache regarding springfox and oas versions.

* introduce dateTimeParam.mustache

* Apply DateTimeFormat consistently across different parameter types

* revert to springfox 2.9.2

* add newline after parameter

* fix atSchema annotation (use empty description)

* add more spring-*-oas3 test configs

* Update bin/config/spring* test samples

* Fix implicitHeader.mustache - add import, generate use paramDoc.

* rename spring-boot-implicitHeaders-oal3.yaml to spring-boot-implicitHeaders-oas3.yaml

* Add spring oas3 configs to samples.circleci profiles module list

* Use groupId 'org.openapitools.openapi3' for oas3 configs

* Run all spring test configs.

* In OAS3, allowableValues is a String[] array.

* formParams.mustache: Align spacing and newlines with other param templates

* Support @Parameter(hidden = true) instead of ApiIgnore, Formatting: One parameter per line.

* Format method level annotations in api.mustache

* Introduce samples.circleci.spring profile

* Generate all spring samples
2022-01-02 21:05:46 +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
Justin Black
cee5f75912
Feat adds content and header properties to CodegenResponse (#11046)
* Adds responseHeaders to codegenResponse

* Sets response headers in codegenResponse

* Samples updated

* Adds test of response headers

* Adds content to CodegenResponse

* Sets codegenResponse content

* Tests added, test content-data.yaml spec update

* Adds mediaTypeSchemaSuffix input to getContent

* Tests updated

* Updates how response content schema names are set

* Adds missing Locale to String.format invocations
2021-12-10 13:49:29 -08:00
WILLIAM CHENG
eb75515715 Merge branch '5.4.x' into 6.0.x 2021-11-21 09:50:47 +08:00
WILLIAM CHENG
78fe5dc427 Merge remote-tracking branch 'origin/master' into 5.4.x 2021-11-21 09:43:21 +08:00
Mike Welsh
b117d29729
Allow Spring generated code to use new OAS 3 annotations (#9775)
* Resolve #9774

- Add in `oas3` option for Spring codegen to use newer annotations
- Add `useSpringController` option for Spring codegen
- Use `useSpringfox` to fix some unwanted imports for Spring codegen
- Use `jdk8` to add OffsetDateTime import for models in Spring codegen
- Add `JsonValue` to `enumOuterClass.mustache` to allow enums to be
  generated properly

* Update spring examples

* Update with a clean maven install and regenerate samples

* Remove newling at end of param files and regenerate samples

* Update codegen with merge from master

* Update tests and samples

* Remove #vendorParams from API

* Update generated and tests

* Get closer to master

* Remove SpringFox setter boolean

- Annotation was altered to be fully qualified, doesn't need import
  removed anymore

* Update examples and tests

* FIx pojo.mustache (missed update to master) and regenerate tests

* Fix pojo.mustache extra `(`

* Update tests and documentation

* Update models and documentation

* Handle boolean property correctly

- Use `convertPropertyToBoolean` and `writePropertyBack`

* Fix more @ApiParam usage with @Parameter

- Also replace allowableValues with @Scheme(allowableValues =
`

* Update samples

* Update maven `pom.xml` mustache to use OAS3 annotations

* FIx typo in variable name

* Write back `useSpringfox` property
2021-11-03 00:44:54 +08: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
730636ad31 Merge remote-tracking branch 'origin' into 6.0.x 2021-10-19 12:55:59 +08:00
Dennis Melzer
12d80bfbb5
Fix import for new spring boot version (#9144)
* Fix import for new spring boot version

#8561

* Add new versions

* Fix samples

* Remove unused dependencies

* Revert "Remove unused dependencies"

This reverts commit bdac08b80a64b74affec2cea71b524fcd87a4c1b.

* Add version

* Fix version

* Add hystrix note this depcreated

* Migrate to Junit5

* Trigger build

* Add junit5

* Upgrade to new hystrix starter

* Try to enable hystrix

* Remove hystrix and upgrade to boot 2.5.5

* Remove hystrix

* Revert yaml

* Remove hysterix

* Trigger build

* Update docu

* use 4-space instead of tabs

* remove HystrixCommand

* add back spring-cloud test with oas 3.0 spec

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-10-13 15:29:14 +08:00