5759 Commits

Author SHA1 Message Date
Andriy Dmytruk
4cac09324e
[Micronaut] [Server] Add support for security roles with extension (#11995)
* Minor refactor for Micronaut generators

* Add support for security roles in micronaut server generator

* Micronaut Server Generator refactor the x-roles String variable
2022-03-29 10:20:25 +08:00
mkusaka
21c399f2b8
[typescript-fetch] Add stringEnums option (#11976)
* [typescript-fetch] add stringEnums option

* [typescript-fetch] add docs & samples

* [typescript-fetch] update samples

* [typescript-fetch] support 3.4 or lower version

* [typescript-fetch] update samples
2022-03-28 10:51:33 +02:00
Yuriy Belenko
956ad2aecc
[php] Fix JSON object deserialization (#8481)
* Fix JSON object deserialization

* Revert "Fix JSON object deserialization"

This reverts commit 42a4637e53020d8d3e921f72bc66de9d4ccd8151.

* Add JSON body decoding before deserialize call

* Add two more json_decode calls

Co-authored-by: Thomas Hansen <thomas@thomasphansen.dk>
2022-03-28 11:09:37 +08:00
William Cheng
6c1b68da91
[Java][okhttp-gson] better support for additional properties (#11964)
* add support for additiional properties in okhttp-gson java client

* deserialize with additional properties

* better handling of non-primitive type

* use entry set instead

* support disallowAdditionalPropertiesIfNotPresent

* remove additional properties in serialization
2022-03-27 16:56:25 +08:00
K Zhang
efefbaf7d8
[GoClient] Fixed StringIndexOutOfBoundsException when multiple properties has the same required $ref oneOf objects (#11973)
* Fixed StringIndexOutOfBoundsException when the object has multiple required fields has $ref to the same oneOf object

* fix bad depth

Co-authored-by: Kanda <kanda@synctera.com>
2022-03-27 15:12:59 +08:00
Hui Yu
0a9429f1a8
[C][Client] Free list or map memory when json parsing fails (#11866)
* [C][Client] Free list or map memory when json parsing fails

* [C][Client] Free list or map memory when json parsing fails (part 2)

* Note for unsupported data type
2022-03-27 14:58:45 +08:00
Oleh Kurpiak
8103ccdfa7
[Java][Spring] default value for list parameter (#11961) 2022-03-26 10:30:55 +08:00
cachescrubber
50bf764268
Spring Boot Dependency Upgrade (#11960)
* Dependency management: Upgrade Managed Versions

* spring-boot: add optional classifier to spring-boot maven plugin configuration

* Upgrade to spring-boot 2.5.10

* Generate Samples

* Upgrade to Spring Boot 2.5.11 / 2.6.5

* Generate Samples
2022-03-26 10:23:25 +08:00
y-tomida
5fa08b9bc1
[Typescript-node] fix handling of --model-name-prefix|suffix options, second attempt (#11966)
* remove prefix and suffix from model before generate import path

* add testcases

* optimize import

* fix testcases
2022-03-25 07:34:11 +01:00
Esteban Gehring
db53fdffb2
Revert "[Typescript-node] fix handling of --model-name-prefix|suffix options (#11956)" (#11963)
This reverts commit 7cc995ab10ca607fa113650e311e50bd84d893fc.
2022-03-24 18:30:21 +01:00
y-tomida
7cc995ab10
[Typescript-node] fix handling of --model-name-prefix|suffix options (#11956)
* remove prefix and suffix from model before generate import path

* add testcases

* optimize import
2022-03-24 18:05:24 +01:00
Oleh Kurpiak
85df431ebf
Replace maps with models to reduce casting (#11913) 2022-03-25 00:48:41 +08:00
Daniel Qian
5581cbf03a
fix markdown table format (#11955)
origin:

Name | Value
-----|------
foo  | bar

after:

| Name | Value |
|------|-------|
|  foo |  bar  |
2022-03-25 00:34:51 +08:00
Cameron Koegel
2c4daeae0b
[Ruby] Added Support for Binary Media Data Return (#11254)
* update template files

* fixed binary data return

* update samples

* apply change to file download logic and regenerate samples
2022-03-23 21:19:31 +08:00
Yuriy Belenko
7b59e602ed
[php-slim4] Add lazy CORS implementation (#11941)
* Add lazy CORS implementation

While Slim4 doc applies CORS headers via middleware but their code team
member recommends to use custom response emitter.

Ref: https://github.com/slimphp/Slim/issues/2999#issuecomment-1066839414

* Refresh samples
2022-03-23 16:46:23 +08:00
Matthew Fernandez
61245fc52b
[Python] abbreviate dictionary membership testing idiom (#11905)
This is a more brief and efficient way of accomplishing the same thing.
2022-03-23 01:28:02 +08:00
Yuriy Belenko
4f9950bb2e
Update recommended .htaccess (#11939)
Used in current official Slim skeleton.
Ref: 037cfa2b68/public/.htaccess
2022-03-23 01:16:18 +08:00
Basil
196b9f266f
[php] use http_build_query for deepObject support (#11225)
* Update ObjectSerializer::toQueryValue method

It looks a bit ugly right now, but at least all tests has been passed.

* Add tests of query serialization

I used fixtures from OpenAPISpec main doc. Some prop combinations are not
officially documented yet, for instance behavior for nested objects and
arrays.

* Add test fixture from @nadar

* Add tests of Guzzle query build failure

* Add query build wrapper static method

Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
2022-03-22 12:56:15 +03:00
Justin Black
36f0dd026c
Only allow v3 input specs into python-experimental (#11931)
* Only allow v3 input specs into python-experimantal

* docs regenerated
2022-03-21 23:47:47 -07:00
Martin Winandy
7a78e350cc
Remove obsolete imports (#11899) 2022-03-21 18:19:31 +00:00
Oleh Kurpiak
2455c84943
[Java][Spring] Fix Array response (#11909) 2022-03-21 23:54:21 +08:00
Oren Samuel
5e32f0c366
[java][resttemplate] using uriBuilderFactory to encode all template values (#11922)
* issue 11921 - encode all template values

* add test for url and query param encoding
2022-03-21 23:42:56 +08:00
Ismael Barrera García
ba76ec9551
Potencial NullPointerException fixes (#11923)
* Update pom.xml

* Create build.yml

* Eliminación de posibles NullPointerException

* Delete build.yml

* Update pom.xml
2022-03-21 23:32:17 +08:00
Rafael González Castillero
e159919ba5
List/Map emptiness checking and stream variation (#11920)
I have changed the way to check for empty maps and lists, instead of checking if the size is greater than 0, It is more understandable and faster using !x.isEmpty() method. Also, instead of using stream().filter().findFirst().isPresent(), it is recomendable using its equivalent stream().anyMatch() which as well makes it easier to understand and efficient.
2022-03-21 23:30:43 +08:00
Stefan Nöbauer
0a48976ccb
[BUG] KOTLIN URI gerneration for URIs with default value misses the package info and uses wrong quotes. (#11493)
fixed generation of URI with default value
2022-03-21 14:57:19 +00:00
Oleh Kurpiak
8acc5023a8
[C#/.NET] remove duplicate CLI option (#11925) 2022-03-21 12:50:19 +08:00
William Cheng
f4700487f8
fix the exception in python flask option handling (#11916) 2022-03-21 11:07:46 +08:00
William Cheng
caa0ba0d6d
only support jdk8+ (#11917) 2022-03-21 11:07:31 +08:00
LeComptoirDesPharmacies
87a5182c24
[Python] - Migrate enable per request authentification in new python codegen (#11279)
* LDS-2166 : add request auth to api client and api call

Can now overwrite request auth by request

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : Add samples

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : fix test

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : Fixing test in python_disallowAdditionalPropertiesIfNotPresent

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : add removed line break

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : add name for _request_auth params

Add None when _content_type is not set

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : add tabulation

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : fix missing values

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* LDS-2166 : generate sample

Add _request_auth in sample

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* Request auth can now use multiple auth

Request auth is now a list of dict

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

* Add request_auths in test

Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten

Co-authored-by: Géry THRASIBULE <g.thrasibule@lecomptoirdespharmacies.fr>
2022-03-20 13:12:59 -07:00
William Cheng
bc2624d307
use jdk8 in msf4j code (#11918) 2022-03-20 11:38:52 +08:00
Manuel
56e7507ffb
Fix typo in final Info message (#11914)
"Connect you browser" -> "Connect your browser"
2022-03-19 22:22:02 +08:00
William Cheng
571e635a54
[csharp][netcore] better tests for oneOf with primitive types (#11907)
* update samples

* undo changes for generichost
2022-03-19 22:21:33 +08:00
tuanchien
1fe2eb6b7a
Fix undefined object in Python model __copy__ template (#11792)
* Fix new_cls in methods_shared copy template

* Add generated files
2022-03-18 21:34:06 -07:00
Jason Finch
ffd758d82d
fix: [csharp-netcore]: oneOf fixes for Primitive types (#11427)
* fix: [csharp-netcore]: oneOf fixes for Primitive types

- Escape type in XML comment to avoid issue with types<T> rendering.
- Conditionals for string and Object to still throw ArgumentException.

* fix: Adjust whitespace in csharp-netcore template.  Regenerate Petstore clients due to different order of items in composedSchemas.
2022-03-18 11:58:46 +08:00
Bruno Coelho
8e68ff71c4
[swift5][client] fix non public visibility modifier for NullEncodable (#11903)
* [swift5][client] fix non public visibility modifier for NullEncodable

* [swift5][client] fix non public visibility modifier for NullEncodable
2022-03-18 09:58:52 +08:00
Oleh Kurpiak
3b7ea5ca53
[Java][JaxRS-Spec] fix builder generation (#11892) 2022-03-18 09:54:21 +08:00
William Cheng
b00c9d58c3
rename extension to conform to kebab-case (#11894) 2022-03-18 09:51:22 +08:00
William Cheng
5d8b80a5cd
[Java] rename x-contentType to x-content-type (#11895)
* rename x-contentType to x-content-type

* undo changes
2022-03-18 09:50:42 +08:00
William Cheng
7cbdf4c163
[java][jersey2] update junit from 4.x to 5.x (major upgrade) (#11898)
* update java jersey2 junit to 5.x

* update jersey2-java8-special-characters

* update jersey2-java8-localdatetime

* update samples/openapi3/client/petstore/java/jersey2-java8

* better code format
2022-03-18 09:50:26 +08:00
William Cheng
a4d320489d
fix warning, update build.gradle, build.sbt (#11896) 2022-03-18 09:50:05 +08:00
bgong-mdsol
fa9c7a669b
[java][native] add connection timeout (#11890)
* java-native: add connection timeout

update connection timeout

* updated samples for connection timeout
2022-03-18 09:45:27 +08:00
Oleh Kurpiak
860b6340a8
[Java] update list of vendor extensions (#11891) 2022-03-17 09:31:45 +08:00
cachescrubber
e07c7d1617
[Feature][Java/Spring] Support Discriminator Based OneOf Interface (#11650)
* Fix OpenAPITools#5381
added x-is-one-of-interface extension for oneOf interface in mustache
template

* Fix OpenAPITools#5381
fixed name of model from UNKNOWN_BASE_TYPE to right one in api: operationId + OneOf

Fix OpenAPITools#5381
parcelableModel is not required

* Fix OpenAPITools#5381
removed not needed methods

* Fix OpenAPITools#5381
catch NPE cases in preprocessOpenAPI
updated samples

* Fix OpenAPITools#5381
fixed generation of oneOf Models

* Fix OpenAPITools#5381
addOneOfInterfaceModel only for cases when useOneOfInterfaces is true and for spring

* Fix OpenAPITools#5381
NPE fix

* Fix OpenAPITools#5381
spring: fixed use of oneOf Models in API

* Fix OpenAPITools#5381
implementing oneOf for spring lib overriding methods with different behavior from default

* Fix OpenAPITools#5381
added x-is-one-of-interface extension for oneOf interface in mustache
template

* Fix OpenAPITools#5381
fixed name of model from UNKNOWN_BASE_TYPE to right one in api: operationId + OneOf

Fix OpenAPITools#5381
removed not needed methods

Fix OpenAPITools#5381
fixed generation of oneOf Models

Fix OpenAPITools#5381
addOneOfInterfaceModel only for cases when useOneOfInterfaces is true and for spring

Fix OpenAPITools#5381
NPE fix for tests

* Fix OpenAPITools#5381
fixed handing of composed schema with array

* Fix OpenAPITools#5381
fixed NPE in addOneOfInterfaceModel

* Fix OpenAPITools#5381
fixed generation of oneOf models with descriminator

* Initial merge of 5.0

* Aligned with master formatting

* Corrected spacing for class names to align with samples.

* Merged master

* Updated samples

* Consolidate methods from JavaClient and SpringCodegen (mov up to AbstractJavaCodegen)

* set useLegacyDiscriminator to false, format templates

* Suport JsonTypeName, fq class name for spring.io.Resource

* Generate Samples

* Test full qualified usage of the spring Resource interface.

* Add java-camel to samples.circleci.spring profile

* Add more complex example combining inheritance and oneof-interface

* Remove x-implements Serializable from JavaClientCodegen (moved to AbstractJavaCodegen)

* Fix spacing before opening brace after extends/implements

* Generate Samples

* Add more complex example combining inheritance and oneof-interface

* Generate Samples

* Fix JsonTypeName annotation handling in Java and JavaSpring

* 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

* Fix JsonTypeName annotation handling in Java and JavaSpring (merge)

* Generate Samples

* Generate Samples

* Add oneof sample

* Generate Samples

* Giv example oas spec a meaningful name, demo usage of oneOf in Model

* Generate Samples

* Remove unnecessary JsonTypeName include, add example for JsonTypeName (Bar_Create)

* Generate Samples

* Generate Samples

Co-authored-by: Alexej <oleksejk@gmail.com>
Co-authored-by: JBurgess <joel.burgess@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-03-16 22:50:05 +08:00
maciejcymanski132
03b24b5d3b
MustacheTemplateUpdate csharp (#11870)
* CSharp Template Updated [htmlescaping]

* Update returns in template

Co-authored-by: Maciej <Maciej.Cymanski@dnv.com>
2022-03-16 22:43:17 +08:00
Tomofumi Chiba
a0a1839eb3
fix for typescript deno (#11887) 2022-03-16 15:26:59 +01:00
William Cheng
9a1e6d778a
[Java][okhttp-gson] update junit to 5.8.2 from 4.13.2 (#11882)
* update junit to 5.8.2 in java okhttp-gson client

* undo changes to yaml

* update samples

* update tests

* fix indentation

* restore tests

* update samples
2022-03-16 16:33:47 +08:00
Samodya Abey
4e602b66b9
[Rust][Server] Upgrade to tokio v1 (#11873)
* [Rust][Server] Upgrade hyper from 0.13 to 0.14, swagger-rs from 5.0.2 to 6.1.0

* Also upgrade tokio from 0.2 to 1.14

* Re-add JavaClientCodegenTest.java

* Fix incorrect slashes due to wrong generation

* Spelling fix: failuare -> failure

* Upgrade more packages

* Commit generated code

* Fix typo

Co-authored-by: Foorack / Max Faxälv <max@foorack.com>
2022-03-16 15:29:36 +08:00
William Cheng
941d4845d7 minor fix to java okhttp-gson pom.xml 2022-03-16 01:03:17 +08:00
devhl-labs
86281a28c7
[charp-netcore] Fixed property and parameter sorting (#11807)
* refactor nrt annotation

* enable nrt by default in .net6.0+

* use shorter nrt annotation

* build samples

* removed debugging lines

* fixed model and operatoin constructors

* reverted a commented line for comparison

* upgraded to System.Text.Json

* build samples

* build samples

* deleted samples to remove old files

* bug fixes

* bug fixes

* added cumpulsory property to codegen

* build samples

* fixed bug

* fixed bug

* fixes

* removed bugged code that wasnt needed

* build samples

* restored sorting and default values for required params

* fixed bugs in comparison

* fixed sort comparators

* recreate tests

* build samples...again...

* removed debugging line breaks

* simplified constructor signature
2022-03-16 00:35:27 +08:00
bgong-mdsol
ecbd164ed7
fix missing type in StringToArrayModelMapping (#11856)
clean up
2022-03-16 00:28:18 +08:00