1508 Commits

Author SHA1 Message Date
William Cheng
001d9cb36d
better docstring for jersey2 client (#6104) 2020-04-29 23:43:21 +08:00
William Cheng
46216cd796 Merge remote-tracking branch 'origin/master' into 5.0.x 2020-04-28 20:35:28 +08:00
William Cheng
588023686a
Add HTTP signature authentication support to Java (jersey2-experimental) (#6058)
* add fmt-maven-plugin to jersey2 exp

* update samples

* add http signature auth template

* minor fix

* fix http beaer auth, update sample

* fix http signature auth

* fix http signature auth

* header support

* add query string to path

* undo changes in default codegen

* ignore fake test

* add serialize to string method

* add serialzie to string method

* add get mapper

* auto format java source code

* remove plugin

* update pom.xml

* change back AbstractOpenApiSchema to T

* skip mvn code formatter in bin script

* undo changes to spec

* update samples

* add back HttpSignatureAuth.java
2020-04-28 00:09:30 +08:00
William Cheng
3b0bd368a6
Update Java (feign) client dependency (#6068)
* update feign dependency

* update feign samples
2020-04-28 00:09:14 +08:00
Justin Black
8e8471c1fd
[CORE] Fixes composed schema discriminator map (#4906)
* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Switches two methods to package private because they are needed for testing

* Allow nulls in MappedModel.getMappingName

* Updates CLI flag name to legacyDiscriminatorBehavior, default=true

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-25 00:01:02 +08:00
William Cheng
93dd4a5138
Add jersey2-experimental to Java client generator (#6024)
* add jersey2 experimental

* add new files

* add abstract one of class

* read the stream multiple times

* rename to getActualInstance

* update petstore

* fix jackon check

* test new java petstore in ci

* fix broken tests

* remove todo

* better exception message, primitive type handling

* add anyof support

* update samples

* add new files

* update all java client samples

* update doc, fix pom

* better null check for allOf

* add primitive types support in oneof, anyof

* better validation

* update python exp samples

* remove primitive type support in allOf
2020-04-24 12:47:25 +08:00
William Cheng
4ed3421a77 update resttemplate sample 2020-04-23 23:32:47 +08:00
William Cheng
46b0421fa5 update java restassured jackson 2020-04-22 15:36:31 +08:00
William Cheng
47a9294a99 Merge remote-tracking branch 'origin/master' into 5.0.x-sync-master4 2020-04-22 12:15:45 +08:00
Jochen Schalanda
40be1c311e
[Java][Client] Fix Gradle and SBT builds for REST Assured generator (#5990)
* Fix Gradle and SBT builds for Java REST Assured generator

* Add missing jackson-databind-nullable dependency to SBT build

* Update rest-assured sample

* Add sample for Java client with REST Assured and Jackson

* Add new REST Assured sample as Maven sub-module
2020-04-22 11:19:17 +08:00
William Cheng
5a9b0fcf9e update samples 2020-04-21 02:22:55 +08:00
William Cheng
faf6f197be Merge remote-tracking branch 'origin/master' into 5.0-sync-master 2020-04-17 15:51:00 +08:00
William Cheng
747cd087b6
update dependency for java client (#5926) 2020-04-14 20:34:16 +08:00
Sebastien Rosset
8af6b7459c
[Java] Discriminator lookup should not be case insensitive by default (#5894)
* Add 'discriminatorCaseSensitive' property

* Discriminator value lookup should not be case insensitive

* fix typo

* run scripts

* execute ./bin/utils/export_docs_generators.sh

* fix discriminator mapping, add code comments
2020-04-13 18:54:00 +08:00
Sebastien Rosset
d81c244f9a
[Java] Increase java compiler stack size to handle large files (#5901)
* increase java compiler stack size to handle large files

* increase java compiler stack size to handle large files
2020-04-13 13:56:20 +08:00
Chr1st0ph
cc09118ffc
[Java][Feign] Bug fix in @Param annotation (#5250)
* FIX-5249 fix @Param annotation for Feign-client code generation

Use paramName instead of baseName in order to make mapping in @Headers
section fit the param-value.

* update samples

* FIX-5249 fix @Param annotation for Feign-client code generation

Use paramName instead of baseName in order to make mapping in @Headers
section fit the param-value.

Co-authored-by: Christoph Preißner <christoph.preissner@blu-pa.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-13 09:59:35 +08:00
Jochen Schalanda
e82546f342
Update generated build files for REST Assured (#5873)
* REST Assured 4.3.0
* Jackson 2.10.3
* Gson 2.8.6, GSON-Fire 1.8.4
* Okio 1.17.5
* Joda-Time 2.10.5
* ThreeTenBP 1.4.3
* Added missing dependencies for Bean Validation
* Added missing dependencies for `@Generated` annotation
* Refresh REST Assured sample project
2020-04-12 23:36:18 +08:00
Sebastien Rosset
e9d35c5a2a
[Java-client] Add maven-compiler-plugin in pom.xml and enable linter checks by default (#5866)
* Add maven-compiler-plugin plugin in Java pom.xml and enable linter checks by default

* Add maven-compiler-plugin plugin in Java pom.xml and enable linter checks by default
2020-04-11 00:40:27 +08:00
Nicholas Muesch
7efa65164a
Add openapi.yaml file to Java clients (#5765)
* Add openapi.yaml file to Java client

* Move supporting template file to Java root

* Update petstore clients
2020-04-07 16:07:08 +08:00
William Cheng
a0ca253218
update samples (#5722) 2020-03-27 13:55:55 +08:00
Sebastien Rosset
527d5e4248
[Java] Update version of maven-surefire-plugin (#5509)
* use more recent version of maven-surefire-plugin

* use more recent version of maven-surefire-plugin

* higher debug level for troubleshooting ci issue

* temporarily increase debug log to help troubleshoot

* Use local instance of pet store service for unit test purpose

* Add more logging to troubleshoot unit test failures

* Add more logging to troubleshoot unit test failures

* Add more logging to troubleshoot unit test failures

* Add more logging to troubleshoot unit test failures

* Add more logging to troubleshoot unit test failures

* use random ID for Java unit test instead of fixed id

* add code comments and specify URL for java unit test

* reenable quiet argument

* fix java unit test issues

* fix java unit test issues

* Revert "fix java unit test issues"

This reverts commit e8508416ff0f2aeb568e3f916b013dc967390f74.

* fix java unit test issues
2020-03-26 16:47:51 +08:00
Clemens Angermann
e99b3e038a
Adding Response Interceptor (#5500)
* added Response interceptor for native clients

* added Response interceptor for native clients
2020-03-17 16:59:36 +08:00
Sebastien Rosset
b1aecaded0
[Java] fix runtime exception when there are multiple auth methods (#5530)
* fix runtime exception when there are multiple auth methods

* Refactor a bit so that it does not cause conflict with relative url token branch
2020-03-11 01:22:56 +08:00
Sebastien Rosset
6034c09130
[Java] Fix exception when OAuth2 token URL is a relative URL (#5535)
* Add support for case when OAuth2 token URL is a relative URL

* Add support for case when OAuth2 token URL is a relative URL

* run scripts under bin
2020-03-11 01:18:08 +08:00
William Cheng
0ffcbfe75e
update jackson dependency to newer version (#5527) 2020-03-06 14:49:58 +08:00
Jiri Kuncar
a03f7a58c3
[java] Support aliasing of API keys (#4966)
* [java] Support aliasing of API keys

* Rebuild Java Jersey2 sample client

* x-lookup to x-auth-id-alias

* Regenerated
2020-03-01 16:33:18 +08:00
William Cheng
5f547b821f
[Java][WebClient] better code format (#5433)
* better code format for java webclient

* prefix local varaible with localVar
2020-02-27 12:05:03 +08:00
William Cheng
8b64f4d03e update java webclient sample 2020-02-25 18:22:29 +08:00
Igor Savin
734a35a45a
Update maven-javadoc-plugin for Java 11 support (#5361)
* Resolves `An error has occurred in Javadoc report generation: [ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module` error that happens when using Java 11

* Resolves `An error has occurred in Javadoc report generation: [ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module` error that happens when using Java 11

* Fix duplicate configuration entries

* Fix okhttp poms

* Remove letter that shouldn't be there
2020-02-20 00:28:21 +08:00
Jiri Kuncar
a09271e76d
[java] Support templated servers (#4998)
* [java] Support templated servers

* Deprecate old signature of invokeAPI method

* throw ArrayIndexOutOfBoundsException

* Update modules/openapi-generator/src/main/resources/Java/ServerConfiguration.mustache

* [java] Regenerate samples

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-02-19 09:27:45 -05:00
Timo Rohrberg
f5265853ba
[Java][okhttp-gson] Use builder api of OkHttpClient to avoid UnsupportedOperationEx (#5177)
* 3432 Use builder api of OkHttpClient to avoid UnsupportedOperationEx

The reason for the UnsupportedOperationException was an invalid access to the interceptors list of OkHttpClient. That list is unmodifiable as stated by the JavaDoc. Instead accessing the list directly, the interceptors should always be passed when building the client by the builder api.

* 3432 Use builder api of OkHttpClient to avoid UnsupportedOperationEx

The reason for the UnsupportedOperationException was an invalid access to the interceptors list of OkHttpClient. That list is unmodifiable as stated by the JavaDoc. Instead accessing the list directly, the interceptors should always be passed when building the client by the builder api.

* 3432 Follow-up fix to make samples compile again

* 3432 Updated sample implementation for okHttp-Gson-ParcelableModel
2020-02-13 21:55:10 +08:00
gaetPax
b6b7284e4c
[Java] update feign form dependency version (#5179)
* [Java-Feign-issue 5173] - update feign form dependency version

* [Java-Feign-issue 5173] - updated feign versions in sample project

* [Java-Feign-issue 5173] - fix OAuth in Feign10 sample

* [Java-Feign-issue 5173] - updated OAuth Feign template

* update feign samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-02-05 23:10:16 +08:00
William Cheng
100b01844a Merge remote-tracking branch 'origin/master' into 5.0.x 2020-02-04 15:31:10 +08:00
Ben Cox
fbcb8e0c7e
[java-jersey2] Fix empty body when form parameters supplied (#5169) 2020-02-03 17:11:59 +08:00
William Cheng
03a59046f4 Merge remote-tracking branch 'origin/4.3.x' 2020-01-31 19:00:28 +08:00
Jim Schubert
607f5a1c0a
[core] Move overwrite ownership to SupportingFile (#5036)
* [core] Move overwrite ownership to SupportingFile

Previously, there was a writeOptional method in DefaultCodegen which
allowed *Codegen instances to immediately write out a supporting file if
it did not exist. This would allow a codegen implementation to skip
user-facing options such as definitions in .openapi-codegen-ignore, the
"supportingFiles" system property, and support for the experimental
handlebars templating engine. While our implementation only modified the
supportingFiles list conditionally, it added confusion as it seemed to
imply that file writes were somewhat the responsibility of
DefaultCodgen (it's DefaultGenerator which handles file manipulation).

This commit moves the definition of whether a file supports overwriting
existing files into the SupportingFile type itself, allowing that
functionality to be determined at time-of-write rather than
time-of-definition. This would allow us, for example, to dump the list
of files which would be generated using a --dry-run option or similar.

This will be a breaking change for anyone who has extended
DefaultCodegen and called "writeOptional". The path to migrate is to add
the SupportingFile to the supportingFiles list and chain the method call
`.doNotOverwrite()` on the instance.

This has the added benefit of clarifying this behavior, considering the
write behavior wasn't previously "optional" writes but optionally
defining the list of supportingFiles based on the state of the file
system.

* [samples] Regenerated
2020-01-29 18:26:39 -05:00
Slavek Kabrda
a42ff37a42 [java][client] oneOf support for jackson clients (#5120) 2020-01-27 08:23:20 -05:00
dependabot[bot]
fc4563baef Bump spring-webflux from 5.0.8.RELEASE to 5.1.0.RELEASE in /samples/client/petstore/java/webclient (#5071)
* Bump spring-webflux in /samples/client/petstore/java/webclient

Bumps [spring-webflux](https://github.com/spring-projects/spring-framework) from 5.0.8.RELEASE to 5.1.0.RELEASE.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.0.8.RELEASE...v5.1.0.RELEASE)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump spring-webflux version from 5.0.8 to 5.0.16

ref https://pivotal.io/security/cve-2020-5398

Co-authored-by: Akihito Nakano <sora.akatsuki@gmail.com>
2020-01-22 17:00:52 +08:00
William Cheng
82e2448bf2 Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2020-01-20 15:46:13 +08:00
William Cheng
04af5e0445 Merge remote-tracking branch 'origin/master' into 4.3.x 2020-01-20 15:04:34 +08:00
Sebastien Rosset
d61dcc17e0 [gradle] consistent use of maven url in gradle files (#5045)
* wrap maven url with uri function

* consistent use of maven url in gradle files
2020-01-19 14:57:38 -05:00
Jim Schubert
ea55968737
Evaluating https issues in CircleCI (on top of CiscoM31-maven-h… (#5034)
* replace http with https. Replace http://central.maven.org with https://repo1.maven.org

* replace http://www.apache.org/licenses/LICENSE-2.0 with https://www.apache.org/licenses/LICENSE-2.0

* Force HTTPS for mavenCentral gradle DSL

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2020-01-18 18:53:05 -05:00
William Cheng
d1948c4b41
better code format in java jersey doc (#5031) 2020-01-18 19:11:51 +08:00
Nicholas Muesch
2722c602ac Escape query params before invoking api (#5023)
* Escape query params before invoking api

* Update petstore file

* Update remaining petstore examples
2020-01-18 17:25:18 +08:00
Hippolyte HENRY
ee984c38a5 [Java][jersey2] Use builder pattern for requests (#4666)
* Use builder pattern for requests

* petstore

* Add @throws annotation

* regenerate jersey2 test files

* Also group bodyParam in builder class

* petstore java6

* regenerate java8

* ensure up to date
2020-01-18 16:12:20 +08:00
Jim Schubert
78bf3adc4a
[core] Initial FeatureSet structures and definitions (#3614)
[core] Initial FeatureSet structures and definitions
Add default feature set to DefaultCodegen
Initial FeatureSet definitions for:

*  ada 
*  android 
*  apache2 
*  asciidoc 
*  aspnetcore 
*  avro 
*  bash 
*  c 
*  clojure 
*  cpp-pistache-server 
*  cpp-qt5-client 
*  cpp-qt5-qhttpengine-server 
*  cpp-restbed-server 
*  cpp-restsdk 
*  cpp-tizen 
*  csharp 
*  csharp-nancyfx 
*  csharp-netcore 
*  cwiki 
*  dart 
*  eiffel 
*  elixir 
*  elm 
*  erlang 
*  flash 
*  fsharp-functions 
*  go  Client/Server
*  graphql-nodejs-express-server 
*  graphql-schema 
*  groovy 
*  haskell 
*  haskell-http-client 
*  java 
*  jmeter 
*  kotlin 
*  kotlin vertx 
*  kotlin-server 
*  kotlin-spring 
*  lua 
*  mysql 
*  nim 
*  nodejs 
*  nodejs-express 
*  objc 
*  ocaml 
*  openapi 
*  openapi-yaml 
*  perl 
*  php 
*  php-laravel 
*  php-lumen 
*  php-silex 
*  php-slim 
*  php-symfony 
*  php-ze-ph 
*  powershell 
*  protobuf 
*  protobuf-schema 
*  python 
*  python-aiohttp 
*  python-blueplanet 
*  python-experimental 
*  r 
*  ror 
*  ruby 
*  ruby 
*  ruby-sinatra 
*  rust 
*  scala-akka 
*  scala-finch 
*  scala-gatling 
*  scala-http-client 
*  scala-lagom 
*  scala-play 
*  scalatra 
*  scalaz 
*  spring 
*  static docs 
*  swift 
*  typescript
2020-01-11 16:20:47 -05:00
Jérémie Bresson
e675360b9e [java][client] jackson update (#4907)
* [java][client] update jackson-databind-version to 2.10.1

* [java][client] update jackson-version to 2.10.1

* Update samples

* [google-api-client] add missing generic parameter to fix compile error

* Update samples
2020-01-03 11:03:12 +08:00
Bruno Coelho
9d53ee4b69 [kotlin][client] make Request date converter toJson as default (#4884)
* Fix for Issue #2205

Because when we have tags on OpenAPI Specification, there can be more than 1 Feign Beans being generated and the title field is share by all the clients. This makes the code to stop working in runtime.
Here is a PR which uses the classVarName instead, which follows the standards and should be enough to solve this issue.

For more info please refer to: https://github.com/OpenAPITools/openapi-generator/issues/2205

* fix java feign parameter request name (#4883)

* update sprign cloud feign sample

* [JAVA][SPRING][2195] added missing getter for enum value (#2346)

* [2195] added missing getter for enum value

* updated samples

* re-generate spring samples

* Removed @JsonValue from toString and regenerated samples

* re-generate spring samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* update samples

* [kotlin][client] make Request date converter toJson as default

* [kotlin][client] update windows scripts

* [kotlin][client] update docs

* [kotlin][client] update scripts

* [kotlin][client] update scripts

Co-authored-by: Filipe Manuel Couto Pinheiro <filipemcpinheiro@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Lukáš Vasek <bilaak@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-01-02 13:46:49 +08:00
sullis
178a3e24bd upgrade to JUnit 4.13 (#4899) 2020-01-02 13:20:29 +08:00
William Cheng
85f43a3000
fix java feign parameter request name (#4883) 2019-12-29 14:55:08 +08:00