111 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
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
Johnny Marnell
c912bae3bc
[Spring] Fix bean name collisions (#14092) (fix #14094)
* Use correct Pascal case for java enum

* Uniquely name @Bean annotations

* Use existing mustache var instead, run generate files

* rebase, re-run generators

* try to undo botched rebase/merge

* Attempt to manually undo whatever is going on w/ build, oops

* Attempt to manually undo whatever is going on w/ build, oops
2023-01-17 11:24:15 +02:00
Marvin Rensing
4cd080762a
[Java][Spring] fix RequestPart/RequestParam handling on multipart request for arrays (#14450) (fix #14449) 2023-01-16 11:39:51 +02:00
Oleh Kurpiak
dc99a450dd
[Java][Spring] fix @Operation content for array response (#14201) 2023-01-02 17:10:48 +08:00
cachescrubber
c45814a7ea
[Java][Spring] Upgrade Dependencies (2022-12) (#14283)
* Upgrade to the latest Spring Boot / Springdoc and Swagger Ui dependencies

* Generate samples
2022-12-19 17:41:38 +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
2947d147b4 Merge remote-tracking branch 'origin/master' into 6.3.x 2022-11-01 17:42:59 +08:00
William Cheng
b0ce532bdc
Prepare 6.2.1 release (#13871)
* prepare 6.2.1 release

* revert change

* fix maven plugin test

* update meta
2022-11-01 17:16:46 +08:00
cachescrubber
b54299fffa
Spring request mapping mode (#13838)
* Introduce RequestMappingMode option

* generate docs

* Add test case using interfaceOnly

* Generate Samples

* Add requestMappingMode: iface to bin/configs/spring-boot-oas3.yaml

* Restore #12250: Move Feign Client url parameter under condition.

* Rename iface to api_interface.
2022-11-01 09:44:01 +08:00
Thibault Duperron
1b65ef38f5
Update dependecies for CVE (#13834)
* Update dependecies for CVE

fix #13772

* Fix schemas
2022-10-31 10:55:11 +08:00
Thibault Duperron
458ea56896
[SPRING] Add converters for enums (#13349)
* [SPRING] Add converters for enums

* Review

* review

* fix merge

* review
2022-10-28 23:55:40 +08:00
William Cheng
4d03c9272b prepare 6.3.0 snapshot 2022-10-15 15:40:47 +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
Justin Black
43375b9392
Upgrades swagger parser to 2.1.1, allows ingestion of 3.1.0 specs (#13133)
* Upgrades swagger-parser

* Removes additional property and halting of spec processing

* Updates tests

* Docs updated
2022-09-17 08:33:47 -07:00
Oleh Kurpiak
0c6a951615
[Spring] Bean validation for headers (#13414) 2022-09-14 23:07:08 +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
9d6b12591e
Fix set, map import (#12818)
* fix set, map import

* update samples

* update tests
2022-07-10 14:58:55 +08:00
William Cheng
f242b5e1dd
Skip import of allOf composition schema (#12798)
* skip import of allOf composition schema

* update samples

* allow python generator to keep old behaviour

* update js import
2022-07-10 14:58:22 +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
ad3b5f7045
[Inline model resolver] various improvements (#12293)
* better handling of requestbody in the inline resolver

* remove commented code

* better request body naming

* fix unique naming

* minor code format change

* removed additional underscore from names, fix test

* more fixes, update tests

* fix all tests

* undo changes to default codegen

* update samples

* update python tests

* add new files

* update samples
2022-05-10 17:13:57 +08:00
cachescrubber
f195a83aaf
[Java/Spring] all-of and one-of Improvements and Fixes (was #12075) (#12089)
* Fix Bug in OneOfImplementorAdditionalData pulling in wrong vars to one-of-implementors.
Support parentVars in order to support fluent setter with inherited properties.

Squashed commit of the following:

commit f945c943777a1a496d7de8fc0a188842d9efb1ac
Author: Lars Uffmann <lars.uffmann@gmail.com>
Date:   Thu Apr 7 18:22:54 2022 +0200

    Polishing

commit 23ce1d0ff1faff53e85ca4362f33660962aa6a92
Author: Lars Uffmann <lars.uffmann@vitroconnect.de>
Date:   Thu Apr 7 17:15:28 2022 +0200

    Add JavaDoc

commit fee70fde5709afa67f3aabd4f48ba496df63a884
Author: Lars Uffmann <lars.uffmann@vitroconnect.de>
Date:   Thu Apr 7 17:11:17 2022 +0200

    Add imports for inherited Properties

commit 29509aaac51750fbd33c00a57d32cac34cbcbb90
Author: Lars Uffmann <lars.uffmann@vitroconnect.de>
Date:   Thu Apr 7 13:40:36 2022 +0200

    Generate Samples

commit 1d19d5465137d3af712f2fd3b4ae4474c58af15e
Author: Lars Uffmann <lars.uffmann@vitroconnect.de>
Date:   Thu Apr 7 13:21:23 2022 +0200

    SpringCodegen: Support parentVars in order to support fluent setter with inherited properties.

commit 2217a77bb747d0b07ef17407a6b5dd5c624a2551
Author: Lars Uffmann <lars.uffmann@gmail.com>
Date:   Thu Apr 7 07:18:50 2022 +0200

    Add allVars to omit list in OneOfImplementorAdditionalData

commit 90499a3b0a187971bfe25deb6355c3444dcf89a7
Author: Lars Uffmann <lars.uffmann@gmail.com>
Date:   Wed Apr 6 16:40:23 2022 +0200

    Works exactly as needed for oneOf/allOf in Java/Spring

commit b6d496d772e0d0a8d87a3b8cdba8fd3ca4db7f3f
Author: Lars Uffmann <lars.uffmann@gmail.com>
Date:   Wed Apr 6 15:16:27 2022 +0200

    Debug Session: identify critical codep path

commit 85722360038107f15841d5acc448d93dee513a06
Author: Lars Uffmann <lars.uffmann@vitroconnect.de>
Date:   Tue Apr 5 09:56:38 2022 +0200

    Add test case to reproduce issue.

commit 14acc5cd974bb5260f3751015558807e2eb1a8a1
Author: Lars Uffmann <lars.uffmann@gmail.com>
Date:   Tue Apr 5 06:57:30 2022 +0200

    Add config to reproduce the issue

* Adjust indentation.

Co-authored-by: Lars Uffmann <lars@wintermute.local>
2022-04-16 16:48:14 +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
Oleh Kurpiak
8103ccdfa7
[Java][Spring] default value for list parameter (#11961) 2022-03-26 10:30:55 +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
William Cheng
5d8b80a5cd
[Java] rename x-contentType to x-content-type (#11895)
* rename x-contentType to x-content-type

* undo changes
2022-03-18 09:50:42 +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
Radek Postołowicz
c22997b9b8
Cleanup Jackson type info mess fixes (#9441) (#11691)
* Cleanup Jackson type info mess fixes (#9441)

* fixup! add import mapping for JsonIgnoreProperties
2022-03-07 09:36: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
5afec1fec7
Spring hide controller impl (#11611)
* hide implementation behind undocumented flag (_api_controller_impl_) to temporarily preserve code.

* Generate Samples
2022-02-16 11:06:41 +08:00
William Cheng
380aaa55a1
Remove JDK7 support from Java Spring generators (#11561)
* remove jdk8 support from spring generators

* update tests, remove commented code in AbstractJavaCodegen

* add back implementation

* add back import

* generate code for non reactive
2022-02-14 17:54:31 +08:00
cachescrubber
0ed147e7a4
Implement Source DocumentationProvider, spring-mvc decommission (#11531)
* - Upgrade swagger-ui to 4.4.1
- Bring homeController.mustache up-to-date
- Main class is now OpenApiGeneratorApplication
- Introduce SpringBootTest.mustache
- Remove option swaggerDocketConfig/openapiDocketConfig in favor of documentationProvider.

* Generate Samples

* Restore generator-online classes
Fix spring-mvc builds

* Generate Samples

* Do not generate SpringFoxConfiguration.java when reactive ist set.

* Fix generation of SpringFoxConfiguration

* Generate Documentation

* Reactive support: add dependency management for springdoc-openapi-webflux-ui

* Generate Samples

* Change SpringBootApplication to OpenApiGeneratorApplication

* Generate Samples

* Implement SwaggerUIFeatures in SpringCodegen

* Generate Samples

* Add useSwaggerUI: true to some test configs

* Generate Samples

* Update Documentation

* Update Documentation

* Update README.mustache

* Generate Samples

* useSwaggerUI is true by default

* Generate Samples

* Update Documentation

* Add deprecation warnings to cli opts; Log a deprecation warning

* Update Documentation

* Generate Samples

* Remove spring-mvc library

* Remove spring-mvc from project and CI configs

* Check whether the selected documentation provider requires us to boostrap swagger-ui.

* Generate Samples

* Generate samples

* Generate samples

* Generate samples
2022-02-12 17:25:21 +08:00
cachescrubber
9dfe8c63ee
[Bug][Java] defaultValues for date and date-time params (#11536)
* Add default value support to cookie and header params

* Generate Samples

* Replace "OffsetDateTime.parse(..)" with toString();

* Generate Samples

* Revert "Replace "OffsetDateTime.parse(..)" with toString();"

This reverts commit 2e37411b305343e99542c094a691e1419a67b1b5.

* Format java.util.Date to ISO Date in AbstractJavaCodegen.toDefaultParameterValue

* Generate Samples

* Generate Samples

* Use toParameterDefault()

* Generate Samples

* Implement testDateTimeFormParameterHasDefaultValue unit test

* Add more test coverage.

* Remove postProcessParameter() since is has no effect after using toDefaultParameterValue()

* Use LocalDate.parse() in toDefaultValue()

* Generate Samples

* Return a defaultValue only if dateTimeLibrary is java8.
2022-02-12 15:14:26 +08:00
William Cheng
b6c445cdc3
update swagger core, jackson to newer version (#11545) 2022-02-08 13:31:20 +08:00