Commit Graph

7216 Commits

Author SHA1 Message Date
davidwcarlson
7ab73ff587 Instantiate HttpBearerToken authentications if so declared and add helper methods. (#2485) 2019-03-27 14:07:43 +08:00
William Cheng
1c1c1ef9c3
Fix Kotlin default value (#2513)
* fix kotlin default value

* fix test cases
2019-03-27 14:04:52 +08:00
Mathieu Lemoine
81c57eefd5 [BUG][Kotlin Client] API using case other than camelCase not generated properly (#2391)
* Add Json import for all data classes

* Add `@Json` annotation for data class required variables

* Add `@json` annotation for data class optional variables

* Update samples code (petstore, strings, threetenbp)

* Fix annotation to match Kotlin coding style
2019-03-27 09:59:39 +08:00
Michael Stummvoll
6e7c621629 Fix JavaDoc errors in ApiClient for resttemplate (#2515) 2019-03-27 09:58:56 +08:00
Jaumard
41b5d0e8fc [Dart][Jaguar] and proto serialization support (#1793)
* add proto format support for jaguar generator

* Add openApiType to CodegenProperties
Finish proto generation
2019-03-27 09:48:09 +08:00
William Cheng
09d27e82e7
Minor enhancements to Scala Play server generator (#2512)
* minor enhancements to openapi-generator

* update doc

* remove oudated doc
2019-03-27 09:47:47 +08:00
Vincent Devos
d795c4e9d0 [TypeScript Client] fix npm version when snapshot is true and npmversion is snapshot too (#2401) 2019-03-27 00:03:24 +08:00
William Cheng
d4244be654
fix scala akka return type (#2510) 2019-03-26 18:54:09 +08:00
William Cheng
5a6f4cb4a9
Update Java Vertx client dependency (#2507)
* update java vertx client dep

* update java client description

* update sample
2019-03-26 18:52:34 +08:00
Andy Bao
5d05cc0e66 Fix body serialization in javascript-flowtyped generator when body is falsy (#2499) 2019-03-26 18:23:23 +08:00
Adi Gerber
28ae33cb13 New generator - Scala Play Framework (#2421)
* Added new generator for Scala + Play Framework (WIP)

* scala-play-framework: default values reintroduced (mostly); datatype -> dataType

* reintroduced missing EOF newline

* Support single/collection params for header/query params

* Rename apiFutures > supportAsync, implStubs > skipStubs (opt-out instead of opt-in)

* Deleted license and small fixes

* Generate extraction of form parameters from request body

* Added missing call to executeApi for unit methods when supportAsync=false

* Polished some stuff and added routes, application.conf, logback.xml, better default responses

* Disabled generation of Json.format for models with files

* Added README

* Multiple additions and improvements.

- Fix Indentation using mustache lambdas
- Option to set routes file name (default: routes) - allows uninterrupted manual maintenance of main routes file, which may include a subroute to the generated routes file
- Move supporting file classes to a package and update application.conf generation accordingly
- Option to generate custom exceptions (default: true) which are used in the controller to differentiate between API call exceptions and validation exceptions
- Generate error handler with basic exception mapping
- Option to generate API docs under /api route
- Reorder routes file so parameter-less paths are given priority over parameterized paths. Prevents case like /v2/user/:username activating before /v2/user/login (thus shadowing the login route completely) as observed using v3 petstore.yaml
- Option to set base package name (default: org.openapitools) to allow placing supporting files under a different package

* Revert supportAsync default to false

* Added binaries and default api/model packages

* Added scala-play-framework sample

* Add missing contextPath to README and controller comment
2019-03-26 16:04:48 +08:00
dragosnutu
9e391efd1d [#2442] - implement yamlsample config help output; (#2443) 2019-03-26 15:22:59 +08:00
Gocha Ossinkine
3677bdcfc7 Replace deprecated Controller with new one (#2146) 2019-03-25 22:07:40 +08:00
Alok Prateek
3810d12086 [#2441] Update documentation mustache templates for proper linting. (#2458)
* [#2441] Update documentation mustache files for PHP client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* [#2441] Update documentation mustache files for ruby client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* [#2441] Update documentation mustache files for javascript client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* [#2441] Update documentation mustache files for Java client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* [#2441] Update documentation mustache files for GO client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* [#2441] Update documentation mustache files for Rust client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* [#2441] Update documentation mustache files for C# client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* [#2441] Update documentation mustache files for Android client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
Issues with generated markdown files as reported by markdownlint for node.js are:

- MD001 heading-increment/header-increment - Heading levels should only increment by one level at a time
- MD002 first-heading-h1/first-header-h1 - First heading should be a top level heading
- MD007 ul-indent - Unordered list indentation
- MD009 no-trailing-spaces - Trailing spaces
- MD010 no-hard-tabs - Hard tabs
- MD011 no-reversed-links - Reversed link syntax
- MD025 single-h1 - Multiple top level headings in the same document
- MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines
- MD032 blanks-around-lists - Lists should be surrounded by blank lines
- MD040 fenced-code-language - Fenced code blocks should have a language specified
- MD041 first-line-h1 - First line in file should be a top level heading

* Update README.mustache

* [#2441] Update documentation mustache files for Ada client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]

* [#2441] Update documentation mustache files for Apex client

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]

* [#2441] Update documentation mustache files for bash

This commit fixes issues with Markdown/CommonMark parsing by linting and enforcing consistent style.[#2441]
2019-03-25 21:48:22 +08:00
Jochen Scheib
c918d7ad64 go-server: Support additional properties as command line arguments (#1555)
* Support additionalPorperties as command line arguments

* Move Readme into main dir

* Update Mustache

* Update sample

* Test coverage

* Move cli options

* Revert options

* Remove tabs

* openapi 3 examples

* Update readme

* serverPort to int

* Move package version cli option to AbstractGoCodegen

* Update samples

* Tab to spaces

* Update docs and sample with xml

* Manual update doc

* Another doc try

* Regenerate go-gin-server doc
2019-03-25 21:19:06 +08:00
William Cheng
3e065db2c6
better operation id handling in scala generators (#2490) 2019-03-25 13:13:09 +08:00
Joël Vimenet
5074f4d9c5 Update akka scala generator (#2472)
* Update akka scala generator

* Upgrade scala version to 2.12.8
* Upgrade Akka version
* Migrate from spray to Akka HTTP

* Update client sample

* Fix pom.xml generation to be equivalent to build.sbt
2019-03-25 13:12:56 +08:00
William Cheng
3b017c59f1
Add better example code for R object (#2492)
* add better example for r object

* better code format
2019-03-24 23:21:31 +08:00
William Cheng
e0caa6fd66
better code format for kotlin, python (#2491) 2019-03-24 21:45:33 +08:00
Thibault Duperron
0935f5345d Kotlin model name camelize (#2430)
* Kotlin model name camelize

* Update samples
2019-03-24 10:47:05 +08:00
Tom Ghyselinck
f7943257c5 Python flask pythonic params (#2374)
* Using connexion `pythonic_params` support while keeping OpenAPI spec file correct with reference to the original spec file.

* - Add `camelCase` query parameter which shows the incorrectnes of the conversion of the OpenAPI spec file in Python server implementation(s).

* Also use `pythonic_params=True` for the `python-aiohttp` implementation.

* - Updated Python related samples.

* The unit tests must provide the correct query parameters.

* - Updated Python related samples.
2019-03-24 10:36:26 +08:00
Akira Tanimura
033ab8a6f5 [Ruby] Use Integer instead of Fixnum in Ruby client (#2475) (#2481)
* use Integer instead of Fixnum in Ruby client (#2475)

* update samples (#2475)
2019-03-23 18:48:10 +08:00
davidwcarlson
1adc962f2b java-jersey2 - Always render setBearerToken regardless of whether OAuth2 is in use. (#2479) 2019-03-23 18:38:00 +08:00
vtitov
4a7dfecf24 Bugfix/maven classpath schema (#2409)
* multi-module example for maven plugin master

* read byte source from classpath like swagger-parser does

* renamed schema to openapi.yaml for multi-module examples

* renamed schema to openapi.yaml for multi-module examples
2019-03-23 18:34:04 +08:00
Jan Buchar
db1b63780d Add return type declaration to typescript-fetch runtime (#2466)
* Add return type declaration to typescript-fetch runtime

closes #2461

* Regenerate samples
2019-03-22 14:42:31 +08:00
Vincent Devos
e3716262e5 [Kotlin client]fix warning when else all covered (#2470) 2019-03-22 14:40:14 +08:00
Gaurav Yadav
ee75366051 Added proxy headers option for urllib3 (#2467)
* adding headers option to pass in rest client

* running ensure uptodate
2019-03-22 11:22:10 +08:00
Hector Jusforgues
d839af5b1e [typescript-axios] Fix JSON serialization of falsy request bodies (#2446)
* [typescript-axios] Fix JSON serialization of falsy request bodies

Fix #2445

* [typescript-axios] update petstore samples
2019-03-22 10:57:53 +08:00
William Cheng
2e777c04d4
Better handling of operationId with slashes (#2469)
* better handling of operation id with slashes

* update smaples
2019-03-22 10:41:53 +08:00
Justin Black
b1955f3517 Adds exceptions module to python clients (#2393)
* Adds python client exceptions module and updates samples

* Adds python style updates, detects integers in exception paths with six

* Updates to ruby samples which circleci needs

* Removes petstore-security-tests samples

* readme char removal (triggers ci tests)

* Readme fix, triggers CI tests

* Updates python client sample
2019-03-22 10:40:32 +08:00
Gaurav Yadav
45ad72b032 Adding retries option to override default value 3 of urllib3 (#2460)
* adding retries option to override default value 3 of urllib3

* running petstore for python

* adding files for samples in petstore run

* running ensure-up-to-date
2019-03-22 08:24:23 +08:00
Kevin Smith
1a19edb0e5 Add build script and remove babel (#2439)
* Add build script and remove babel

This change adds a build script which uses babel to transpile generated es6 source to es5, such that it can then be used in node projects or published as a package to npm. The `babel` package is also removed as it is deprecated, and superseded by `babel-cli`.

See https://github.com/OpenAPITools/openapi-generator/issues/2126#issuecomment-473926663

* update samples
2019-03-21 22:36:56 +08:00
Kevin Turner
2f8e4fe32b [TypeScript][Node] async promises and imports (#2452)
* async promises and imports

* Sample regen

* Correct licence info

* update samples
2019-03-21 22:27:38 +08:00
Akihito Nakano
77545df80d Add RuboCop to Gemfile (#2464)
* Add Rubocop

* Update samples

./bin/openapi3/ruby-client-petstore.sh
./bin/ruby-client-petstore.sh
2019-03-21 22:00:08 +08:00
john lilley
dc78405a68 1391 jel minimal overwrite option (#2451)
Option to overwrite only changed files
2019-03-21 00:17:10 +08:00
Michael Ramstein
49f3e9a355 [Elixir] Deserialize responses based on status code (#2355)
* Update Tesla dependency and replace Poison with Jason

* Use new Tesla method to set headers

* Fix jason dependency definition

* Use list for Headers instead of a map

* Rollback to Poison because Jason does not support 'as:' option to decode to arbitrary struct

* Use new return signature from Tesla 1.0 in decode function

* catch error when a struct is given as second parameter to RequestBuilder.decode

* Update modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache

Co-Authored-By: yknx4 <yknx.4.b@gmail.com>

* Update modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache

Co-Authored-By: yknx4 <yknx.4.b@gmail.com>

* Evaluate response based on status code

* Generate Petstore

* pin poison to ~> 3.0.0 since 4.0.0 does not work atm

* run ./bin/openapi3/elixir-petstore.sh
2019-03-20 21:35:50 +08:00
Vincent Devos
37c275b3fb [KOTLIN Client] Update to latest kotlin version (#2375)
* [KOTLIN Client] Update to latest kotlin version

gradle - okhttp3 - kotlintest version update
add some test case in sample

* [KOTLIN Client] Update to latest kotlin version

gradle - okhttp3 - kotlintest version update
add some test case in sample
2019-03-20 18:26:00 +08:00
Tom Ghyselinck
8bb01ed149 Unit tests should not be skipped when MediaType defines its underlying structure as json (*/*+json, according to [RFC6838, section 4.2.8](https://tools.ietf.org/html/rfc6838#section-4.2.8)). (#2390) 2019-03-20 18:18:45 +08:00
Vincent Devos
218c2e75ab [MAVEN PLUGIN] fix javadoc + sonarlint (#2399) 2019-03-20 16:16:59 +08:00
Justin Black
b67318ef21 Adds spec additionalProperties + nullable examples (#2405)
* Adds v2 spec additionalproperties examples, adds v3 spec nulllable model example, updates samples

* Remaining samples updates

* Adds csharp generator update to handle models with multilevel parent types, which works for the AdditionalPropertiesObject model, samples updated
2019-03-20 15:31:28 +08:00
Ramzi Maalej
3100afce26 second part of fixing Sonar issues (#2295)
* fix sonar issues

* fix csharp model issue

* refactor code
2019-03-20 15:12:00 +08:00
Keiju Matsumoto
8df619ef8a [Kotlin] Add optional parameters to the method of api (#2432)
* Add optional parameters to api

* Update petstore samples

* Remove default arguments
2019-03-20 11:04:47 +08:00
Ale Figueroa
bf7838cd81 [Elixir] Update Tesla dependency to version 1.0 (#2326)
* Update Tesla dependency and replace Poison with Jason

* Use new Tesla method to set headers

* Fix jason dependency definition

* Use list for Headers instead of a map

* Rollback to Poison because Jason does not support 'as:' option to decode to arbitrary struct

* Use new return signature from Tesla 1.0 in decode function

* catch error when a struct is given as second parameter to RequestBuilder.decode

* Update modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache

Co-Authored-By: yknx4 <yknx.4.b@gmail.com>

* Update modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache

Co-Authored-By: yknx4 <yknx.4.b@gmail.com>
2019-03-20 10:28:19 +08:00
Jacob Weber
3320d3cbe1 Handle collection params in path (assume csv for now). (#2259) 2019-03-19 22:59:16 +08:00
Hemant Zope
7ad479e13d [C] Update README and adding object.c/h files (#2377)
* modify handing reserved keyword and set isEnum in local codegen to avoid conflict with other codegen

* update README mustache

* added object header and body mustache
2019-03-19 22:41:34 +08:00
Jim Schubert
93baa5d835 Initial attempt at deploying to gradle plugin portal (#2440) 2019-03-19 21:43:28 +08:00
Dale King
d93fd31bb1 [dart] Fix authentication for dart (#2419)
* [dart] Fix authentication so all forms of Swagger 2.0 authentication work

* Run changes on petstore examples

* Amend dart2 generated README to cover basic authentication

* Amend dart2 generated README to cover authentication methods

* [dart] Fix authentication so all forms of Swagger 2.0 authentication work

* Run changes on petstore examples
2019-03-19 10:08:43 +08:00
dragosnutu
1f45ea7d1a [#2425] - implemented yaml parsing for config file. (#2434) 2019-03-18 21:49:45 +08:00
William Cheng
0b15fac3e1
fix java doc issue (#2435) 2019-03-18 20:58:14 +08:00
Jens Oberender
82700e5958 Fix for the added interceptor and when the http client is set several times, which leads to a stack overflow because of too many interceptors. (#2420)
Also added tests for that.
2019-03-18 11:04:43 +08:00