684 Commits

Author SHA1 Message Date
Jacob Floyd
469b21830c
Add pythonSrcRoot option to python servers (aiohttp/flask/blueplanet) to support src/ layout projects [and reenable/fix all python server tests] (#5423)
* python server: Add pythonSrcRoot option

This will allow the python project to be in a subdirectory (as specified
in pythonSrcRoot). That could mean following the src layout with sources
under src/ or lib/. Multi-language projects might use a sub directory
like python/, or whatever makes sense for the project.

By default, the pythonSrcRoot is "", meaning the existing behavior is
the default.

* python server: update template files to support pythonSrcRoot

* python server: update docs to add pythonSrcRoot option

* python server: add pythonSrcRoot sample script

* python server: build sample srclayout project

* [Python] copy test files preserving history

* [Python] Make a conflict to preserve file copy history

* [Python] customize pom.xml for src layout tests

* [Python] add python-aiohttp-srclayout tests

* [Python] Fix server tests by updating requirements

Reverts the PR that disabled python2 server tests:
https://github.com/OpenAPITools/openapi-generator/pull/4949

Reverts commits that disabled python3 server tests:
9adfedbfbb45c7059e64b3d9a285710bded4fb62
17ee990baaa80585242c7a07d64e2be4888fcfd0

Issue about the python 3 tests:
https://github.com/OpenAPITools/openapi-generator/issues/5235

I couldn't find an issue about the python2 tests being disabled.
I'm guessing build errors like the following were the trigger:
https://travis-ci.org/github/OpenAPITools/openapi-generator/builds/634238181

Let's see what breaks!

* [Python] Copy setup.py to python-aiohttp

* [Python] Save history while copying setup.py to python-aiohttp

* [Python] Add aiohttp server setup.py

* [Python] Fix python server tests with src layout

* [Python] bump Flask-Testing version

* [Python] Pin pyyaml for py2.7 flask server

* [Python] simplify flask server requirements

* consolidate server tests

* [Python] rebuild python server samples

* [Python] Fix python server requirements for older pythons

Documented minimum python version for our aiohttp server is 3.5.
Documented minimum python version for our flask server is 3.4.
Connexion 2.3 is the last version to support python 3.4 and 3.5, so fix
the version pinning to correctly select <=2.3 for these EOL python
versions. Newer pythons should get the latest if possible as there many
relevant bug fixes.

Werkzeug also needs to be pinned for these old versions in the aiohttp
server just like for the flask server.

3.4 and 3.5 are EOL. We really should increase the minimum supported
version, but that is for another PR to do.
2020-04-07 23:14:13 -07:00
William Cheng
52018c43ba
Minor improvements to scala akka server (#5823)
* minor improvements to scala akka server

* add samples

* update doc
2020-04-05 10:09:31 +08:00
Bouillie
af85fab52b
Scala akka-http server (#5758)
* Scala akka-http server base implementation

* [scala-akka-http-server] petStore samples

* Improved the formatting of generated files

* Updated scala-akka-http server samples

* [scala-akka-http-server] the groupId, artifactId and artifactVersion default value are used as intended.

* Fixed the default operation not being correctly generated on parameterless operations

* Added build.sbt.mustache supporting file

* Updated scala-akka-http server samples

* ScalaAkkaHttpServer: Fixed a String.format call to use Locale.ROOT for locale

* [scala-akka-http-server] Fixed defaultValue being escaped during generation

* Added scala-akka-http.md

* Replaced all "⇒" character with "=>" to retain compatibility with scala 2.13

* [scala-akka-http] Added a config option akkaHttpVersion
It's set in the generated build.sbt.

* Updated scala-akka-http server samples

* [scala-akka-http] More accurate akkaHttpVersion parsing

* Updated scala-akka-http.md

* [scala-akka-http] Changed the akka-http version check to fix the generation of StringDirectives

* Updated scala-akka-http samples

* updated scala-akka-http.md

Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-04 23:16:14 +08:00
William Cheng
4623ec86d3
[PS][Experimental] Better common verb handling (#5783)
* better common verb handling

* better debugging

* add option to customize common verb
2020-04-02 08:19:16 +08:00
William Cheng
77c1907f51
better readme, type mapping, new option (#5740) 2020-03-29 14:33:42 +08:00
William Cheng
7a01062a41
Minor improvments to JS apollo generator (#5714)
* minor improvments to js apollo generator

* comment out apollo
2020-03-26 21:03:49 +08:00
Erica Kastner
ce49fe587f
Generator for JavaScript/Apollo Client (#5645)
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-03-26 17:02:44 +08:00
Sebastien Rosset
2c1ca02b61
[codegen][Go] Fix compilation error of generated go code when schema is free form object (#5391)
* Fix code generation for free-form objects in go-experimental

* Execute scripts in bin directory

* Add more use cases for open-ended types

* Add more use cases for open-ended types

* Add more use cases for open-ended types

* add code comments

* Better name for test properties

* handle scenario when type is arbitrary

* handle interface{} scenario

* handle interface{} scenario

* add helper function isAnyType

* isAnyType function

* implementation of isAnyType function

* fix javadoc issue

* handle interface{} scenario

* use equals comparison instead of ==

* merge from master

* Add code documentation

* add code comments, remove unused min/max attribute, fix equals method

* Handle 'anytype' use case

* add code comments

* override postProcessModelProperty to set vendor extension

* Use vendorExtensions.x-golang-is-container

* fix compilation error of generated code

* fix compilation error of generated code

* fix compilation error of generated code
2020-03-26 16:40:34 +08:00
William Cheng
457aff8496
[Powershell] refactor the client generator (#5629)
* add api client

* add local variables

* add configuration

* add header/query/form parameter support

* add partial header

* add auth, fix parameters type

* fix accept, content type

* url query string

* fix path, header

* remove dep on C# client

* fix method naming with package name

* fix object

* convert result from json

* better response handling

* remove tostring method

* fix model doc

* fix default module

* generate api test files

* better api, model tests

* fix add pet

* add appveyor

* fix accept, content type

* add petstore tests

* fix form parameters

* test delete

* better file handling (upload)

* better code sample

* add package version, better doc

* delete unused files

* fix header parameters

* clean up api client

* update samples

* support query parameter

* better method and parameter naming

* minor formatting change

* better doc, fix cookie parameter

* better doc

* add api prefix support

* better api nam prefix option

* fix configuration

* throw errors for required parameter

* fix authentication

* add try catch block to sample code

* rename model

* use debug, clean up comment

* revise code

* move bin script

* update doc

* add new file

* better map support
2020-03-19 15:53:11 +08:00
wing328
05cb1f88d1 Merge branch 'master' of https://github.com/OpenAPITools/openapi-generator 2020-03-17 16:03:26 +08:00
wing328
691c46e2f5 update doc 2020-03-17 16:02:31 +08:00
Aleksandr Nekrasov
5beccd12b6
[scala][templates] java 8 dates support (#5291)
* [scala][akka-http-client] java8 dates support

* scala-akka readme doc updated

* DateSerializers renamed

* rename serializers

* move date-library option to abstractScala

* generators docs updated

* enum defined for date libraries

* Backport to scala-http-client

* fix scala-akka-client date serializers

* fix typo in docs

* switch scala templates to java8 (jsr-310) date library by default

* update scala samples with java8 date library

* update scala generators docs with java8 default date library

* fix scala-play-server generator cli options as only java8 dateLibrary supported

* fix scalaz DateTimeCodecs template to support java8

* scalaz ci test againt java7 removed as it generate scala 2.11.8 client which is java8 based
2020-03-17 15:54:24 +08:00
Bruno Coelho
fe02dfe196
[swift] add option for API prefix (#5567)
* [swift] add option for API prefix

* [swift] update docs
2020-03-13 22:08:51 +08:00
Richard Whitehouse
b60fc900b2
[Rust Server] Support OpenAPI v3 callbacks (#5405)
* [Rust Server] Support Callbacks

* [Rust Server] Support callbacks in the examples

* [Rust Server] Update features documentation

* [Rust Server] Mark as supporting callbacks

* Update samples

* [Rust Server] Add tests for callbacks

* [Rust Server] Fix README

Don't suggest examples which don't exist
2020-03-07 19:24:42 +00:00
Aleksandr Nekrasov
a5c5b2f6d0
[BUG][scala][template] scala generate java.math.BigDecimal instead of scala type (#5514)
* [BUG] scala generate java.math.BigDecimal instead of scala type

* update docs/generators
2020-03-04 16:55:32 +08:00
Aleksandr Nekrasov
6dd76d65e7
[scala] [template] scala model property style (#5486)
* Model property naming style generic for scala

* scala templates based on abstractScala regererated

* docs generators updated

* property format tests
2020-03-02 11:48:09 +08:00
Mateusz Szychowski (Muttley)
4c6648f1a9
[C++] Add an option to allow having lowercase variables in models, Pistache: allow using reservedWords in models (#5434)
* [C++][Pistache] Use reserved words to replace incorrect names

discard old decision to truncate reservedWords

* [C++][Pistache] Update struct model to use name instead of baseName

* [C++][Pistache] Update Petstore sample

* [C++] Add option to have lowercase variables

* [C++] Update generated docs
2020-03-01 12:39:45 +01:00
Aleksandr Nekrasov
84250973be
[scala] strip model class name for all scala generators (#5439)
* stripped parameter enabled for all scala based generators

* scala samples updated

* docs generators updated

* fix scalatra. regenerated by openapi3 script.
manually removed enum default value from scalatra example due bug in schema extraction
2020-02-28 20:44:02 +08:00
Aleksandr Nekrasov
40cbbbfefd
[scala] [template] scala sttp client (#5429)
* scala-sttp-client template

* invoker for sttp fixed and tests added

* clean up pet api test from redunant comments

* docs updated

* fix artefact name, model comments and redunant generic

* code optimization

* cross scala versions 2.11 2.12 2.13

* date serializers extracted and joda enabled as default

* basic and bearer authorization added, apikey in query supported
2020-02-28 15:48:55 +08:00
Alexey Makhrov
0edb628633
[typescript] Clean up modelPropertyNaming across generators (#5427)
* [typescript] Clean up modelPropertyNaming across generators
Fixes https://github.com/OpenAPITools/openapi-generator/issues/2976

Generators without runtime models conversion use "original" property naming by default. It's still possible to change it via cli options

Generators with runtime conversion keep using "camelCase"

* Refactoring: use enum instead of string for modelPropertyNaming

* Restore the original camelCase for var names, decouple it from property names

* Swap toParamName and toVarName logic (looks like I've mistaken them)

* Regenerate docs

* Remove a no longer used private method
2020-02-28 07:31:19 +01:00
Herve DARRITCHON
f6ef4fbec7
[kotlin][client] Add Jackson as serialization library (#5236)
* [kotlin][client] Add Jackson as serialization library

* [kotlin][client] Add kotlin-client-jackson.sh to kotlin-client-all.sh

* update kotlin client samples

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-02-25 23:41:09 +08:00
Alexander Weaver
04cad77caa
Add reserved word option to Pistache and Restbed generators (#5418)
* Add reserved word option to Pistache and Restbed generators

* Regenerate docs
2020-02-25 10:37:43 +08:00
Alexander Weaver
231ec6bcac
[BUG][C++] Avoid using plain underscore when escaping reserved words (#5269)
* Don't use plain underscore when escaping reserved words

* Regenerate petstore output

* Add CLI option for reserved word prefix

* Ensure CLI option isn't cleared in cpprest client codegen

* Regenerate docs
2020-02-24 21:24:43 +08:00
Åsmund Grammeltvedt
23e76f2a50
[typescript] Add ReadonlyArray to native types (#5399)
* [typescript] Add ReadonlyArray to native types

This allows mapping the array type to TypeScript's ReadonlyArray

* Update docs

* restart travis
2020-02-24 11:13:13 +01:00
Jim Schubert
e4823cf4e6
[go][java] Document new parameterized server support (#5380)
* [go][java] Document new parameterized server support

* [java] Regenerate samples
2020-02-22 20:06:38 -05:00
topce
fa5beeecd0
typescript-angular: support angular 9 (#5370)
* fix code to support ng9
also render in tempate module with providers

* execute script .\bin\windows\typescript-angular-petstore-all.bat
and commit result

* re-generate samples

* remove whitespace, re-generate samples

* re-generate samples

* code cleanup

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-02-20 13:50:26 +01:00
William Cheng
6cd3fc5429 add new doc for k6 2020-02-19 16:21:02 +08:00
William Cheng
edd7cab22a
[Java] mark Feign 10.x (instead of 9.x) as the default (#5310)
* set feign 10x as default, mark 9x as deprecated

* update doc
2020-02-14 13:58:44 +08:00
William Cheng
bca130cd1f update rust doc 2020-02-13 20:41:45 +08:00
Simon Alling
58006982a8
Fix typo: "default GitHub in PRs" (#5302) 2020-02-13 15:04:05 +08:00
Jim Schubert
aa7cd4f5af
[docs] Upgrade to Docusaurus 2 (#5271)
* [docs] Upgrade to Docusaurus 2

Due to formatting issues with Docusaurus 1 and code blocks, and upcoming
4.3 and 5.0 releases, this is an upgrade to have more control over
formatting and other functionality.

This adds behavior to have light/dark themes.

As a consequence of upgrading, columnar format on ul element in
generated generator docs had to be moved to css. This will not impact
users viewing the markdown on GitHub because it didn't display the
column format.

This upgrade should improve syntax highlighting and performance.

* Fix user page layout, choose theme with clear diff colors
2020-02-11 21:22:58 +08:00
Åsmund Grammeltvedt
a8015ad8c1 [typescript] Make additional properties access safer (#5207)
* [typescript-fetch] Make additional properties access safer

Instead of asserting that any key access returns a valid property, force
the consumer to check that the value is defined.

* Update tests

* Put null-safe additional props behind and flag and share

* Undo over copy

* Update docs

* Rearrange code

* Move to unit tests
2020-02-10 07:47:29 +01:00
Jaroslaw Zawila
561335f5e5
Add support for bearer token scala-akka #5067 (#5069)
* Add support for bearer token scala-akka #5067

* Update api.mustache

Include master's isKeyInCookie support

* [scala-akka] Update bearer token feature in doc

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
Co-authored-by: Jaroslaw Zawila <jaroslaw.zawila@gmail.com>
2020-02-08 17:08:45 -05:00
William Cheng
19acd36e3a update samples 2020-02-04 16:39:04 +08:00
William Cheng
100b01844a Merge remote-tracking branch 'origin/master' into 5.0.x 2020-02-04 15:31:10 +08:00
Jim Schubert
a496c2011f
[docs] Initial FeatureSet generator documentation (#5188)
* Flatten feature sets for display

* [cli] Add feature set output to config-help

This includes markdown and plain text outputs for config-help.

* [docs] FeatureSet on generator docs
2020-02-01 20:51:55 -05:00
Alexey Makhrov
e32a2f0121
[typescript] Append enum suffix without model suffix (#5138)
* [typescript] Generate enum name independently on model name, ignoring modelSuffix

* Add `enumSufix` cli option for all typescript generators

* Add ENUM_NAME_SUFFIX to to TypeScript***ClientOptionsProvider

* Add a typeMapping for OAS2 built-in "file" type

* Re-generate samples

* Introduce `v4-compat` mode for enumNamePrefix

* Update TypeScriptFetchModelTest - make sure codegen options are processed before running assertions

* Regenerate samples

* Regenerate docs

* Regenerate docs
2020-01-31 12:17:22 +01:00
William Cheng
03a59046f4 Merge remote-tracking branch 'origin/4.3.x' 2020-01-31 19:00:28 +08:00
Alexey Makhrov
f0d92bb0c1
[typescript] Introduce "enumPropertyNaming" option (#5162)
* Add enumPropertyNaming option to typescript generators

* Regenerate docs

* Add Locale.ROOT to toUpperCase() call

* Use actual enum values in an error message, instead of hardcoding them

* Add tests for "UPPERCASE" and "snake_case" enum var namings

* Add LOCALE.ROOT to String#format call
2020-01-31 07:56:18 +01:00
Justin Black
a51d02ac61
[Python] Fix #5126 operations with req enums of length one (#5129)
* Updates ap.mustache for python-experimental, adds test test_test_endpoint_enums_length_one

* Removes sortParamsByRequiredFlag from python-experimental

* Removes duplicate params from docstring
2020-01-29 10:10:41 -08:00
Tatsuro Shibamura
e27700cfee
[csharp-netcore] Support .NET Core 3.0/3.1 and .NET Standard 2.1 (#5111)
* Add .NET Core 3.x / .NET Standard 2.1

* Fixed test project target framework

* Fixed missing sync property

* Update generator docs
2020-01-29 16:50:06 +08:00
Bernd Hacker
45f26fe0bd [typescript-rxjs] performance improvements, bugfix for falsy parameters (#4250)
* perf(typescript-rxjs): remove redundant check when building auth header

* feat(typescript-rxjs): destructure request parameters, add throwIfNullOrUndefined helper, build query object more efficently

* fix(typescript-rxjs): change form checks back from null to undefined

* feat(typescript-rxjs): regenerate samples

* feat(typescript-rxjs): add hasRequiredQueryParams flag for improved query object generation

* feat(typescript-rxjs): remove trailing comma in param destructuring, improve formatting via hasOptionalQueryParams flag

* feat(typescript-rxjs): remove useless generics in BaseAPI

* feat(typescript-rxjs): regenerate samples

* feat(typescript-rxjs): extend CodegenParameter by output.paramNameAlternative and output.paramNameOrAlternative

* refactor(typescript-rxjs): remove obsolete reservedWords RequiredError and exists

* feat(typescript-rxjs): add reservedParamNames list with headers, query and formData, extend param processing

* feat(typescript-rxjs): use paramNameOrAlternative in api template

* refactor(typescript-rxjs): replace paramNameOrAlternative prop with mustache partial

* refactor(typescript-rxjs): reduce branching in configuration's apiKey() and accessToken()

* refactor(typescript-rxjs): remove unused ModelPropertyNaming

* feat(typescript-rxjs): regenerate samples

* feat(typescript-rxjs): remove CodegenParamter's paramNameAlternative, use vendorExtensions instead

* docs(typescript-rxjs): regenerate readme
2020-01-27 09:31:36 +01:00
Sai Giridhar P
6a228e8006 [csharp-netcore] Adding additional package metadata (#5065)
* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding other package metadata fields

* fix(csharp-netcore): Adding other package metadata fields

* fix(csharp-netcore): Adding other package metadata fields

* fix(csharp-netcore): Minor fixes

* fix(csharp-netcore): Updating example projects

* fix(csharp-netcore): Removed carriage return

* fix(csharp-netcore): Removed carriage return
2020-01-21 22:10:33 +08:00
sunn
a1d21f6d3a
[C++] [Qt5]Add support for response compression and add response body to error s… (#5060)
* Add support for response compression and add response body to error string

* Improve robustness while parsing quality and compression levels
2020-01-21 12:11:43 +01:00
William Cheng
82e2448bf2 Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2020-01-20 15:46:13 +08:00
William Cheng
04af5e0445 Merge remote-tracking branch 'origin/master' into 4.3.x 2020-01-20 15:04:34 +08:00
Jim Schubert
644f720db8
[docs] Sorted doc outputs and clean up duplicated CliOptions (#5046)
* [config-help] Sort all outputs

* Remove old/stale generator docs (these have been renamed previously)

* Sort config doc outputs, making it easier to find relevant info

* Fixes cliOptions duplicates

Erlang client/proper improperly set the version option as packageName
(causing duplicate for packageName).

The java and swift option removals are because the options are added in
parent classes, resulting in duplication of the options.

* Add --github-nested-index for generating docs/generators/README.md

* 📝 Regenerate generator docs
2020-01-19 20:19:11 -05:00
Erik Timmers
b62fc1c031 Elm refactoring (#4891)
* [elm] Remove support for Elm 0.18

* [elm] Drop `Main.elm`

* [elm] Put all models in a single file

* [elm] Put generated code in `Api` package

* [elm] Introduce Request type for operations

* [elm] Generate list of enum variants

* [elm] Make default Time module

* [elm] Small improvements & fixes

* [elm] Improve support for allOf

* All of types are now nested;
* Adding a discriminator creates a custom type wrapping all variants
  and a 'catch-all' fallback variant.

* [elm] Add support for recursive types

* [elm] Add catch-all type for allOf

* [elm] Drop support for post-processing of files

* [elm] Only import required packages

* [elm] Handle reserved and unsafe words

* [elm] Minor improvements

* [elm] Add support for integer enums

* [elm] Remove additional slash in path

* [elm] Add link to docs

* [elm] Update CI test file & scripts
2020-01-10 17:12:33 +08:00
Steve Porter
75508f5ce0 Add npmRepository option to javascript generators (#4956) 2020-01-10 17:02:50 +08:00
Jim Schubert
a2532cc3c5
[doc] full generator details (#4941) 2020-01-08 21:54:05 -05:00