2070 Commits

Author SHA1 Message Date
Oleh Kurpiak
fb2c41c720
[Java] implicit headers regex (#11819) 2022-03-10 10:49:52 +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
Juha Syrjälä
23e44abda3
Fix jaxrs-spec to run with JDK 17 (#11798)
JDK17 is missing class `javax.annotation.Generated`.

Add javax.annotation:javax.annotation-api 1.3.2

Fixes https://github.com/OpenAPITools/openapi-generator/issues/11795
2022-03-05 14:21:05 +08:00
Oleh Kurpiak
3656ec5260
[Java] remove samples & replace them with file asserts (#11773) 2022-03-03 19:58:03 +08:00
Antoine Reilles
a5952bfb10
[jaxrs-cxf-cdi] mark deprecated api methods (#11755)
In the generated java code, it is usefull to have the generated java api
use the @Deprecated annotation. This enable to leverage this annotation
at runtime to trigger specific logging for instance.

In the generated interface, use the @Deprecated annotation.
Also, in the jax-rs implementation that links the jax-rs api with the
cdi bean implementing the interface, use the
@SuppressWarnings("deprecation") annotation. This way the deprecation
warning is not shown in generated code.

One can use the interface as before: the java compiler can then tell
which implementations do implement a deprecated api, using a warning.
If the implementation itself also sets the @Deprecated annotation, then
there is no warning, unless the implementation is called at another
place in the code.
2022-03-02 00:17:11 +08:00
William Cheng
319ccbd138 update samples 2022-02-27 15:52: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
sullis
f1d0724f2a
[java] junit 4.13.2 (#11733) 2022-02-27 13:18:19 +08:00
William Cheng
0e14afc952
fix maven-wrapper.properties filename typo (#11727) 2022-02-26 14:36:33 +08:00
Jean-François Côté
7bda4734e6
Fix sonarqube warnings / code smells from the generated code. (#11702) 2022-02-24 11:07:19 +08:00
Bernhard Danecker
182fe9370e
[Java][Spring] fix unhandledException not working in combination with… (#9879)
* #4393 fix unhandledException not working in combination with skipDefaultInterface

* generate samples
2022-02-23 16:11:18 +08:00
William Cheng
df05e6f4bc
Update parser to 2.0.29 (#11388)
* update parser to 2.0.29

* better handling of null in dereferencing

* update parser to 2.0.30

* update core to newer version

* add new files

* rollback to previous stable version

* remove files

* Fixes for python-experimental NullableShape component

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2022-02-21 18:37:52 +08:00
sullis
4361790332
[java] jaxrs swagger-core 1.6.5 (#11668) 2022-02-20 21:46:34 +08:00
sullis
c5745f8d72
[java] jersey 2.35 (#11661) 2022-02-20 11:12:55 +08:00
sullis
3c8f249c6c
[java] logback 1.2.10 (#11659)
Latest version of logback
https://logback.qos.ch/news.html
2022-02-19 18:52:39 +08:00
William Cheng
3a119b9cff
Add tests for Aspnet 6, minor bug fixes (#11663)
* add tests for aspnet core 6

* bug fix, update samples
2022-02-19 18:46:38 +08:00
William Cheng
6d9e349721
Update kotlin vertx server dependencies (#11631)
* update kotlin vertx dep to newer versions

* update kotlin to newer version
2022-02-17 19:45:31 +08:00
William Cheng
c7367c2d34
[kotlin] add missing import, better code format for kotlin generators (#11619)
* add missing import, better code format for kotlin generators

* update kotlin workflow

* more kotlin tests

* better code format

* separate kotlin client, server teets

* comment out tests
2022-02-16 15:09:51 +08:00
Sergey Vladimirov
d0d0a0505e
Support email validation in kotlin-spring (#11617) 2022-02-16 13:34:11 +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
cachescrubber
00e23490bd
Decomission threetenbp support. (#11608) 2022-02-15 09:39:30 +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
William Cheng
73ed743818 update samples 2022-02-14 10:57:13 +08:00
William Cheng
d481aa3af4
Test Java Play framework in Github action (#11598)
* test play framework in github action

* trigger build

* add pom.xml

* revert readme
2022-02-13 19:23:11 +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
Oleh Kurpiak
25270a0389
[Java] fix deserialization of readonly properties (#11495) 2022-02-12 15:23:29 +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
4f0c07ff3c update java-vertx-web version to 4.2.4 2022-02-12 15:08:47 +08:00
Sean Brown
7bdf04db70
[java][vertx] moved HttpStatusException (vertx internal) to HttpException (public) (#11550)
* Update apiImpl.mustache

Vertx has moved HttpStatusException (vertx internal) to HttpException (public)

https://github.com/vert-x3/wiki/wiki/4.1.0-Deprecations-and-breaking-changes#iovertxextwebhandlerimplhttpstatusexception

* Update java vertx server verx version

Co-authored-by: Sean Brown <sbrown@axon.com>
2022-02-12 15:02:59 +08:00
Sergio del Amo
fbf4e56281
update micronaut to 3.3.1 (#11569) 2022-02-12 14:51:20 +08:00
William Cheng
25b55c8c2e
remove jdk 6 support (#11558) 2022-02-10 11:24:40 +08:00
William Cheng
3cb4b7d08e
[Java] remove tabs from java templates (#11557)
* remove tabs from java templates

* replaces tabs with spaces in java templates
2022-02-10 10:47:08 +08:00
William Cheng
8455c1cd23
Remove the option to support JDK7 from Java generator and templates (#11547)
* remove java8 from java client generator and templates

* update tests

* remove threetenbp

* update spring templates to remove java8

* remove java8 from jaxrs template

* fix jaxrs spec

* fix feign

* remove CustomInstantDeserializer.java

* fix jersey1

* fix undertow

* various update

* fix jaxrs jersey1

* fix java inflector

* fix jaxrs cxf

* add new files

* update doc
2022-02-10 10:35:29 +08:00
William Cheng
b6c445cdc3
update swagger core, jackson to newer version (#11545) 2022-02-08 13:31:20 +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
Armel Soro
ed14ce4dec
[Kotlin] Use mutable container types when 'modelMutable' is enabled (#11154)
* [Kotlin] Use Mutable container types when 'modelMutable' is enabled

* Generate sample 'kotlin' project with mutable models

* Generate sample 'kotlin-server' project with mutable models

* Generate sample 'kotlin-vertx' project with mutable models

* Generate sample 'ktorm-schema' project with mutable models

Co-authored-by: Bruno Coelho <4brunu@users.noreply.github.com>
2022-01-30 12:06:03 +00:00
William Cheng
c8b84c4d03 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-30 18:01:35 +08:00
William Cheng
8b017bc855
mark csharp-nancyfx generator as deprecated (#11454) 2022-01-30 15:53:27 +08:00
Antti Leppä
7dad57c8b6
[kotlin-server][jax-rs] Added support for JAX-RS library into Kotlin Server generator (#10830)
* Added templates for Kotlin JAX-RS server

* Fixed Kotlin Server JAX-RS template directory

* Added support for Kotlin Server JAX-RS library

* Added support using coroutines with Kotlin server JAX-RS library

* Added sample for Kotlin server JAX-RS library

* Added support for returnResponse option into Kotlin server JAX-RS library

* Fixed issue with optional parameters in Kotlin JAX-RS spec

* Fixed oneOf issue in Kotlin jaxrs-spec generator

* Added better documentation to Kotlin Server JAX-RS options

* Updated kotlin-server.md

* Updated kotlin-server jaxrs-spec samples

* Fixed issue with Kotlin JAX-RS spec and reserved names

* Regenerated samples
2022-01-29 10:37:51 +08:00
William Cheng
27d322de56
fix isArray, isMap tag in jaxrs spec templates (#11424) 2022-01-27 21:14:50 +08:00
William Cheng
604c1c0806
update jaxrs cxf, resteasy dependencies (#11414) 2022-01-26 16:23:41 +08:00
William Cheng
adcf04c63b
update jaxrs junit to newer version (#11410) 2022-01-26 15:40:24 +08:00
William Cheng
2ebadc36f7
update undertow dependencies (#11411) 2022-01-26 14:54:32 +08:00
Andriy Dmytruk
a0dd025c82
Add Micronaut server generator (#10270)
* Add micronaut server implementation

* Add micronaut server tests and imporovements

* Generate samples, docs and verify that tests pass

* Update micronaut docs and samples after merging with master

* Update micronaut dev server samples

* Add micronuat server docs

* Update micronaut version

* Minor changes to micronaut server and client

* Fix documentation generation in samples

Co-authored-by: Andriy Dmytruk <andriy.dmytruk@andriy.dmytruk.ca.oracle.com>
2022-01-26 13:51:19 +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
Ananta Dwi Prasetya Purna Yuda
0cb88ce024
[KOTLIN] add modelMutable additional properties parser (#11332)
* [kotlin] add modelMutable parser

* [kotlin] fix kotlin vertx samples
2022-01-18 11:39:29 +00: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