609 Commits

Author SHA1 Message Date
Makoto Aoyama
0a34839567
Add hashableModels to additional properties (#9495)
* Add hashableStruct

* Revert "Remove x-swift-hashable"

This reverts commit 18053af0016fdba13fd1e5df00ad86abee071283.

* Add Hashable for x-swift-hashable

* Add config yaml to test x-swift-hashable

* Run ./bin/generate-samples.sh ./bin/configs/swift5*

* Run ./bin/utils/export_docs_generators.sh

* Run ./bin/generate-samples.sh ./bin/configs/swift5*

* Verify setHashableStruct

* Rename hashableStruct => hashableModels

- Replace hashableStruct => hashableModels
- Replace HashableStruct => HashableModels
- Replace HASHABLE_STRUCT => HASHABLE_MODELS
- Update docs

* Refactor modelObject.mustache

* Control equals and hash functions
2021-05-20 23:04:19 +08:00
William Cheng
9e4afb0fc3
[C++] Rename Qt5 to Qt (#9490)
* rename qt5 to qt

* rename, update

* rename qt5 to qt in the templates

* update doc
2021-05-18 23:09:59 +08:00
William Cheng
c4f7091da5
partially revert 9404: avoid empty string enum value (#9501) 2021-05-17 23:47:07 +08:00
Bruno Coelho
e6a10ae350
[swift5][client] add option to generate or not the model additional properties (#9375)
* [swift5][client] add option to generate or not the models additional properties

* [swift5][client] update sample projects

* [swift5][client] format code

* [swift5][client] format code

* [swift5][client] format code

* [swift5][client] update docs
2021-05-15 15:46:32 +08:00
Sheldon Young
f9cd80deed
[scala-sttp] Bump minor versions of libraries, SBT and Scala (#9356) 2021-05-12 21:29:51 +08:00
Bruno Coelho
3173e0b1d3
[kotlin][client] improve docs (#9393) 2021-05-10 20:42:13 +08:00
William Cheng
be214dc349 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-05-07 10:15:12 +08:00
matt beary
32b2ea3291
Fixes #9398: fix aspnet enum documentation (#9404) 2021-05-06 11:23:32 +08:00
Rustam
ccbb78e1b2
Keep old Ktor server generator for backward compatibility (#9365) 2021-04-29 08:26:57 +08:00
Rustam
53398a0850
Ktor server upgrade (#9088)
* Update to new ktor version #9087

* Update doc #9087

* Cleanup #9087
2021-04-28 21:57:15 +08:00
William Cheng
37eaf70755 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-04-28 17:48:21 +08:00
Ayman Bagabas
0f5e7d1e3c
Swift5 models improvements (#9205)
* [swift5] Add useClasses to use `final class` instead of `struct`

* [swift5] Always include CodingKeys enum

* [swift5] Implement model equals and hash functions

* [swift5] Encode `null` values

* [swift5] Test `useClasses` in urlsessionLibrary

* [swift5] Add a required nullable prop test case to 2_0/swift/petstore*.yaml

* [swift5] Update samples and docs
2021-04-24 10:04:30 +08:00
William Cheng
ab688d4c3a
Update documentation (#9322)
* update doc

* update doc
2021-04-22 20:54:01 +08:00
Ayman Bagabas
33107c14de
[Swift5] escape reserved words (#9204)
* [swift5] `List` is not a Swift data type

* [swift5] Escape reserved words using backticks

https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID412

* [swift5] Update tests

* [swift5] Update samples and docs
2021-04-22 19:13:39 +08:00
Ayman Bagabas
3894aa4759
[swift5] Add useSPMFileStructure (#9074)
* [swift5] Add useSPMFileStructure

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>

* [swift5] Add swiftPackagePath

Prioritize swiftPackagePath over useSPMFileStructure

* [swift5] Add cli options and update docs

* [swift5] Fix tests

* [swift5] Update XcodeGen source path

* [swift5] Update samples and docs

Add useSPMFileStructure to URLSession library
2021-04-22 00:43:33 +08:00
Farshad Nematdoust
733a180a62
Add Go echo server codegen (#9224)
* Update codegen config

* Add templates for Go Echo openapi-codegen

* Add the yaml config file!

* Add GoEchoServerCodegen.java.
This is the first iteration, it works but probably needs a lot of improvements.

* Update codegen, adds some comments.

* Update GoEchoServerCodegen.java

* Update GoEchoServerCodegen.java

* Update GoEchoServerCodegen.java and related yaml file

* Add the result of generate-samples.sh for CI purposes.

* Add the result of bin/utils/ensure-up-to-date for CI purposes.

* Update go-echo-server-petstore-new.yaml
Fix the outputdir

* Update in regard to result of ./bin/generate-samples.sh

* Update in regard to result of ./bin/generate-samples.sh

* Remove wrongly generated files

* Add correct generated files.

* Add changes regarding /bin/utils/ensure-up-to-date

* Update templates to include comments.

* Update/add result of ./bin/generate-samples.sh and ./bin/utils/export_docs_generators.sh
2021-04-21 16:22:10 +08:00
Peter Leibiger
065c0281fa
[dart] Improve types & imports (#9167)
* [dart] Improve types & imports

* don't use importMapping as it is intended for something different that is not possible in dart
* introduce imports map for dart specific features
* always import `dart:core`
* get rid of additionalReservedWords
* fix `--type-mappings` not working
* use required type mappings in samples
* no longer define additional reserved words  as it is impossible to list all anyways, they can now be configured via type-mapping parameter
* simplify dio imports

* Don't use guava for map instantiation

* Update docs
2021-04-07 00:33:35 +08:00
William Cheng
c79d056935
Allow to specify response headers (needed for redirecting clients) (#9170)
* Allow to specify response headers (needed for redirecting clients) (#8148)

Co-authored-by: Bernardo Pastorelli <13519917+randomswdev@users.noreply.github.com>

* add addResponseHeaders option

* enable addResponseHeaders

* fix comma

Co-authored-by: randomswdev <randomswdev@users.noreply.github.com>
Co-authored-by: Bernardo Pastorelli <13519917+randomswdev@users.noreply.github.com>
2021-04-05 16:27:41 +08:00
Justin Black
6cc270633b
[python] Fixes additional_properties_type for models (#8802)
* Fixes additionalProperties values for models, updates docs, adds tag test of it, fixes frit and gmfruit tests

* Moves this.setDisallowAdditionalPropertiesIfNotPresent higher

* Makes setting additional_properties_model_instances contingent on the presence of addprosp in schema, updates sample spec composed schemas to remove addprops False form two

* Fixes oneOf anyOf allOf instantiation logic

* Removes Address from Cat definition

* Adds required vars for apple and banana, removes required vars from composed schema init sig

* Updates composed schema vars to be set on self and all composed instances

* Removes get_unused_args, get_var_name_to_model_instances, and get_additional_properties_model_instances

* Fixes fruit + deserilization tests, creates ComposedSchemaWithPropsAndNoAddProps

* Fixes FruitReq tests

* Fixes GmFruit tests

* Fixes discard_unknown_keys tests

* Samples updated

* Removes additionalproperties False in Child

* Samples updated

* Improves handling of v2 and v3 specs for isFreeFormObject, v2 sample spec updated with link to bug

* Adds cli option disallowAdditionalPropertiesIfNotPresent to python

* Adds getAdditionalProperties method so the value for addProps will be correct

* Reverts file

* Reverts file

* Updates python doc

* Reverted anytype_3 definition

* Updates test_deserialize_lizard

* Updates test_deserialize_dict_str_dog

* Updates testDog

* Updates testChild

* Adds v2 python_composition sample

* Adds needed files for python testing

* Adds existing tests into the new python sample

* Fixes test_dog

* Removes addProps false form Dog

* Fixes testChild

* Updates how additionalProperties are set

* Fixes empty_map type

* Type generation fixed for v2 and v3 specs

* Refactors getTypeString, updates artifactids in pom.xml files

* Adds new python sample to CI testing I think

* Fixes artifactId collision, regenrates docs
2021-03-31 08:48:12 -07:00
William Cheng
ab6c6962c2
add enum suffic support to rust client (#9107) 2021-03-29 11:40:26 +08:00
William Cheng
0e0dc3f26b update doc 2021-03-24 13:45:52 +08:00
Kam
f137f3331a
Add possibility to generate only files needed for sources compilation (#9012) 2021-03-24 13:27:25 +08:00
Peter Leibiger
3d038b74fd
[dart][dart-dio] Next-gen dart-dio generator (#8869)
* [dart-dio] Remove old Dart 1.x templates

* [dart-dio] Initial version of a next-gen Dart Dio generator

* Fix a couple readme links and examples

* Fix import in testcase

* Add integration tests to master POM

* Run initial dart format and improve some base formatting

* Generate docs

* Use integer matchers in test for content-length

* Separate more built_value specific files

* Fix mustache partial path

* Update pubspec template

* Fix tests after mock lib updates

* Generate with new built_value pre-release

This solves the problem of not being able to serialize null.

* Update built_value dependency

* Regenerate after merge

* Regenerate tests

* Fix missing byte response cast

* Update dio to 4.0.0-prev1

* Run format

* Ignore unused imports in inheritance classes

* Update mock test library

* Update docs

* Make a couple variables final

* Update and freeze dio dependency

* Update generator doc

* Add a new option to post processes all dart output at once

This is much faster than individual files. The committed samples should be formatted since Dart is very opinionated and it makes diffs in PRs much easier to read.
Due to this, we also need to format in CI, otherwise there is a git diff.

* Test some CI stuff
2021-03-20 12:26:56 +08:00
William Cheng
46326249d2
mark httpclient support as experimental (#9016) 2021-03-19 23:14:58 +08:00
Blackclaws
061b00e990
[csharp][aspnetcore] Update aspnetcore nuspec and csproj with authors and description (#8995)
* Update aspnetcore nuspec and csproj with authors and description

* Removed unneccesary include
2021-03-19 21:25:32 +08:00
Peter Leibiger
de8b344a34
[dart] Generic docs update and fixes (#8999)
* [dart] Generic docs update and fixes

* none of the dart generators supports XML
* jaguar is no longer maintained
* dart and dart-dio support bearer token
* none of the dart generators supports composition atm.

* [dart-dio] Supports customization of authorizations and userAgent

* Remove deprecation of dart-jaguar for now
2021-03-19 21:15:13 +08:00
agilob
c920d08b69
[dart] mark json_serializable as experimental (#8979)
* Hide json_serializable from public users

* Make json_serializable as experimental

* Update wording marking json_serializable as experimental
2021-03-19 21:11:22 +08:00
Adam Leventhal
15c3bf47a4
[Rust Client] several small fixes to code generation errors (#8845)
* fix cyclic types

* fixed up bad enum names

* fixed double crate:: issue

* add required ToString for enum classes

* Adds Debug/Clone derive macro for generated configuration type

* Updates versions of dependencies recorded in generated Cargo.toml

* fix merge

* bin/generate-samples.sh

Co-authored-by: Benjamin Naecker <bnaecker@fastmail.com>
2021-03-15 10:30:22 +08:00
Justin Black
8226269101
Fixes legacyDiscriminatorBehavior description (#8931)
* Fixes description

* Samples and docs updated
2021-03-08 13:39:12 -08:00
Internaional Network Support & Service - Glas
041d908963
Changed virtualan version from 1.0.0 to 2.1.7. Update readme.md and d… (#8910)
* Changed virtualan version from 1.0.0 to 2.1.7. Update readme.md and description in springboot generator.

* Updated virtualan link in spring.md.

* update samples

Co-authored-by: networkinss <oliver.glas@inss.ch>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-03-07 09:38:31 +08:00
delenius
7b5a583345
Make JS client case sensitive wrt. reserved words (#8905)
Fixes #8904
2021-03-06 18:40:06 +08:00
Oleh Kurpiak
976b4aa757
[Java] Additional enum type annotations (#8389)
* [Java] Additional enum type annotations

* [Java] Additional enum type annotations
2021-03-04 23:33:00 +08:00
Blackclaws
e815d7ced8
C# Netcore WebRequest and HttpClient functionality (#8821)
* Add switch to disable RestSharp

* Introduce CLI Option for webRequestLibrary

* Fix missing brace

* Remove restsharp references

* HttpClient added

* WebRequest NewRequest functionality added

* WebRequest added to CLIOptions

* Add custom HttpMethod only for Restsharp.

* Add WebRequestPathBuilder.mustache

* HttpClient NewRequest

* Add using Statement to WebRequestPathBuilder.mustache

* Adjusts retry configuration for HttpClient

* Reuse JsonDecoder

* Make reusing the client a separate option

* Save cookies in request

* Implement more methods for HttpClient

* Small fixes

* Fix post content

* Add new sample config

* Update existing samples

* Add new sample

* Add new property supportsRetry

* Use new property to exclude RetryConfiguration

* Exclude Polly on non supporting Retry

* Update sample and documentation

* Create HttpMethod Patch for netstandard 2.0 compatibility

* Fix query parameter generation

* Switch to library settings

* Allow httpclient reuse (experimental)

* Remove webrequest from template as its not used right now
2021-02-28 16:18:16 +08:00
Dheeraj Nalluri
264b017eec
[Java][Client] JSON-B serialization support (#8729)
* Added JSON-B support.

* Mention jsonb in docs
2021-02-27 15:32:46 +08:00
agilob
9fc33f6a73
[Dart] Add configuration to add new generators and add json_serializable (#8789)
* Add Dart configuration flag to set new generator

* Change templates to add json_serializable generator

* Fix dart tests

* Add custom serialization for standard generator

* this change opens us a way to allow adding more than 2 generators

* Add sample project for json_serializer

* Use basename for json field name

* Update samples with basename as json key

* Update dart generator docs

* Create AbstractDartCodegen class

* Update docs, dart-dio and dart-jaguar dont get json_serializable yet

* Deduplicate method calls

* Dix dart-dio generation

* Revert formatting change in dart mustache

* Fix formatting changes again

* Improve dart serialization documentation

specify default serializer

* Better name for cli option

* Rename default dart generator to 'native'

* Another attempt to reduce whitespace noise

* Fix api-client and api-helper

* Rename default serialization mode to include word serialization

* Remove trailing whitespace in enums
2021-02-25 17:11:16 +08:00
William Cheng
df1ae03960
[Refactor] create Python abstract class (#8817)
* create python abstract base class

* refactor AbstractPythonConnexionServerCodegen

* update doc
2021-02-25 14:10:49 +08:00
James Gilliland
f3c164d1ad
[PHP] Use a valid php type for maps (#8718)
* Use a valid php type for maps

* Convert type hint to correct format

Align map array format to that expected by phpdoc and associated tools.
2021-02-21 18:07:45 +08:00
Peter Leibiger
c916df9381
[dart][dart-dio] Nullable support/improvements (#8727)
* [dart-dio] Disable nullable fields by default

This is not in line with the OAS and will prevent future Dart nullabilty features (NNBD) from being useful as all types would be optional.
Users can still opt-in for this.

* [dart-dio] Properties are nullable when not required AND not nullable

* [dart][dart-dio] Support nullable/required fields

* properties in built_value need to be nullable when they are nullable in OAS or when they are not required in OAS
* built_value does not support serializing `null` values by default as it is based on a serialization format based on iterables/lists and not maps
* dart-dio uses the built_value json plugin to convert the built_value format to regular json
* by generating a custom serializer for each class we can add support for serializing `null` values if the property is required AND nullable in OAS
* this is a breaking change as not all properties in the models are nullable by default anymore

* Implement required/nullable for dart

* Changes for set types and enum names after rebase

* Add some comments and fix built_value fields with default being nullable

* More rebase changes and regenerate docs
2021-02-17 21:44:21 +08:00
William Cheng
55292dd22b
Add ASP.NET Core 5.0 support (#8717)
* add aspnet core 5.0 support

* skip overwriting Org.OpenAPITools.csproj

* update doc

* update doc
2021-02-17 18:58:13 +08:00
Patrick McGleenon
3c4015b897
[REQ] [GO] Added enumClassPrefix option to go-gin-server. Used same appro… (#8681)
* [REQ] Added enumClassPrefix option to go-gin-server.  Used same approach as #7008 (go-server)

	modified:   docs/generators/go-gin-server.md
	modified:   modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java
	modified:   modules/openapi-generator/src/main/resources/go-gin-server/model.mustache

* Fixed CI error in docs
2021-02-16 17:54:00 +08:00
basyskom-dege
578420cfa9
Finished paramter styling(query,path,header,cookie) (#8587) 2021-02-08 20:21:53 +08:00
Bruno Coelho
45fc02350b
[kotlin] fix Date types usages (#8594)
* [kotlin] fix Date types usages
2021-02-02 20:55:51 -05:00
Peter Leibiger
769b0e0e38
[feature][dart] Add support for uniqueItems/sets (#8375)
* [dart][dart-dio] Add support for set types

* copy `uniqueItems` usage from 2.0 fake spec to `3.0`
* add support for sets in parameters, responses and properties

* Regenerate all other samples

* Fix broken tests due to invalid cast

* Update documentation

* Regenerate samples

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-02-02 18:42:45 +08:00
Matthew Dowdell
b4154be8d0
[Rust Server] Add support for Bearer token authentication (#7840)
* [rust-server] Add support for Bearer auth

- Added bearer auth to the security features for rust server
- Supplemented the basic auth condition in the context template to handled basic auth and bearer auth separately.
- Repurpose an exising sample to confirm the code generation works as expected.

* Update docs

* Update readme for bearer tokens
2021-01-30 12:07:46 +00:00
Petr Tůma
061552f5d4
[feature][python-flask] Add CORS support to python-flask server (#8472)
* Add CORS support to python-flask server generator

* Documentation update and CORS support for other generators using the same base class

* Trivial sample changes
2021-01-29 10:54:02 +08:00
William Cheng
f6c617d09f
Add typescript-nestjs client generator (#8522)
* #3336 add nestjs generator

* #3336 add nestjs generator

* #3336 add nestjs generator

* #3336 add nestjs generator

* remove extra files from building

* Revert "remove extra files from building"

This reverts commit 7f80f961ef0cd0e50b9d2bb856a3703d5b821640.

* fix merge

* fix tests

* Add missing test client options provider for nestjs

* cleanup PRS

* fix compilation error

* remove groovy bin files;

* fix tests

* add samples

* update doc

* update samples

Co-authored-by: Victor Frank <vfrank@lumeris.com>
2021-01-26 09:34:33 +01:00
William Cheng
84813be309
remove supportJava6 option (#8514) 2021-01-26 10:27:09 +08:00
basyskom-dege
c55bee1273
[Qt][C++] Updated cpp-qt5-client doc (#8251)
* Update cpp-qt5-client.md

Added missing security feature support in the documentation

* added missing security features in doc
2021-01-25 18:26:47 +08:00
Antonio
cb530d4e75
Add .t in spec generation of Elixir structs (#8159)
* Add .t in spec generation of object types

* update samples

* Adds workaround for free-form maps with propper typespec

* Adds missing typsspec definition for structs

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Michael Ramstein <mr@cyon.ch>
2021-01-25 16:13:23 +08:00
Richard Whitehouse
5f2ca61862
[Core, Rust Server] anyOf / oneOf support for Rust Server (#6690)
* [Core] Inline Model Resolution of Enums

Enums need to be named types, so handle them as part of inline model resolution

* [Rust Server] Handle models starting with a number correctly

* [Rust Server] Additional trace

* [Rust Server] Add support for oneOf/anyOf

* [Rust Server] Update supported features

* [Rust Server] General template tidy up

* [Rust Server] Implement IntoHeaderValue for wrapped data types

* [Rust Server] Convert from string correctly

* [Rust Server] Test for anyOf/oneOf

* Update samples

* Update docs
2021-01-23 21:32:51 +00:00