William Cheng
0dc84520e7
[python-nextgen] use __fields_set__ to determine if the field is needed in to_dict ( #15086 )
...
* use __fields_set__ to determine if the field is needed
* fix tests
2023-04-01 10:23:38 +08:00
William Cheng
1710615fd8
fix python nextgen github workflow ( #15092 )
2023-03-31 22:40:23 +08:00
William Cheng
b59d535176
[python-nextgen] Fix binary response ( #15076 )
...
* fix binary response in python nextgen client
* update samples
2023-03-31 16:16:58 +08:00
William Cheng
05fa5601dd
[python-nextgen] fix circular reference import ( #15070 )
...
* fix ciruclar reference import in python nextgen
* update samples
2023-03-30 10:07:34 +08:00
William Cheng
3ccd9be080
remove absolute_import ( #15071 )
2023-03-30 10:07:15 +08:00
William Cheng
4895b56089
[python-nextgen] fix pattern with double quote ( #15073 )
...
* fix pattern with double quote
* fix test
2023-03-30 10:06:24 +08:00
Shane Perry
0973795996
Added Micronaut configuration points ( #15005 )
...
* Added ability to configure the AuthorizationFilter pattern
* Added configuration for the Client annotation
* Generated samples
* Remove extra newline from template
* Updated samples
* Declarative client annotation path attribute only supported when id attribute is set
* Cleaned up style of generated file
---------
Co-authored-by: Shane Perry <shane.perry@acimacredit.com>
2023-03-29 22:05:41 +08:00
William Cheng
9fa032b365
add isOverridden, update java pojo with setter for parent prop ( #15051 )
2023-03-29 10:57:49 +08:00
RInverid
36332331e4
Skip null form values for Java native request builder ( #15036 )
2023-03-29 10:55:28 +08:00
Mourad
d3de8abc25
Fix typo in api_client.mustache "configuraiton -> configuration" ( #15050 )
2023-03-26 23:40:06 +08:00
William Cheng
a4dd90c01d
Better allOf handling in fromProperty ( #15035 )
...
* fix allOf handling in fromProperty
* add null check, update samples
* update dart generator to handle allof with a single ref
2023-03-26 15:06:27 +08:00
William Cheng
56e5122a6a
Add new openapi-normalizer rule REFACTOR_ALLOF_WITH_PROPERTIES_ONLY ( #15039 )
...
* add new rule REFACTOR_ALLOF_WITH_PROPERTIES_ONLY
* update other attributes
* minor refactoring
2023-03-26 11:56:26 +08:00
CTerasa-ep
f2e05555f3
Refactor ModelUtils methods without logic changes ( #15030 )
...
* Refactor: ModelUtils: Harmonize isIntegerSchema with isStringSchema
Make code isIntegerSchema look similar to isStringSchema and remove
if-clause in favor to bool-OR '||'.
* Refactor: ModelUtils: Simplify isMapSchema
Factor out if sequence and use "return A || B || C;" scheme instead.
* Refactor: ModelUtils: Simplify isUnsignedIntegerSchema
Factor out 'if (x) {return true;} else {return false;}' and use
'return x;' instead.
* Refactor: ModelUtils: Simplify isUnsignedLongSchema
Factor out 'if (x) {return true;} else {return false;}' and use
'return x;' instead.
* Refactor: ModelUtils: Simplify isTypeObjectSchema
Factor out 'if (x) {return true;} return false;' and use
'return x;' instead.
* Refactor: ModelUtils: Simplify isComposedSchema
Factor out 'if (x) {return true;} return false;' and use
'return x;' instead.
* Refactor: ModelUtils: Simplify isBooleanSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isNumberSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isDateSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isDateTimeSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isPasswordSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isByteArraySchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isBinarySchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isFileSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isUUIDSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isEmailSchema
Factor out 'if (x) {return true;} return y;' and use
'return x || y;' instead.
* Refactor: ModelUtils: Simplify isObjectSchema
Factor out 'if (x) {return true;} if (y) {return true;} return z;' and
use 'return x || y || z;' instead.
* Refactor: ModelUtils: Simplify isModel
Factor out 'if (x) {return false;} if (y) {return true;} return z;' and
use 'return !x && (y || z);' instead.
* Refactor: ModelUtils: Simplify isModelWithPropertiesOnly
Factor out 'if (x) {return false;} if (y) {return true;} return false;'
and use 'return !x && y;' instead.
* Refactor: ModelUtils: Simplify getApiResponse
Factor out 'if (x) {return null;} if (y) {return z;} return null;'
and use 'if (!x && y) {return z;} return null;' instead.
* Refactor: ModelUtils: Simplify getParameter
Factor out 'if (x) {return null;} if (y) {return z;} return null;'
and use 'if (!x && y) {return z;} return null;' instead.
* Refactor: ModelUtils: Simplify getCallback
Factor out 'if (x) {return null;} if (y) {return z;} return null;'
and use 'if (!x && y) {return z;} return null;' instead.
* Refactor: ModelUtils: Simplify getHeader
Factor out 'if (x) {return null;} if (y) {return z;} return null;'
and use 'if (!x && y) {return z;} return null;' instead.
* Refactor: ModelUtils: Simplify isExtensionParent
Factor out 'if (x) {return false;} else {y}'
and use 'if (x) {return false;} y' instead.
* Refactor: ModelUtils: Simplify isComplexComposedSchema
Factor out 'if (x) {return true;} return false;' and use 'return x;'
instead.
2023-03-26 10:47:18 +08:00
William Cheng
e925336daf
remove allowStringInDateTimeParameters option ( #15046 )
2023-03-26 10:46:15 +08:00
Oleh Kurpiak
18e28ab761
[Java] maven plugin to clean-up output before generation ( #14935 )
2023-03-25 15:44:40 +08:00
axesider
0677eb5075
Correct check in SetHttpRetryManager ( #15041 )
2023-03-25 15:09:06 +08:00
devhl-labs
ca757b703e
better handling of form parameters ( #15040 )
2023-03-25 15:08:20 +08:00
William Cheng
f5e427ad52
Do not add schema / class name mapping where custom mapping exists ( #14984 )
...
* fix #13150 Do not add schema / class name mapping where custom mapping exists
* update test spec
* improve import
* fix import for mapped models
* fix python
* code clean up
* fix dart client import
* fix dart:core import
* better import
* add tests
---------
Co-authored-by: Bernie Schelberg <bernard.schelberg@mywave.ai>
2023-03-24 22:20:04 +08:00
William Cheng
bde5c10092
update optional parameters in jsdoc ( #15032 )
2023-03-24 18:25:20 +08:00
Oleh Kurpiak
d1f92acaea
[Java][Spring] fix reactive method with only implicit headers ( #15019 ) ( fix #14907 )
2023-03-24 11:32:04 +02:00
Dylan Kwon
b6d2e0d222
Added converterFactories property to ApiClient in jvm-retrofit2. ( #15008 )
...
* Added converterFactories property to ApiClient in jvm-retrofit2.
* [retrofit2] Supplement deprecate contents of converterFactory
* [retrofit2] Supplement deprecate contents of converterFactory
* [retrofit2] converterFactory removed.
* [retrofit2] sample update.
* [retrofit2] Type mismatch fix in Rx.
2023-03-22 15:06:04 +00:00
Kuzma
a601002451
[Typescript] Nullable ( #15026 )
2023-03-22 15:19:17 +01:00
William Cheng
1c75997677
fix optional dict of object ( #15018 )
2023-03-22 02:08:31 +08:00
David Weinstein
fc91fca737
[erlang-client] fix URL paths ( #14988 )
...
* integers parameters in URL did not work as expected
* so now, if the parameter is an integer, we convert it to binary before
passing to `hackney_url:make_url/3`
2023-03-22 00:23:57 +08:00
William Cheng
849708dc0d
better null check in import logic (default codegen) ( #14989 )
2023-03-22 00:13:23 +08:00
William Cheng
cf432522aa
[python-nextgen] fix optional dict in property ( #15009 )
...
* fix optional dict in property
* update samples
2023-03-21 23:59:26 +08:00
William Cheng
88da3649b2
[csharp-netcore] Add option skip generating getter for sub-schemas ( #15007 )
...
* add option skip generating getter for sub-schemas
* fix openapi-yaml
* update samples
* update samples
2023-03-21 22:41:29 +08:00
Dylan Kwon
83ccfb820c
Added useSettingsGradle property in kotlin-client. ( #15003 )
...
* Added useSettingsGradle property in kotlin-client.
* kotlin docs update.
- add kotlinx_serialization in serializationLibrary.
2023-03-21 11:45:35 +00:00
devhl-labs
d24ae6b27a
fixed bug ( #15006 )
2023-03-21 15:44:10 +08:00
William Cheng
b3bfa1ef3b
use Any instead of StrictStr in any type ( #14995 )
2023-03-21 14:52:54 +08:00
William Cheng
e780d59352
add auto-generated api spec file ( #14994 )
2023-03-20 16:58:13 +08:00
Mintas
3ea346e1bb
[SPRING] resolved ambiguous beanValidation Email annotation imports; fix #13379 ( #13962 )
...
* resolved ambiguous beanValidation Email annotation imports; fix #13379
* [Java][Spring] fix email import
---------
Co-authored-by: Oleh Kurpiak <oleh.kurpiak@gmail.com>
2023-03-19 05:18:11 -07:00
César Revert
6e649af9a7
[java-spring] Move JsonProperty annotation from field to getter ( #13781 ) ( fix #5705 )
...
* 5705: Move JsonProperty annotation to the getters
* Regenerate samples
* Add jackson check
* Add test
* Minor fix
* Fix test
* Fix version
* [Java][Spring] update test & samples; add serialization/deserialization test
---------
Co-authored-by: Oleh Kurpiak <oleh.kurpiak@gmail.com>
2023-03-19 04:59:48 -07:00
Tomáš Karásek
aa066ab6fa
[python-nextgen] Fix validation of list of enums ( #14809 )
...
* [python-nextgen] check enum arrady values better
* [python-nextgen] re-generate exapmles for #14809
2023-03-18 20:27:26 +08:00
William Cheng
e1719f2b7b
[JavaSpring] migrate config files to use 3.0 spec ( #14981 )
...
* update spring config file to use 3.0 spec
* migrate spring config file to use 3.0 spec
* update github workflow to cover more samples
2023-03-17 16:02:27 +08:00
devhl-labs
02b6248510
moved null checks ( #14980 )
2023-03-17 15:12:27 +08:00
William Cheng
3d4f7b3ce0
[java] fix optional array property's default value ( #14961 )
...
* fix optional array property default value
* fix default values
* more fixes
* update default value for jersey2, 3, okhttp-gson
* update default value
* fix java okhttp-gson
* fix jersey2, 3
2023-03-17 11:58:49 +08:00
William Cheng
d0f7bd18ba
[spring] fix default value for nullable containers ( #14959 )
...
* fix default value, update spec to 3.0
* add tests for container default value
* update java camel samples
* remove samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable
* remove ./bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml
* remove samples/openapi3/server/petstore/springboot-useoptional
* remove samples/openapi3/server/petstore/springboot-reactive
* update github workflow
* fix default in add, put operation
2023-03-17 10:16:17 +08:00
Riccardo Cardin
e626b43e27
Added a property to the Spring generator to avoid the use of the ResponseEntity
type ( #11537 )
...
* Added the useResponseEntity additional parameter for Spring generator
* Changed the mustache templates using the new useResponseEntity property
* Added the new property to the documentation
* Merging with remote master
* #11537 Added missing configuration for the delegate pattern case
* #11537 Added autogenerated @ResponseStatus on Spring methods
* #11537 Fixed borsch comments
* #11537 Added the default 200 HTTP Status for empty response HTTP code
* [Java][Spring] useResponseEntity sample + remove blank line
* [Java][Spring] useResponseEntity sample + remove blank line
* [Java][Spring] useResponseEntity sample + remove blank line
---------
Co-authored-by: Oleh Kurpiak <oleh.kurpiak@gmail.com>
2023-03-16 14:00:10 +02:00
devhl-labs
9787388f77
removed TryGet from deserialization methods ( #14974 )
2023-03-16 16:49:21 +08:00
devhl-labs
b6ccf078ef
fixed nrt bug ( #14973 )
2023-03-16 08:59:12 +08:00
Peter Lamby
5c4529259f
[BUG][typescript-fetch] wrong response for simple types ( #14659 )
...
See #9364
See #2870
2023-03-15 09:47:34 +01:00
Jason D'Amour
1268b5135d
Enable bearer security schema for Go client ( #14957 )
2023-03-15 14:46:05 +08:00
devhl-labs
388147f822
suffixed variables with LocalVar to avoid conflicts ( #14958 )
2023-03-15 10:58:09 +08:00
martin-mfg
f1d05fc7f8
Allow Java apache-httpclient users to supply additional HTTP headers per call, updated ( #14929 )
...
* Allow Java apache-httpclient users to supply additional HTTP headers per API call
* fix 'unexpected return value' problem
* make "fullJavaUtil" work
* Revert 'make "fullJavaUtil" work'
This reverts commit 60c8846.
---------
Co-authored-by: Jigar Joshi <jigarjm@gmail.com>
2023-03-14 20:20:31 +02:00
igokoro
b172f622b9
Do not use default locale in kotlin generated code ( #14668 )
...
Using default locale for non-user visible text transformations is not safe
and can result in bugs, in particular with Turkish locale.
More details in
https://mattryall.net/blog/the-infamous-turkish-locale-bug
Closes #14667
2023-03-14 16:47:15 +00:00
Christian Mösl
85ff3de157
[java][webclient/resttemplate] fix dependencies for gradle with jakarta ( #14925 )
2023-03-14 17:57:08 +02:00
Oleh Kurpiak
bda2501455
[Java][Spring] option whether to generate required args constructor ( #14941 ) ( fix #14934 )
2023-03-14 10:39:58 +02:00
devhl-labs
dc1386c134
better deserialization ( #14945 )
2023-03-14 11:40:40 +08:00
Guillaume Turri
9fd989e297
[PHP-Symfony] Fixes #14930 ( #14933 )
...
* [PHP-Symfony] fixes validation of date-time parameter
This fixes parts of #14930 .
Without this patch a parameter declared as date-time
is validated against Symfony's "DateTime" constraint,
which always fails. Because this constraint expects
a string with format "Y-m-d H:i:s".
It fails because the generated code performs the check
after the deserialization, so the variable checked is not
a string anymore.
Besides this, even if we performed that validation on the
string, that would not work well because OpenApi
specification expects date-time to conform to RFC 3339
and that "Y-m-d H:i:s" would reject RFC 3339 compliant dates.
With this change we ensure that the string provided by the
web user could be parsed by PHP to DateTime, which solves both issues.
(Note however that it means that it now accepts more formats than just
RFC 3339 compliant ones for those parameters (it would accept all formats
accepted by PHP DateTime). That being said it's compliant with the guideline
""be conservative in what you send, be liberal in what you accept")
* [PHP-Symfony] Fix handling of null date-time parameter
This fixes one of the issue described on #14930 , namely that
the deserializeString method of the generated class JsmSerializer returns null
for other types of string, but not for date-time. Instead it returns a DateTime
which represents "now" (because that what `new DateTime(null)` does).
Consequently when an API declares a date-time parameter as non-required and
when that endpoint is called without that parameters, then the user code
would end up having "now" instead of "null" for this parameter.
2023-03-14 11:17:34 +08:00