282 Commits

Author SHA1 Message Date
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
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
768795648e add new files 2022-01-17 11:06:09 +08:00
William Cheng
33bce99b8e
Avoid using import mapping in model generation (#11217)
* remove import mapping logic in model generation, better handle of file, list

* add new files for file, list

* fix some tests

* update tests, doc

* skip file as reserved word in feign client

* add new files

* remove file from reserved word list in spring generator
2022-01-16 23:57:53 +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
S2021Git
6848c229f7
[JAVA]Add additional check for openapiDocketConfig in SpringCodegan.java (#10853)
* updated SpringCodegan

* added test case for SpringCodegen change

* update samples

* updated test Javadoc
2021-11-21 01:35:32 +08:00
Oleh Kurpiak
3bdbf0339a
[Java] deserialize to LinkedHashSet when unique items (#10241)
* [Java] deserialize to LinkedHashSet when unique items

* [Java] fix deserialization of readonly properties

* [Java] deserialize to LinkedHashSet when unique items
2021-11-14 22:03:02 +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
0bfa28f844 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-10-06 12:00:02 +08:00
RomainPruvostMHH
1735ab9d27
[Java] Replace Java EE 8 dependencies by Jakarta EE 8 (#10513)
* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5

* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5 for sbt

* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5 for gradle

* Commit samples files after the execution of the command
"generate-samples.sh for configs java and kotlin

* Delete org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec
from the exclusion section of org.jboss.resteasy:resteasy-client in the
resteasy module because jboss-annotations-api_1.2_spec isn't a
transitive dependency

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for maven

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for gradle

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for sbt

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.ws.rs:javax.ws.rs-api to
jakarta.ws.rs:jakarta.ws.rs-api:2.1.6 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.json.bind:javax.json.bind-api to
jakarta.json.bind:jakarta.json.bind-api:1.0.2 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.json:javax.json-api to jakarta.json:jakarta.json-api:1.1.6
for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.xml.bind:jaxb-api to
jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.el:el-api to jakarta.el:jakarta.el-api:3.0.3 for maven

* Migrate javax.servlet:servlet-api to
jakarta.servlet:jakarta.servlet-api:4.0.4 for maven

* Delete the property servlet-api-version in pom files because it is
useless

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.activation:activation to
jakarta.activation:jakarta.activation-api:1.2.2 for maven

* Delete javax.activation:activation from the exclusion section of
org.jboss.resteasy:resteasy-client in the resteasy module because
javax.activation:activation isn't a transitive dependency

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Fix the name of property jakarta.activation-version

* Fix a missing property 'jakarta-annotation-version' in
JavaJaxRS/resteasy/pom.mustache

* generate samples

* Fix version value of jakarta.validation-api artifact in
Java/libraries/rest-assured/pom.mustache

* Fix missing property jakarta-annotation-version in
jaxrs-resteasy/eap/pom.mustache

* generate samples

* Revert changes in sample files after running the command
generate-samples.sh in gitBash

* Fix files in
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8

* Replace the old dependency javax.validation:validation-api by the new
Jakarta EE 8 jakarta.validation:jakarta.validation-api in
openapi-generator-online

Co-authored-by: rpruvost <rpruvost@ITEM-S78402.emea.msad.sopra>
Co-authored-by: rpruvost <romain.pruvost@soprasteria.com>
2021-10-05 09:47:29 +08:00
William Cheng
0357b80f19 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-01 14:16:17 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
Artem
2d239271e5
#10264 fix spaces in signatures (#10265)
* TAP-198 fix spaces in spring java

* update samples
2021-08-28 22:57:08 +08:00
fvlad
bf57d58db1
Move Java Spring Springfox ApiIgnore under conditions (#9644)
* Remove SpringFox @ApiIgnore imports and reference class directly

* Update generated sources

Co-authored-by: Vladislav Fefelov <vladislavf@playtika.com>
2021-08-25 10:17:29 +08:00
William Cheng
0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3ed f8ff8c87609
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c87609b1ca36fa26fb8474806999638195e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709d6a3f846a9fe4520b78c3d637051d9
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e2333f3ae19ef6fc89318b7e263a80c
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f48227d55531b94e307d72671373737
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722c34aa094b4aeb11c22664529c3a219
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e3594bf0d30e580bc9408e45b018a57
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +08:00
William Cheng
eaa76f8e1f Merge remote-tracking branch 'origin/master' into 6.0.x 2021-08-17 18:10:59 +08:00
William Cheng
764a462711 Merge remote-tracking branch 'origin/5.3.x' 2021-08-16 21:38:34 +08:00
William Cheng
8403e59aa0
Prepare 5.2.1 release (#10161)
* prepare for 5.2.1 release

* update samples
2021-08-16 19:08:29 +08:00
Oleh Kurpiak
b1cc7445a0
[Java][Spring] fix Spring RequestMapping (#9900) 2021-07-27 14:27:47 +08:00
William Cheng
05e4c3cf64 update samples 2021-07-12 17:15:22 +08:00
William Cheng
35f933b27f Merge remote-tracking branch 'origin/5.3.x' into 6.0.x 2021-07-12 17:11:35 +08:00
William Cheng
39fbf53150 create v5.3.0 2021-07-10 00:12:23 +08:00
William Cheng
02835b35bc
Prepare v5.2.1 (#9922)
* bump verions to 5.2.1-SNAPSHOT

* update samples

* update readme

* fix gradle properties
2021-07-09 22:42:31 +08:00
William Cheng
90f7bcd909
Prepare v5.2.0 release (#9920)
* 5.2.0 release

* update samples

* update meta codegen
2021-07-09 17:06:55 +08:00
agilob
b1cba96627
Revert "[Java][Spring] Fix for #8659 - Different in-parameter types generated for api and delegate for files (#9331)" (#9555)
This reverts commit b9a1c8f016711307b9c718dbbdf60a137372c7af.
2021-05-23 22:59:51 +08:00
William Cheng
3e58b0908c Merge remote-tracking branch 'origin/5.2.x' into 6.0.x 2021-04-28 18:08:24 +08:00
William Cheng
37eaf70755 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-04-28 17:48:21 +08:00
Mateusz Hubert Stefaniak
b9a1c8f016
[Java][Spring] Fix for #8659 - Different in-parameter types generated for api and delegate for files (#9331) 2021-04-26 09:49:21 +08:00
William Cheng
95d356ab6b Merge remote-tracking branch 'origin/5.2.x' into 6.0.x 2021-03-21 01:10:46 +08:00
William Cheng
47483e60cb update version to 5.2.0-SNAPSHOT, update samples 2021-03-21 00:10:10 +08:00
William Cheng
0dc62e8b79
Prepare v5.1.1 in the master (#9027)
* Prepare v5.1.1 in the master

* move dart dio next to configs/other
2021-03-20 23:05:11 +08:00
William Cheng
e023eaa821
Prepare v5.1.0 release (#9017)
* prepare v5.1.0 release

* update samples (dart-dio-next)
2021-03-20 16:45:05 +08:00
Ajith Kumar
9ea852d4df
[JAVA] [Spring] Conditionally importing spring pageable (#8915)
* [JAVA][SPRING] Making spring pageable import optional

* [JAVA][SPRING] Regenerating samples

* [JAVA][SPRING] Regenerating samples again
2021-03-18 00:03:31 +08:00
Oleh Kurpiak
cfe86d9594
[Java][Server] fix default value (#8577)
* [Java][Server] fix default value

* [Java][Server] fix default value
2021-03-15 21:25:48 +08:00
William Cheng
694b10e41c Merge remote-tracking branch 'origin/5.1.x' into 6.0.x 2021-01-28 16:47:55 +08:00
William Cheng
d97717ee24 Merge remote-tracking branch 'origin/master' into 5.1.x 2021-01-28 15:52:44 +08:00
Chris Coltsman
a2a88cb8f0
Spring codegen - fix equals and hashCode methods for byte array and binary (#8345)
* Spring codegen - fix equals and hashCode methods for byte array and binary

- they should be compared using Arrays.equals
- they're hash code generated using Arrays.hashCode

* Corrected checkstyle issues

* Revert changes for binary types
2021-01-28 13:04:03 +08:00