1508 Commits

Author SHA1 Message Date
William Cheng
5f5a83a592
fix enum name in okhttp-gson-nextgen (#11210) 2022-01-02 16:37:16 +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
William Cheng
b72eba90cd
[java][okhttp-gson-nextgen] better oneOf implementation (#11146)
* add validJsonObject method

* add check for null

* fix list model generation

* fix optional fields validation

* add tests

* fix variable naming

* update tests

* add fromJson in oneOf, add tests

* convert JSON to static

* remove trailing space

* add fromString methods to all models

* add toJson, fix anyOf template

* remove workarounds

* undo changes to tests

* skip file schema test

* add new file
2021-12-18 23:22:55 +08:00
William Cheng
b2daa5a836
update jackson-databind-nullable to 0.2.2 (#11121) 2021-12-15 11:41:16 +08:00
William Cheng
e5d58a35a2
update dependencies to newer versions (java) (#11116) 2021-12-14 18:32:37 +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
550c0781dc
[okhttp-gson-next-gen] new option for error object (#10995)
* add error body and type to api exception class

* add option to specify error object

* add option, update api doc with better error handling

* update samples

* update doc
2021-12-10 02:08:17 +08:00
William Cheng
2ff6f833e2
add more tests for oneOf (#11068) 2021-12-08 09:39:42 +08:00
William Cheng
a489a2e828
[java][okhttp-gson-next-gen] better error message in oneOf/anyOf (#11059)
* better error message

* update tests
2021-12-07 21:38:54 +08:00
William Cheng
192126be6b
[java][okhttp-gson-next-gen] fix serialization, add tests (#11057)
* fix serialization, add tests

* add new files
2021-12-07 16:22:46 +08:00
William Cheng
000a18d3b9
[java][okhttp-gson-nextgen] Better null handling in oneOf, anyOf model (#11056)
* better null handling in oneOf model

* update anyof with better null handling

* add null test
2021-12-07 15:11:06 +08:00
William Cheng
0eec937845 update samples 2021-12-07 00:28:43 +08:00
William Cheng
e00efe7c8d Merge remote-tracking branch 'origin/5.4.x' into 6.0.x 2021-12-07 00:12:13 +08:00
William Cheng
676da0e778 update samples 2021-12-07 00:11:40 +08:00
William Cheng
2b7910c875 Merge remote-tracking branch 'origin/master' into 5.4.x 2021-12-06 23:57:07 +08:00
William Cheng
a745f053bd
skip custom adapter for parent object (#10998) 2021-12-01 14:20:39 +08:00
William Cheng
b061bd2146
[Java][Okhttp] Add oneOf support (#10875)
* add custom gson deserializer

* add check for additional fields, required fields

* add tests for custom deserializer

* add custom adapter

* add custom adapter

* register type adapter factory

* comment out custom deserializer and use adapter instead

* add okhttp-gson-nextgen

* add new files

* restore okhttp-gson

* switch to adapter

* remove custom de/serializer

* add comment

* update tests

* test nextgen in ci

* update doc

* use full model name in JSON.java

* undo changes

* add oneof discriminator support

* fix anyOf

* remove mappings

* add more tests

* fix oneof deserialization, add more tests

* add error body and type to api exception class

* JSON to use instance variables/methods

* Revert "add error body and type to api exception class"

This reverts commit 07f34e2c450ad9f808b728173018b1e4d8fed458.
2021-11-30 15:33:42 +08:00
Kevin Chen
3d92df5a41
[Java][okhttp-gson] Support text/plain body (#10885)
* support serialize RequestBody with contentType text/plain

* add Serialize test

* update test comment
2021-11-26 15:04:19 +08:00
Berlin Cho
8e303150ae
[Java][resttemplate] Support URL queryParams Comma encoding (#10958)
* Java Encode comma (with unit tests)

* fix PMD warnings
2021-11-25 16:12:55 +08:00
Steve Mason
5bd0452893
[Java][Native] Drain InputStream when no response is being read (#10956)
The [docs for ofInputStream](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodySubscribers.html#ofInputStream()) say:

> To ensure that all resources associated with the corresponding exchange are properly released the caller must ensure to either read all lines until the stream is exhausted, or call BaseStream.close() if it is unable or unwilling to do so. Calling close before exhausting the stream may cause the underlying HTTP connection to be closed and prevent it from being reused for subsequent operations.

When ObjectMapper.readValue is called with an InputStream it implicitly closes it, but when the library is not expecting a return type it's not passing the InputStream to Jackson, so the stream needs to be manually drained and closed as per the docs

Failure to do this leads to a leak of HttpClient socket handles, and ultimately the exception `java.net.BindException: Cannot assign requested address` when trying to make API calls
2021-11-25 14:44:57 +08:00
AJ Rice
08eaafa871
Add operation level servers support for java okhttp-gson client (#10925)
* Add Operation Servers to {operation}Call method

* add getter/setter methods

Add methods for hostIndex and customBaseUrl

* Fix return types for getters

* Add custom baseUrl logic

if you dont specifically declare a custom base url using the set method then it uses the 1st server in the operation host index array

if no custom url is set and the operation base path array is empty however, the call throws an exception

* Update server selection logic

First checks to see if a custom url is provided

If not, checks to see if operation level server is defined and uses the supplied host index (default 0)

If neither is supplied, uses the ApiClient default base path

* Update samples and docs
2021-11-25 14:17:50 +08:00
WILLIAM CHENG
c619f7fd63 fix java okhttp oauth test 2021-11-21 11:29:00 +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
William Cheng
e44c69dab1
fix outdated link, improve docstring (#10870) 2021-11-17 11:17:48 +08:00
William Cheng
3c26f9f2b4
[Okhttp] fix warnings and better docstrings for constructors (#10859)
* surpress serial warning

* better docstrings in api client java class
2021-11-15 17:49:27 +08:00
William Cheng
c06a21e638
update authentication to include more parameters (#10858) 2021-11-15 16:34:27 +08:00
Oleh Kurpiak
e7c3bdacc2
[Java] fix deserialization of readonly properties (#10113)
* [Java] fix deserialization of readonly properties

* [Java] fix deserialization of readonly properties

* [Java] fix deserialization of readonly properties

* [Java] fix deserialization of readonly properties
2021-11-14 22:05:25 +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
Vincent Galloy
955aadc284
10788: ApiClient for resttemplate should not produce warning (#10789)
Motivation:

Remove useless warnings for webclient and resttemplate
2021-11-09 14:38:57 +08:00
William Cheng
3284fc2f7e
skip spotless as part of the check task (#10797) 2021-11-06 18:50:38 +08:00
William Cheng
bd1a6471b6
[java][Jersey2] add spotless maven, gradle plugins (#10796)
* add bunker-holding logo

* add spotless plugin to jersey2 java client

* add spotless plugin to java jersey2 client

* use jdk11 in gradle tests

* fix gradle test local spec

* setup java 11

* skip spotless in check task
2021-11-06 18:11:58 +08:00
William Cheng
a73363fd53
[java][okhttp] Add spotless maven, gradle plugin (#10785)
* add spotless maven plugin

* add spotless gradle plug-in

* add spotless version
2021-11-05 17:48:14 +08:00
William Cheng
4ecceb13ea
[Java][okhttp] remove default content-type in the request (#10769)
* remove default content-type in java okhttp client

* update smaples

* update tests
2021-11-04 10:19:13 +08:00
William Cheng
9d1420dc94
fix bug in query collection parameters (#10768) 2021-11-03 22:13:33 +08:00
William Cheng
48f81eef45
use IllegalArgumentException instead (#10745) 2021-11-02 12:47:15 +08:00
WILLIAM CHENG
4f2b5ee36d Merge remote-tracking branch 'origin/5.4.x' into 6.0.x 2021-11-01 00:54:44 +08:00
WILLIAM CHENG
ab603a7322 Merge remote-tracking branch 'origin/master' into 5.4.x 2021-11-01 00:49:06 +08:00
William Cheng
9546a5a61b
[Java][okhttp] better docstring (#10741)
* better docstring in api client, exception, response

* more docstring update
2021-11-01 00:47:32 +08:00
William Cheng
68b5f866ff
update readme with better gradle instruction (#10740) 2021-10-31 23:10:46 +08:00
William Cheng
8551b0af49
[java][jersey2] remove warning using JsonMapper.builder (#10734)
* remove warning usign JsonMapper.builder

* add back java8 tag
2021-10-30 16:55:33 +08:00
William Cheng
c3740dd647
update scribejava to 8.x (#10733) 2021-10-30 14:42:48 +08:00
William Cheng
2b2838325c
[java][okhttp-gson] update dependencies in pom.xml (#10709)
* update okhttp-gson pom dependencies

* update samples

* remove jar
2021-10-29 12:36:52 +08:00
William Cheng
d75683aeae
[java][jersey2] update plugins in pom.xml (#10710)
* update jersey2 plugin

* remove jar
2021-10-29 12:36:40 +08:00
Martin Visser
59d5851797
Fix library generation compatibility with Gradle 7.2 (#10716)
* Make Java libraries compatible with Gradle 7

* Make kotlin-spring compatible with Gradle 7

* Update samples to comply to Gradle 7.2

* Generate samples
2021-10-29 12:36:12 +08:00
William Cheng
1c38bfd5a0
update microprofile to newer version (#10714) 2021-10-27 23:42:46 +08:00
Maximilian Zellhofer
6bbafdfa30
Allow specification of configkey for microprofile clients (#10693) 2021-10-27 14:28:17 +08:00
WILLIAM CHENG
3594b3452d Merge remote-tracking branch 'origin/5.4.x' into 6.0.x 2021-10-25 13:31:12 +08:00