1199 Commits

Author SHA1 Message Date
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
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
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
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
William Cheng
0295839a20
fix test failure due to different error message based on jdk version (#11906) 2022-03-18 14:30:11 +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
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
Tomofumi Chiba
a0a1839eb3
fix for typescript deno (#11887) 2022-03-16 15:26:59 +01:00
William Cheng
82b7dee480
update java jersey2 dependencies to newer versions (#11878) 2022-03-15 18:38:34 +08:00
William Cheng
7ea5d158f2
[Go] fix oneOf naming (#11863)
* update samples

* add lambda to handle oneof/anyof naming in go
2022-03-15 12:47:09 +08:00
Cameron Koegel
266de25cf3
[Python] Added Support for Validating and Converting Model Attributes (#11134)
* [Python] Added Support for Validating and Converting Model Attributes

* generate new samples

* remove attribute error

* update samples

* revert old changes

* changed spec_property_naming default to true

* regenerated samples

* regenerate samples
2022-03-15 00:35:39 +08:00
William Cheng
7ac90ed98f
[Go] add more tests to cover more cases (#11849)
* more tests for go client

* add new files

* update samples

* add more tests
2022-03-11 10:42:24 +08:00
William Cheng
cbdcf8cdad update samples 2022-03-10 10:13:29 +08:00
Cameron Koegel
fd1ede6a73
[Python] Added Ability to Initialize Models by Passing in Dictionaries (#11125)
* [Python] Added Ability to Initialize Models by Passing in Dictionaries

* formatting change

* generate new python samples
2022-03-09 09:41:15 -08:00
wirthual
7ed7930bab
fixed wrong intendation error (#11834) 2022-03-09 11:21:54 +08:00
Cameron Koegel
94b1440074
[Python] Add Support for Content-Disposition Header without filename (#11055)
* [Python] Add Support for CD header w/o filename

* updated documentation per PR instructions

* fixed formatting and updated samples and docs

* revert docs changes

* regenerate python samples

* updated sample python test
2022-03-09 01:10:49 +08:00
Cameron Koegel
b1c6513015
[Ruby] Added Support for Building Models from Hashes with Strings as Keys (#11243)
* [Ruby] Added Support for Building Models from Hashes with Strings as
Keys

* generate samples
2022-03-09 00:59:53 +08:00
Radek Postołowicz
c22997b9b8
Cleanup Jackson type info mess fixes (#9441) (#11691)
* Cleanup Jackson type info mess fixes (#9441)

* fixup! add import mapping for JsonIgnoreProperties
2022-03-07 09:36:05 +08:00
William Cheng
683984896e
update maven-javadoc-plugin to newer version (#11737) 2022-02-27 16:57:16 +08:00
Reda
33b89148e5
[JavaSpring] Multipart causing HttpMediaTypeNotSupportedException when parameter is different than File or String (#11449)
* Generate @RequestParam when parameter is not a File

* Fix tests to use @RequestParam

* Enhance testMultipartBoot test case

* Update the Petstore sample

* Add MultipartMixedStatus files

* Use @RequestPart for spring-cloud when param is File

* Generate samples

* Delete spring-cloud formParams.mustache file

* Regenerate samples
2022-02-27 15:07:35 +08:00
sullis
f1d0724f2a
[java] junit 4.13.2 (#11733) 2022-02-27 13:18:19 +08:00
Chris White
d153134dec
Fixed RFC3999DateFormat clone NPE (#11705) 2022-02-24 12:29:23 +08:00
Kuan-Yin Chen
ab63786610
[Python] remove default content-type in the request (#10782)
* remove default content-type in the request

* add remove default content-type test

* fix duplicate content type

* update sample

* add missing params

* update sample

* only assign content type if exist

* update sample

* update sample

* format code

* update sample
2022-02-24 12:08:49 +08:00
William Cheng
df05e6f4bc
Update parser to 2.0.29 (#11388)
* update parser to 2.0.29

* better handling of null in dereferencing

* update parser to 2.0.30

* update core to newer version

* add new files

* rollback to previous stable version

* remove files

* Fixes for python-experimental NullableShape component

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2022-02-21 18:37:52 +08:00
sullis
3c8f249c6c
[java] logback 1.2.10 (#11659)
Latest version of logback
https://logback.qos.ch/news.html
2022-02-19 18:52:39 +08:00
William Cheng
d530e1baec
minor enhancement to code format in go client (#11657) 2022-02-19 13:11:28 +08:00
moznion
d6a97b0c39
Remove dummy variable declaration for context.Context from generated go code (#11641)
Originally, this dummy declaration was needed because there was the
possibility of the generated code doesn't use `context.Context` and then
if it imported that package, go compiler complains that and makes an error.
ref: 3ed1aa8e79/modules/swagger-codegen/src/main/resources/go/api.mustache (L30)

However, now this dummy placement is no longer needed because the
generated code always uses `context.Context`.

Signed-off-by: moznion <moznion@mail.moznion.net>
2022-02-18 11:34:05 +08:00
William Cheng
b979eccf68
Add Github action file to test Java clients (#11633)
* add github action file to test java clients

* update tests
2022-02-17 15:49:34 +08:00
Justin Black
b165d2dda9
[python-experimental] fn + method signature improvements (#11529)
* Updates code

* Removes java files
2022-02-16 10:52:31 -08:00
William Cheng
ec51e9cd0b update samples 2022-02-14 12:54:26 +08:00
William Cheng
5346d0b6b7 update samples 2022-02-14 11:45:12 +08:00
jiangyuan
dce8b80af7
[Python] fix api file name & api var name (#11051)
* fix api filename

* fix PythonCodeGen toApiVarName

* add samples change
2022-02-14 11:27:13 +08:00
cachescrubber
0ed147e7a4
Implement Source DocumentationProvider, spring-mvc decommission (#11531)
* - Upgrade swagger-ui to 4.4.1
- Bring homeController.mustache up-to-date
- Main class is now OpenApiGeneratorApplication
- Introduce SpringBootTest.mustache
- Remove option swaggerDocketConfig/openapiDocketConfig in favor of documentationProvider.

* Generate Samples

* Restore generator-online classes
Fix spring-mvc builds

* Generate Samples

* Do not generate SpringFoxConfiguration.java when reactive ist set.

* Fix generation of SpringFoxConfiguration

* Generate Documentation

* Reactive support: add dependency management for springdoc-openapi-webflux-ui

* Generate Samples

* Change SpringBootApplication to OpenApiGeneratorApplication

* Generate Samples

* Implement SwaggerUIFeatures in SpringCodegen

* Generate Samples

* Add useSwaggerUI: true to some test configs

* Generate Samples

* Update Documentation

* Update Documentation

* Update README.mustache

* Generate Samples

* useSwaggerUI is true by default

* Generate Samples

* Update Documentation

* Add deprecation warnings to cli opts; Log a deprecation warning

* Update Documentation

* Generate Samples

* Remove spring-mvc library

* Remove spring-mvc from project and CI configs

* Check whether the selected documentation provider requires us to boostrap swagger-ui.

* Generate Samples

* Generate samples

* Generate samples

* Generate samples
2022-02-12 17:25:21 +08:00
cachescrubber
703c9630c2
[spring] various bug fixes and enhancements (#11580)
* Bugfix: delay clearing *TemplateFiles with apiFirst #2407

* Bugfix: delay clearing *TemplateFiles with apiFirst #2407 (add test case)

* spring api.mustache: fix unhandledException #10860

* Generate samples

* add sample

* Generate samples

* Fixed mustache template for FormParams. Use paramName instead of baseName for variable name.
This will fix an issue when parameter name is one of the reserved keywords (#7506)

# Conflicts:
#	modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache
#	modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java

* Move and comment apiFrst

Co-authored-by: Andrii Hrytsiuk <andrii.hrytsiuk@gmail.com>
2022-02-12 15:17:58 +08:00
cachescrubber
9dfe8c63ee
[Bug][Java] defaultValues for date and date-time params (#11536)
* Add default value support to cookie and header params

* Generate Samples

* Replace "OffsetDateTime.parse(..)" with toString();

* Generate Samples

* Revert "Replace "OffsetDateTime.parse(..)" with toString();"

This reverts commit 2e37411b305343e99542c094a691e1419a67b1b5.

* Format java.util.Date to ISO Date in AbstractJavaCodegen.toDefaultParameterValue

* Generate Samples

* Generate Samples

* Use toParameterDefault()

* Generate Samples

* Implement testDateTimeFormParameterHasDefaultValue unit test

* Add more test coverage.

* Remove postProcessParameter() since is has no effect after using toDefaultParameterValue()

* Use LocalDate.parse() in toDefaultValue()

* Generate Samples

* Return a defaultValue only if dateTimeLibrary is java8.
2022-02-12 15:14:26 +08:00
William Cheng
8455c1cd23
Remove the option to support JDK7 from Java generator and templates (#11547)
* remove java8 from java client generator and templates

* update tests

* remove threetenbp

* update spring templates to remove java8

* remove java8 from jaxrs template

* fix jaxrs spec

* fix feign

* remove CustomInstantDeserializer.java

* fix jersey1

* fix undertow

* various update

* fix jaxrs jersey1

* fix java inflector

* fix jaxrs cxf

* add new files

* update doc
2022-02-10 10:35:29 +08:00
William Cheng
b6c445cdc3
update swagger core, jackson to newer version (#11545) 2022-02-08 13:31:20 +08:00
Ethan Keller
9f5422d688
Add cycle detection (#7532) (#11500)
* Add cycle detection (#7532)

* Review feedback

* Including ContextAwareNodes to detect cycles more accurately.

* Add test

* Add forest to test.

* No longer need ContextAwareNode

* Review feedback

* Update samples
2022-02-06 13:21:17 -05:00
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
e177a4b757 update samples 2022-02-05 16:37:56 +08:00
Justin Black
6cf4e79f14
[python-experimental] adds missing bases, performance improvements (#11517)
* Adds bases for int32, int64, float32, and float64

* Samples updated

* Removes print statements

* When creating properties and items do not call _from_openapi_data or model __new__

* Update speed improvement

* cast_to_allowed_types speeed improvements

* _get_new_instance_without_conversion order swap for speed

* Fixes test errors

* Small fixes about path_to_schemas
2022-02-04 07:47:16 -08:00
Justin Black
4d9a500c95
Adds inline composition examples to python-experimental (#11420)
* Adds component with composition in property example

* Adds endpoint parameter examples

* Adds request body examples

* Adds inpline composition example in response body

* Fixes UNKNOWNBASETYPE import bug

* Updates allof inline schemas to be type object with minProperties

* Removes newline

* Adds test_ObjectWithInlineCompositionProperty

* Updates inline schema to be type string, adds partial test_inline_composition

* Fixes accept_content_types input value

* Adds test_ObjectWithInlineCompositionProperty, adds test_inline_composition and starts deserialization of multipart

* Fixes test_inline_composition, adds simple multipat/form-data deserialization
2022-02-03 08:27:52 -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
David Gamero
b2bb5d071e
[typescript] Adding Custom Agent Support for fetch call (#11400)
* add custom agent support

* samples

* more samples

* merge master files

* only enable custom agent on nodejs not browser

* samples again

* samples

* samples once more
2022-01-28 12:01:32 +01:00
jiangyuan
8b3cad0692
[Python] fix model to dict (#11234)
* fix model to dict

* add unit test

* add unit test

* update sample files
2022-01-25 09:50:59 -08:00
Justin Black
42f3258faa
Turns on python-experimental CI tests (#11390)
* Installs python3.9 in node3

* Moves python clients into separate node so they can use a docker image

* Installs java and maven into docker

* Switches off some python tests
2022-01-24 15:44:38 -08:00