1230 Commits

Author SHA1 Message Date
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
David Gamero
28cc286265
[typescript] Default auth method support and optional param object when all params optional (#11321)
* add default auth

* private

* default when optional params and fix types

* build samples

* remove extra space

* re-add space before default empty

* switch to default authentication method support in config

* generated samples

* null check chaining

* generate samples

* remove extra spaces

* regen samples

* formatting fixes

* more samples

* remove from abstract methods

* samples

* add default to inversify as well

* samples again

* exclude inversify

* samples once more

* samples
2022-01-22 12:11:04 +01:00
cachescrubber
e1c5b220cd
[JAVA] new Feature interface: Documentation Provider and Annotation Library (#11258)
* Implement DocumentationProviderFeatures and integrate it in AbstractJavaCodegen

* Integrate DocumentationProviderFeatures in SpringCodegen

* Run new test config spring-boot-springdoc

* Do not use Locale.ROOT

* Do not use Locale.ROOT, use NONE instead of empty list

* Revert "Do not use Locale.ROOT"

This reverts commit a0d6aac92bea2370b4f164d18ada3fd9097f3a30.

* Do not use forbidden APIs

* Fix spring maven plugin example

* Introduce DocumentationProviderFeaturesTest.java

* replace AUTO with preferredAnnotationLibrary

* remove sout.println from Test

* Apply code style.

* Update spring sample configuration to use the new property

* Update samples after merge

* fix atBean import

* Generate all samples

* Add ParameterObject to test

* Allow Subclasses to opt out

* Use OpenAPI 2 (fka Swagger RESTful API Documentation Specification) instead of just "Swagger"

* export generator docs

* Fix typo

* Fix typo - update docs.
2022-01-22 08:51:17 +08:00
William Cheng
b7c8de9425 update samples 2022-01-21 17:45:53 +08:00
hackerman
93488f4195
Resolve several issues in generated Go code (#8491)
* [go] use regular stdlib import names

* [go] support primitive oneOf types

See #8489

* [go] improve pbv/pbr handling

Improves the way pass-by-value and pass-by-reference variables are used.

Closes #8489

* [go] improve generated documentation

* [go] adopt pointer changes in interface

* [go] regenerate sample

* [go] resolve pointer issues

* [go] regenerate clients and avoid pointers on primitive return values

* [go] improve Exec() return value handling

* [go] regernate files

* [go] use go modules

* [go] properly handle polymorph decode

If polymorphism without discriminator was used, the previous code was unable to properly decode the vaules. By using a strict decoder, which rejects unknown fields, type guessing now works.

* [go] make GetActualInstance not panic on nil

* [go] return GenericOpenAPIError as pointer

* [go] clarify helper function godoc

* [go] address test regression error type

* [go] regenerate go samples

* [go] resolve go mod issues and test regressions

* [go] resolve merge conflicts and regenerate

* [go] resolve merge conflicts

* [go] Replace spaces with tabs

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>

* [go] Replace spaces with tabs

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>
2022-01-21 16:54:09 +08:00
cachescrubber
0f6b620817
[Java Spring OAS3] Minor fixes and general improvements (#11229)
* * Use Relative Imports for org.springframework.core.io.Resource
* api.mustache: Add operationId to atOperation annotation
* Overhaul atSchema annotation in model
* Add spring-stubs-oas3.yaml test config
* Optimize mustache templates
* Use Relative Imports for DateTimeFormat, Pageable and ApiIgnore

* Add spring-stubs-oas3.yaml test config

* Generate all samples

* Explain fromOperation override to support more logic-less templates.

* Support RootUriTemplateHandler from spring-boot

* Revert "Support RootUriTemplateHandler from spring-boot"

This reverts commit 1915f8b19e391b1c570f1025931690a67afba3ea.

* Evaluate additional property useSpringfox as Boolean

* Generate all samples after merge (java-camel)

* Fix typo

* Move java-camel test deom samples.circleci.spring to samples.circleci profile.

* re-generate all samples after merge

* Generate samples and docs after merge

* Generate samples after merge conflicts resolved
2022-01-17 15:25:50 +08:00
William Cheng
768795648e add new files 2022-01-17 11:06:09 +08:00
William Cheng
33bce99b8e
Avoid using import mapping in model generation (#11217)
* remove import mapping logic in model generation, better handle of file, list

* add new files for file, list

* fix some tests

* update tests, doc

* skip file as reserved word in feign client

* add new files

* remove file from reserved word list in spring generator
2022-01-16 23:57:53 +08:00
Esteban Gehring
3f4e7d8263
Revert "[typescript] Make module usable with esbuild (#11298)" (#11333)
This reverts commit 7129cdebc5524fb2516822d33b4d2000096cb72b.
2022-01-16 16:31:16 +01:00
Justin Black
ffe5df8fa1
Turns python-legacy CI back on in circle, fixes python-legacy test (#11326)
* Turns python-legacy CI back on in circle, fixes python-legacy test

* Installs python 2.7 into circleci node 3

* Python 2.7 version changed to 2.7

* Switches back to py2714
2022-01-16 17:12:38 +08:00
Ethan Keller
6430aaf3b1
recursively search for types during import type collection in deeply … (#11221)
* recursively search for types during import type collection in deeply nested schemas #11220

* composed schema recursive type import handling

* change Importable to ComplexType to modularize related type-wrangling.

* Problems...

* Revert "Problems..."

This reverts commit 6154f202a0f4db7a706fe3d61b45573581d164d4.

* Reverted attempts to reuse recursive type-finding code.

* add javadoc comments

* fix javadoc warning.

* fix NPE

* PR feedback incorporation

* Include additionalProperties recursion.

* More feedback

* More feedback

* Add comments from feedback
2022-01-14 12:39:22 -08:00
Amelia Raia
d8cb6bd894
Allow the user to pass in any headers per request. #11139 (#11140)
* [Python] Allow the user to pass in any headers per request

* Update docs

* Update docs

Update Docs _headers

* Add test

Co-authored-by: Rizwan Saeed <rizwan.saeed@finbourne.com>
2022-01-13 15:25:40 -08:00
Bodo Graumann
7129cdebc5
[typescript] Make module usable with esbuild (#11298)
* Use default import from url-parse

* Update samples

* Fix typo in readme
2022-01-13 17:06:04 +01:00
Justin Black
95a1154c20
python-experimental adds DecimalSchema (#11282)
* Fixes test

* Adds decimal examples to the pythonExp generator

* Adds isDecimal to CodegenModel, updates python-exp samples

* Fixes decimal types in ObjectModelWIthDecimalProperties and DecimalPayload

* Updates tests

* Decimal feature added to python-exp docs

* Samples and docs regenerated
2022-01-11 21:51:50 -08:00
Justin Black
ce04e9b6a2
python-experimental, redundant docstrings removed (#11281)
* Removes docstrings drom models because type hints already includes this info

* Samples updated
2022-01-11 09:31:25 -08:00
Justin Black
de036e211e
Improves generator docs: stability + language version added (#11270)
* Adds generatorLanguageVersion and uses it in python generators

* Regenerates docs

* Adds stability to generator docs

* Triple braces generatorLanguageVersion

* Regenerates samples

* Fixes the python-experimental setup.py file so it works with generatorLanguageVersion

* Updates generators readme
2022-01-10 18:16:53 -08:00
carmenquan
478219744e
Making PyPi markdown friendly requires additional property (#11093)
* updating python markdown property

* adding to samples
2022-01-09 08:22:11 -08:00
Matthew
e7ca67071e
[python] Fix 10773 - Use base_name for file uploads in form data (#11182)
* Use base_name for file uploads in form data

* Added missed sample changes
2022-01-09 08:19:57 -08:00
jiangyuan
e1902257b3
[Python] add '_spec_property_naming' param (#11226)
* add '_spec_property_naming' param

* add '_spec_property_naming' comment

Co-authored-by: jiangyuan04 <jiangyuan04@baidu.com>
2022-01-05 14:26:10 -08:00
Justin Black
3243279b4d
Adds python-experimental with dynamic base classes (#8325) 2022-01-05 12:30:49 -08:00
S2021Git
361b593da2
Not creating "Accept:null" header for Java-Jersey2 generator (#11084)
* updated ApiClient.mustache for jersey2

* updated samples

* corrected indentation

* updated samples
2022-01-04 16:41:24 +08:00
William Cheng
35a2fa6afc move avro-schema.yaml to bin/configs 2022-01-04 15:01:28 +08:00
William Cheng
161de2cfdf update samples 2022-01-03 18:05:08 +08:00
William Cheng
d17a472b89 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-03 18:03:00 +08:00
agilob
6c3cdee6fb
Dart - update generator to support null safety (#10637)
* fix: Make dart2 generated code compilable

* Update dart2 client samples

* Re-add deleted test files

* Lower dart version to 2.12

* Make username and pass not null in http basic auth

* Delete json_serializable

* Make growable false by default

* Make value not nullable

* Remove redundant null check

* Revert linter fix

* Provide required username and pass

* Revert initial abstractDartCodeGen changes

* Revert removing dart pom module

* Revert removing dart pom module

* Lower minimum dart version to 2.12

* Disable dart2 tests generation

* Disable petstore_client_lib

* Disable samples/openapi3/client/petstore/dart2/petstore

* Re-add dart2 tests

* Add new tests

* Delete empty directory

* api_client.mustacheUpdate 

added optional HttpBearerAuth so you can add the token directly on the ApiClient

* Update api_client.dart

auto generated files for build

* Update api_client.dart

Autogenerated files for buiild

* Make mapDateTime nullable and add ! after json mapping

* Fix warning on Future<?>

* Fix warning on Future<?>

* Dont insert unused param to constructor

* Modified Dart2 Mustache template.

* Regenerated Petstore source code.

* Remove extra code to sync with agilob's pr.

* Regenerated Petstore source code.

* Fix a couple of reported bugs.

* Regenerated Petstore source code.

* Make properties non-nullable.

* Regenerated Petstore source code.

* Do not trim user input before submitting.

* Regenerate Petstore source code.

* Regenerate Petstore source code.

Co-authored-by: Kate Döen <kate@stack11.io>
Co-authored-by: Artur Powroznik <arturp@backbase.com>
Co-authored-by: devjakobsen <94956607+devjakobsen@users.noreply.github.com>
Co-authored-by: Noor Dawod <noor@fine47.com>
2022-01-02 21:13:02 +08:00
cachescrubber
e71ee1bf43
[Java Spring OAS3] Fix numerous OAS3 related Bugs (#11181)
* Oas3: Remove swagger2 ApiModel and ApiModelProperty from imports when oas3 is true.

* Oas3: Use either swagger v2 or v3; add test config

* Oas3: allowableValues and defaultValues belong to the Schema annotation

* Oas3: use swagger-core.version property in all pom.xml

* gh-11165 remove io.swagger.v3.oas.annotations.parameters.RequestBody

* gh-11168 add import for io.swagger.v3.oas.annotations.Hidden

* Fix formParams.mustache, add dedicated test scripts for the spring generator using oas3.

* Run ./bin/generate-samples.sh

* Run ./bin/generate-samples.sh - new samples

* fix indentation

* Revert to threetenbp 2.9.10 because customInstantDeserializer.mustache is not compatible with threetenbp > 2.9.10.

* apiController.mustache: pull in osa3 imports.

* apiDelegate.mustache: remove io.swagger.annotations.* import

* Remove Hidden (import and usage). Wrap atApiIgnore with useSpringfox.

* fully qualify org.springframework.data.domain.Pageable because endorExtensions.x-spring-paginated is not set during import processing.

* align spring-cloud and spring-boot pom.mustache regarding springfox and oas versions.

* introduce dateTimeParam.mustache

* Apply DateTimeFormat consistently across different parameter types

* revert to springfox 2.9.2

* add newline after parameter

* fix atSchema annotation (use empty description)

* add more spring-*-oas3 test configs

* Update bin/config/spring* test samples

* Fix implicitHeader.mustache - add import, generate use paramDoc.

* rename spring-boot-implicitHeaders-oal3.yaml to spring-boot-implicitHeaders-oas3.yaml

* Add spring oas3 configs to samples.circleci profiles module list

* Use groupId 'org.openapitools.openapi3' for oas3 configs

* Run all spring test configs.

* In OAS3, allowableValues is a String[] array.

* formParams.mustache: Align spacing and newlines with other param templates

* Support @Parameter(hidden = true) instead of ApiIgnore, Formatting: One parameter per line.

* Format method level annotations in api.mustache

* Introduce samples.circleci.spring profile

* Generate all spring samples
2022-01-02 21:05:46 +08:00
William Cheng
238639a500 update java sampes 2022-01-02 17:28:17 +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
8d16239aab Merge remote-tracking branch 'origin/5.4.x' 2021-12-21 22:04:47 +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
Josh Burton
6f6d4f8c02
[dart-dio-next] Removes dioLibrary option (#10931)
As there is no longer a fork of the dio library this option can be removed
2021-12-17 10:36:42 +08:00
William Cheng
b2daa5a836
update jackson-databind-nullable to 0.2.2 (#11121) 2021-12-15 11:41:16 +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
Tomasz Prus
b755ae288a
[Python] Add option to select/detect content-type. (#10978)
* [Python] Add option to select/detect content-type.

* Regenerate samples after rebase.

* Update samples.

* test: fix assertion
2021-12-08 13:15:26 -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
2b7910c875 Merge remote-tracking branch 'origin/master' into 5.4.x 2021-12-06 23:57:07 +08:00
Peter Leibiger
ecddd4cff1
[dart][dio][built_value] Fix missing serializer factory builders for additionalProperties (#11011)
Refactor the addition of custom serializer factories.
2021-12-04 14:32:36 +08:00
jiangyuan
e7ac0eec4b
[Python] fix model.mustache import (#10988)
* fix model.mustache import

* add samples file change

Co-authored-by: jiangyuan04 <jiangyuan04@baidu.com>
2021-11-29 17:50:19 -08:00