345 Commits

Author SHA1 Message Date
Tino Fuhrmann
03ee3b2f1a Updated typescript docs 2020-05-05 22:58:04 +02:00
Tino Fuhrmann
934f226098
[TS-Refactor] Top-level exports for fetch & jquery (#6138)
* Added top-level exports
* Updated generator README
* Updated typescript generator docs
2020-05-04 23:58:38 +02:00
Bodo Graumann
9afb8ff12a Typescript refactor: Platform select for browser and node (#4500)
* Use string form of filename parameter

This works for the form-data library and is also compatible with the
browser FormData object.

* Add new option to select platform node or browser

When no platform is selected, a default is chosen by the framework
option and likewise the file data type option is implied by the
platform.

* Remove redundant import of node dns module

* Only use form-data library for node platform

* Generate npm package from npmName option

* Use method convertPropertyToBooleanAndWriteBack

* Generate typescript samples with ensure-up-to-date
2020-04-27 00:57:36 +02:00
Bodo Graumann
0000342d77 Typescript refactor: stub rxjs (#4424)
* Remove unused supportsES6 field from codegen

* Add a new switch for RXJS

* Remove redundant npm dependency on rxjs4 types

* Fix return type of PromiseMiddleware methods

* Install webpack dependency to run jquery tests

* Update form-data to 2.5 which includes typings

* Add missing dependency on node typings

* Fix test artifact name typo

* Stub rxjs when it is not explicitly enabled
2020-04-27 00:54:36 +02:00
Bodo Graumann
0f3ad99d72 Refactor typescript merge master (#4319)
Merge master into ts-refactor
2020-04-27 00:54:36 +02:00
Tino Fuhrmann
4f461f948a Updated typescript docs 2020-04-27 00:09:32 +02:00
Tino Fuhrmann
495ce938f8 Updated docs 2020-04-27 00:09:31 +02:00
Tino Fuhrmann
99c3dceae7 Added typescript to docs/generators 2020-04-27 00:09:18 +02:00
Justin Black
8e8471c1fd
[CORE] Fixes composed schema discriminator map (#4906)
* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Switches two methods to package private because they are needed for testing

* Allow nulls in MappedModel.getMappingName

* Updates CLI flag name to legacyDiscriminatorBehavior, default=true

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-25 00:01:02 +08:00
William Cheng
93dd4a5138
Add jersey2-experimental to Java client generator (#6024)
* add jersey2 experimental

* add new files

* add abstract one of class

* read the stream multiple times

* rename to getActualInstance

* update petstore

* fix jackon check

* test new java petstore in ci

* fix broken tests

* remove todo

* better exception message, primitive type handling

* add anyof support

* update samples

* add new files

* update all java client samples

* update doc, fix pom

* better null check for allOf

* add primitive types support in oneof, anyof

* better validation

* update python exp samples

* remove primitive type support in allOf
2020-04-24 12:47:25 +08:00
Harald Fernengel
b431d65099
Make "Index" a reserved word (#6000)
Some APIs have a model called "Index" which would create a file
"Index.ts" which would override "index.ts" on case-insensitive file
systems (e.g. macOS, some Windows versions). Make "Index" a reserved
word to prevent this clash.
2020-04-22 14:24:42 +02:00
Sebastien Rosset
8af6b7459c
[Java] Discriminator lookup should not be case insensitive by default (#5894)
* Add 'discriminatorCaseSensitive' property

* Discriminator value lookup should not be case insensitive

* fix typo

* run scripts

* execute ./bin/utils/export_docs_generators.sh

* fix discriminator mapping, add code comments
2020-04-13 18:54:00 +08:00
Jochen Schalanda
e82546f342
Update generated build files for REST Assured (#5873)
* REST Assured 4.3.0
* Jackson 2.10.3
* Gson 2.8.6, GSON-Fire 1.8.4
* Okio 1.17.5
* Joda-Time 2.10.5
* ThreeTenBP 1.4.3
* Added missing dependencies for Bean Validation
* Added missing dependencies for `@Generated` annotation
* Refresh REST Assured sample project
2020-04-12 23:36:18 +08:00
Artem Shubovych
62c346f8da
[enhancement] [jaxrs-spec] Add builders to models (#4930)
* Update formatting in jaxrs-spec POJOs

* Add generateBuilders option

* Update formatting in jaxrs-spec POJOs

* Disable the builders generation by default

* Ensure samples are up-to-date

* Revert newline change

* Run ensure-up-to-date

* update doc

* fix merge conflicts

Co-authored-by: Artem Shubovych <ashubovych@atlassian.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-12 17:27:34 +08:00
Yuriy Belenko
1c51d4138e
[mysql] Add basic SQL queries (#5757)
* Add basic SQL queries template

* Add namedParametersEnabled option

* Move model related SQLs into Model folder

* Update README template

* Refresh samples
2020-04-12 16:49:50 +08:00
William Cheng
b477341d94 update ps doc 2020-04-10 22:11:10 +08:00
William Cheng
6c153bd079
[C#] dependency upgrade (#5870)
* Updating packages version (#5313)

* Add support to RestSharp version 106.10.1

Restsharp 106.10.1 needs the Content Lenght as a parameter to AddFile method

* Updating RestSharp Version

Updating RestSharp Version

* Update netcore_project.mustache

* Update netcore_testproject.mustache

* Update Project.mustache

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Execute task async obsolete

Use ExecuteAsync instead

* update csharp samples

Co-authored-by: William Cheng <wing328hk@gmail.com>

* [csharp] Library upgrade fix (#5848)

* On .net45 framework, Restsharp version is updated to 106.10.1 Otherwise, it stays on version 105.1.0

* Added additionalProperties for library versions and target frameworks

* Removed unused properties

* Added an additional property to test for a specific version of RestSharp

* Updated csharp samples

* Fixed nuspec.mustache to use library specific additional properties

* Updated csharp samples

* Updating CI/samples.ci csharp petstore test project file.

* Updated csharp.md

Co-authored-by: Olivier Leonard <oleonard@ankama.com>

* [csharp-client] Restored tests on csharp samples (#5879)

* Restored tests on csharp samples

* Restored a reference to the file used to test file uploads

Co-authored-by: Olivier Leonard <oleonard@ankama.com>

* update samples

Co-authored-by: Igor Quirino <iquirino91@gmail.com>
Co-authored-by: Bouillie <34162532+Bouillie@users.noreply.github.com>
Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-10 15:08:34 +08:00
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
Jim Schubert
e14e5fccf3
[cli][docker] Better expose version/sha information of builds (#5736)
* [cli] Some CLI improvements…

* Introduce --version
* Introduce --help
* Add --sha to version command for short SHA display
* Output Version and SHA details
* In new --version output, display repo and doc site

Additional cleanup to suppress warnings and code quality.

* [docker] Adds labels for metadata

This adds image labels to store metadata on the online and cli docker
images, using standard labels:

* org.opencontainers.image.created
* org.opencontainers.image.revision
* org.opencontainers.image.title
* org.opencontainers.image.version

These can be inspected via 'docker inspect IMAGE_NAME' and may be useful
in tooling/automation or bug reports submitted by users.

For more details on these labels, see:
https://github.com/opencontainers/image-spec/blob/master/annotations.md

* Include version --full for equiv to --version
2020-04-02 11:05:25 +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
c224cf484b
4.3.0 release (#5721) 2020-03-27 11:34:43 +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
William Cheng
9f70b7ac70 update doc 2020-03-11 01:11:47 +08: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
William Cheng
4603061c17
[Scala][sttp] various improvements (#5475)
* various improvements to scala sttp

* update ScalaSttpClientCodegen.java

* add windows batch file

* test scala sttp in jdk8

* fix tempalte directory
2020-02-29 00:34:46 +08: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
Johnny Peck
6ad9fbc9a6
Update usage.md (#5443) 2020-02-26 14:25:00 +08: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
056a3ec0f6
[K6] minor improvements (#5368)
* update readme

* minor improvement

* add windows batch file for k6

* update template to reference openapi-generator

* update samples

* update doc
2020-02-20 09:25:11 +08:00
William Cheng
6cd3fc5429 add new doc for k6 2020-02-19 16:21:02 +08:00
William Cheng
ce53f43771 update generators doc 2020-02-19 16:13:12 +08:00