8824 Commits

Author SHA1 Message Date
Tino Fuhrmann
9b8e4c27c2 Fixed bugs in blob handling of jquery 2020-05-24 21:08:31 +02:00
Tino Fuhrmann
dee6ed420e Replaced isSuccessCode with is2xx 2020-05-23 19:01:24 +02:00
Tino Fuhrmann
56f9737b2d Merge master 2020-05-22 22:06:06 +02:00
Bodo Graumann
e315d48636
Support media types other than json (#6177)
List of changes:

* Add */* as fallback to accept header

* Use more sophisticated media type selection

* Handle object stringify in ObjectSerializer

* Parse response with ObejctSerializer

* Fix: Correctly extract response headers in browser

* Create HttpFile objects from responses

* Handle binary responses

* Clean up dependencies and replace isomorphic-fetch

Instead of isomorphic-fetch, which is unmaintained, we directly use
node-fetch and whatwg-fetch polyfills.
2020-05-22 21:54:52 +02:00
Sebastien Rosset
19e14237aa
[python-experimental] Add support for pep 3134, attach cause of exception (#6388)
* Mustache template should use invokerPackage tag to generate import

* Add exception cause

* using six module for exception chaining in Python 3.x
2020-05-22 09:44:15 -07:00
Sebastien Rosset
912604f3dc
[Java-jersey2] Add new ApiClient constructor with auth objects (#6393)
* Mustache template should use invokerPackage tag to generate import

* Add new constructor for Java ApiClient

* Add constructor with auth map
2020-05-22 23:54:05 +08:00
William Cheng
a8f9ea4873
add nullable support to oneof, anyof (#6392) 2020-05-22 15:03:51 +08:00
William Cheng
f10de73ed5
Add helper methods to determine if the spec has certain authentication defined (#6347)
* better import, add security methods

* add helper method to determine auth type when adding supporting files

* better docstrings

* fix boolean return

* update tests

* Revert "update tests"

This reverts commit 29cfc8ad663234ee20c73ac7be9c4dd2235ac34f.

* add test in shippable

* rename variables

* check if auth files are needed

* update tests

* revert check

* set java8 to true

* fix auth check

* better npe handling

* reoder methods

* undo changes to shippable.yml
2020-05-22 12:57:44 +08:00
Sebastien Rosset
69177517ef
[Python-experimental] Should accept float value serialized without decimal point (#6386)
* Mustache template should use invokerPackage tag to generate import

* A float may be serialized as an integer, e.g. '3' is a valid serialized float

* A float may be serialized as an integer, e.g. '3' is a valid serialized float

* add unit tests
2020-05-21 18:59:31 -07:00
Jon Schoning
3603dee3fb
[haskell-http-client] Ensure newytpes are generated when necessary (fixes #6350) (#6383) 2020-05-21 12:48:41 -05:00
Bodo Graumann
659369c3ea
Typescript refactor fixes (#6027)
Fixes a handful of issues identified in https://github.com/OpenAPITools/openapi-generator/issues/802#issuecomment-617262139

List of changes

* Clean: Remove redundant cliOption definition

* Remove redundant directory structure in templates

If we need to have different index.ts files for the different
frameworks, we can mostly do that in the one mustache file. In the cases
where that is not possible, we can still add a new override file later.

* Use File.separator consistently

* Only export selected api type

* Simplify promise polyfill import

The behaviour should be the same, according to the es6-promise docs.
Previously tsc would report the error:
> error TS2307: Cannot find module 'es6-promise'.

* Import HttpFile in all models

* Export server configurations

* Use undefined as default body value

The empty string is not interpreted as "no body" by the browser fetch
api and thus leads to an exception during get requests

* Improve codestyle: prefer guards to nesting

* Remove verbose debug output

This should not be commited, because every developer has very different
requirements what debug information he needs to see.

* Fix: Use cleaned model names for imports

* Fix: do not call toString on undefined

* Fix typo in doc comment

* Introduce RequestBody type and remove method check
2020-05-21 15:34:14 +02:00
Slavek Kabrda
cac4170c0f
[go-experimental] Fix marshalling of of go oneOf structures to work on non-pointer receivers (#6314) 2020-05-21 21:02:21 +08:00
Januson
c49d8fda8e
[M][REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists (#5466)
* [REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists
 - Update Java code generation to use sets instead of lists when uniqueItems is set to true
 - Add import resolution for sets
 - Add tests and fix broke tests

resolve #5254

* Update Javascript, Perl, Python and Ruby to preserve current functionality.

* Switch set implementation to LinkedHashSet

* Fix missing import for uniqueItems used on param.

* Fix missing import and return type for responses with uniqueItems

* Fix default values for array of enum

* Update generated samples

* fix merge issue

* Update generated samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-21 13:27:57 +08:00
Diogo Nunes
dec1365619
Use webclient exceptions in java webclient client (#6304) 2020-05-21 00:46:34 +08:00
William Cheng
2ec0754596
add pub to struct in single parameter (#6381) 2020-05-20 22:36:44 +08:00
Ramanth Addala
a0bfc3c1f2
replacing caTools dependency with base64enc (#6349)
* replacing caTools dependency with base64enc

* adding review fixes

* fix(r) : updated the cran repo url
2020-05-20 21:19:13 +08:00
Slavek Kabrda
5f2979c434
[go-experimental] Ensure that all oneOf/anyOf models have their Nullable<Model> defined (#6363) 2020-05-20 17:29:03 +08:00
Sebastien Rosset
755336f9d9
[Java] Upgrade http signature library to version 1.4 (#6370)
* Mustache template should use invokerPackage tag to generate import

* upgrade to http signature library version 1.4

* Use updated HTTP signature library

* Run sample scripts

* Add code samples in README file for HTTP signature

* fix java imports

* Update http-signature version
2020-05-20 15:51:08 +08:00
Natan Laverde
40a329f0f7
[BUG] [Server: C++] [Qt5] Fix missing headers and wrong status code (#6345)
Change helper method '''writeResponseHeaders''' implementation to just set the headers, instead of write them, and also rename the method to '''setSocketResponseHeaders''', to maintain the new semantic.
The implementation of '''QHttpEngine::Socket::write''' or '''QHttpEngine::Socket::writeJson''' implementations will call '''Socket::writeData''' that writes the Headers and Status Code before write the content if they are not already written.
If these methods are not called (e.g.: empty reply), we could set the headers just before close the socket.
2020-05-20 11:12:13 +08:00
William Cheng
5fe34fbd74
Add oneof/anyof support to PowerShell client generator (#6361)
* add oneof/anyof support to powershell client gen

* fix tests
2020-05-19 21:42:17 +08:00
William Cheng
096b8f8828
[Go][Experimental] Avoid duplicated import in enum model (#6355)
* avoid double import of fmt

* update go exp petstore oas3

* import for go client exp only
2020-05-19 20:17:45 +08:00
Ermolay Romanov
2f9aa282e5
[typescript-rxjs] restore prototype inheritance for clone & its clients (#6001)
* [typescript-rxjs] restore prototype inhertance

- previously clone() and its clients in the BaseAPI class were generic
- with removal of the generic argument, these methods became unavailable
  to the API classes inheriting from BaseAPI
- original generic was imprecise, as these are not statics
- return type of `this` is the correct notation

* [typescript-rxjs] Chery-pick from #5465 by @denyo

  - this is done to prevent the changes slated for 5.0 from conflicting
  - apply destructuring changes from
      - denyo:feature/rxjs-statuscode-and-progress@673d67c
2020-05-19 10:06:08 +02:00
William Cheng
d92b8833b0
reset to nil, replace tab wtih space (#6352) 2020-05-19 15:34:53 +08:00
Natan Laverde
f8a144bdc1
[C++] [Qt5] [Server] read json (#6343)
* [C++] [Qt5] [Server] [Bug] fixed Incomplete Read JSON

Emit signal requestReceived only after request content is entirely received.

* [C++] [Qt5] [Server] [Bug] fixed Incomplete Read JSON

Emit signal requestReceived only after request content is entirely received.
2020-05-18 11:32:13 +02:00
alxnegrila
e5c72a0ab6
[PHP] ObjectSerializer fix for array of objects (#6331)
* [PHP] ObjectSerializer fix for array of objects 

Array of objects translate to "map[string,object][]" and they fail to deserialize. This is because the deserialization does not parse the mapping string correctly. A quick fix is trying moving array deserialization before object deserialization.


Example object
    ObjectExample:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            additionalProperties: true

* Update sample

Co-authored-by: Alexandru Negrila <alex@arntech.ro>
2020-05-18 17:23:27 +08:00
Slavek Kabrda
634291f4b8
[go-experimental] Ensure enum deserialization checks enum values (#6315) 2020-05-18 16:42:40 +08:00
Nikita Karnaukh
eefcd62d5b
[Kotlin][Client] Added supporting Retrofit2(RxJava/RxJava2/Coroutines) (#5750)
* Added support Retrofit2(RxJava/RxJava2/Coroutines) to Kotlin client code generator

* Added generated samples for Retrofit2(RxJava/RxJava2/Coroutines) on Kotlin

* Fixed generating retrofit2 without Rx/Coroutines

* Fixed MultipartBody template, remove redundant space after MultipartBody.Part annotation

* Fix documentation diff.

* Fix generating build.gradle file for samples.
Add dependencies for rxJava/rxJava2 and rx retrofit's adapter.

* Update generated sample with rx dependencies

* Update generated sample with coroutines

* Update generated sample with RxJava 2 dependencies

* Update and refactoring scripts for sample generation

* Update generated sample code

* revert changes by mistake

* revert changes by mistake #2

* Fix return type for first RxJava

* Add RxJavaCallAdapterFactory to ApiClient scheme for RxJava 1/2

* Fix script loggin

* Update generated code for RxJava 1/2

* Fix kotlin.md documentation by script export_docs_generators.sh

* Update Kotlin samples project in pom.xml

* Revert "Update Kotlin samples project in pom.xml"

This reverts commit 9de4d0ba

* Fixed "" wrapping number types for annotation value
Fixed generating polymorphic interfaces for Gson, interface fields can't be marked with @SerializedName annotation, it's enough to mark it in child model.
Fixed instantiationTypes(array, list, map) for Kotlin generator

* Update Kotlin samples project after last fixes

* Update Kotlin samples project for kotlin-jvm-*

* Update Kotlin readme.md documentations

* Update Kotlin client sample changes

* Fixed encoding braces for generics model

* Update Kotlin client sample changes

* Update Kotlin client sample after merge with master

* Fixed adding empty braces for inherit from Map/Array

* Update sample model after last fix with empty braces

* Revert adding @SerializedName to Kotlin interface fields through @get:SerializedName as for Jackson

* Update Kotlin client samples with adding @get:SerializedName
2020-05-18 16:26:27 +08:00
Slavek Kabrda
d1e8d632ef
[go-experimental] Add convenience wrapper function for oneOf members (#6316) 2020-05-18 15:57:05 +08:00
Bruno Coelho
43f7134b15
[swift] improve combine available and openapi3 deprecated (#6340) 2020-05-18 09:39:40 +08:00
Sebastien Rosset
b4954b0d80
[codegen][python-experimental] Add configuration knob to disable JSON schema validation (#6227)
* Add knob to disable JSON schema structural validation

* Add knob to disable JSON schema structural validation

* Fix formatting issues

* execute sample scripts

* execute sample scripts

* fix multipleOf validation issue

* Add validation log for multipleOf. Add customizable validation checks. add unit tests for JSON schema validation

* Add validation log for multipleOf. Add customizable validation checks. add unit tests for JSON schema validation

* Add validation log for multipleOf. Add customizable validation checks. add unit tests for JSON schema validation

* Add validation log for multipleOf. Add customizable validation checks. add unit tests for JSON schema validation. Fix for python 2

* address review comments
2020-05-17 09:11:01 -07:00
Sebastien Rosset
04ff319502
[python-experimental] Support schema property which has $ref to 'oneOf' schema and child schema is null type (#6275)
* Handle null type

* Handle null type

* Handle null type. Add 'null' type in the OAS document for testing purpose

* Handle null type. Add 'null' type in the OAS document for testing purpose

* Handle null type. Add 'null' type in the OAS document for testing purpose

* Handle null type. Add 'null' type in the OAS document for testing purpose

* Handle null type. Add 'null' type in the OAS document for testing purpose

* Handle null type. Add 'null' type in the OAS document for testing purpose

* improve documentation

* Handle 'null' type

* Handle 'null' type. Add unit tests

* Add NullType for go

* Add NullType for go

* fix modeling of AnyType for go-experimental

* execute scripts in bin directory

* Add review comments

* Add 'null' type in oneOf

* Improve OAS YAML file for golang openapi3 samples

* 'Any type' includes the null value, so 'isNullable' should be set to TRUE

* 'Any type' includes the null value, so 'isNullable' should be set to TRUE

* Handle AnyType and NullType

* handle anytype for go-experimental

* Log warning instead of error

* anyOf/oneOf

* Change x-golang-is-container extension to x-golang-has-wrapper

* Add code comments

* Handle Object and any type

* Handle Object and any type

* Handle object and any type

* add code comments

* handle additional properties

* handle additional properties

* handle additional properties

* handle anytype and objecttype for go-exerimental

* Move golang changes to a separate branch

* Move golang changes to a separate branch

* Better names for the OAS document test properties

* Move golang changes to a separate branch

* Run samples scripts

* Run samples scripts

* fix unit test issues

* Handle none type

* Fix index out of range exception

* fix formatting issues

* fix formatting issues

* fix formatting issues. Finally figured out how to check formatting in local workspace

* fix formatting issues

* Add reference to oneOf schema

* Add model showing unit test failure with ref to oneOf schema

* Updates get_discriminator_class to return visited_composed_classes

* Fixes broken test, adds is_valid_type

* run samples scripts

* move unit test to  test_drawing.py file

* Add more unit tests

* invoke git pull from spacether fork

* invoke git pull from spacether fork

* Improve unit tests

* Add is_nullable_type util function

* Add unit test for null value

* Add 'ShapeOrNull' type to handle the oneOf/anyOf scenario when the child schema is the null type

* Support schema property which has  to 'oneOf' schema and child schema is null type

* Support schema property which has  to 'oneOf' schema and child schema is null type

* Support schema property which has  to 'oneOf' schema and child schema is null type

* Mustache template should use invokerPackage tag to generate import

* handle null type in oneOf/anyOf

* handle null type in oneOf/anyOf

* Add more unit test for nullable shape

* resolve merge conflicts

* resolve merge conflicts

* handle null type in oneOf/anyOf

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2020-05-17 09:06:12 -07:00
Slavek Kabrda
66948e6570
[Java][jersey2] Allow setting serverIndex to null (#6321) 2020-05-17 23:44:54 +08:00
William Cheng
c81359304d
fix gradle in some java clients (#6339) 2020-05-17 17:59:57 +08:00
William Cheng
a4e55ea7e5
[Swift] clean up samples, scripts for deprecated swift generators (#6327)
* decomission swift, swift3

* remove swift batch files, update doc
2020-05-17 14:32:30 +08:00
Bruno Coelho
b7c8b6e6a5
[Swift] implement support for openapi3 deprecate (#6336) 2020-05-17 14:31:52 +08:00
Tino Fuhrmann
303ec6c04b
[TS-Refactor] Added options for npm version, repository, name and updated readme (#6139)
* Added options for npm version, repository, name and updated readme

* Removed `this`  where not required

* Updated typescript docs
2020-05-16 19:01:08 +02:00
William Cheng
2c2c83df79
[Java] update jackson databind versions (#6328)
* update databind version

* update gradle build
2020-05-16 23:56:31 +08:00
William Cheng
0c2541fc93
fix commnented code in api/model tests (#6329) 2020-05-16 22:36:39 +08:00
Jose Camara
311ca7826d
[typescript-axios] Implement useSingleRequestParameter option (#6288)
* Changes in mustache file to include new option

- New options `useSingleRequestParameter` to use a single param for the request, instead of one param per request param.

* Chanes in the documentation

Include new parameter `useSingleRequestParameter`.
Default value = `false` to keep compatibility with previous versions.

* Include script to generate samples

Also included script in the script that runs all

* Generate new samples

- Previous samples have a minor change (one line is deleted)
- New sample generated with the new parameter set to true

* Include scripts for windows

* Include new CLI option in codegenerator class

* Change the order for the new parameter in the docs
2020-05-15 21:51:30 +02:00
Alexey Makhrov
56fc5f57f1
[typescript] Remove "v4-compat" value of enumSuffix (#6308)
* Remove ENUM_NAME_SUFFIX_V4_COMPAT mode

* Regenerate samples

* Regenerate docs

* Regenerate docs for js-flowtyped
2020-05-15 21:50:58 +02:00
William Cheng
26830bf3bc
Mark swift4 generator as deprecated (#6311)
* mark swift4 generator as deprecated

* add new files
2020-05-15 20:50:45 +08:00
https://gitlab.com/selankon
9a0058f577
Improve parameter documentation (#6092) 2020-05-15 09:39:01 +08:00
William Cheng
62d103d501
Minor improvements to plantuml doc generator (#6298)
* minor improvements to plantuml doc generator

* various improvements

* fix windows batch file
2020-05-15 09:16:19 +08:00
William Cheng
00a706b760
undo changes to petstore.yaml oas3.0 (#6299) 2020-05-15 09:12:12 +08:00
adg-mh
7f8118069e
Allow passing progress callbacks through client methods. (#6261) 2020-05-15 09:02:25 +08:00
b1rdG
942035a411
Create method to json (#6111) 2020-05-15 09:02:00 +08:00
Josh Burton
2dd5477c24
[dart-dio] Adds support for generating inline enums (#5668)
* [dart-dio] Adds support for generating inline enums

Previously these were generated as strings if declared inline in the spec.

* Adds more detailed comment about inline enums
2020-05-14 21:11:27 +08:00
Andrei Chugunov
ae2b693ccc
[BUG] Failed to add required=false (#2062) (#5573) 2020-05-14 21:10:12 +08:00
Patrick Burls
f03458dde4
Add new Plantuml generator for creating a schema diagram (#6255)
* add scaffolded new documentation generator files

* add openapi3 plantuml bin scripts

* change plantuml codegen to only generate a schemas.plantuml file

* initial plantuml schema diagram

* add item type to Lists

* add inheritance relationships

* add list one-to-many relationships

* add newline between model definitions and relationships

* add composition data type relationship

* remove allOf models and interface references

* add new entities data to SupportingFileData

* add List dataType support to entity fields

* remove composed types and remove allOf suffix from inline types

* add inheritances to supporting files data object

* add aggregation relationships to supporting file data

* add isList to compisition relationships

* refactor PlantumlDocumentationCodegenTest

* add property name to relationships

* remove old code form PlantumlDocumentationCodegen

* add plantuml generator sample output

* remove use of javafx.util.Pair

* fix casing of complex data type for fields

* add plantuml generator docs

* fix bug caused by assumption that inline _allOf types will always be unique but apparently they can be shared if they have identical properties!

* fix bug with missing relationships caused by shared identical _allOf schemas

Co-authored-by: Patrick.Burls <patrick.burls@bskyb.com>
2020-05-14 18:20:26 +08:00
William Cheng
c95bc4dfb0
[Java] Fix repeated OAuth files being generated (#6285)
* fix repeated oauth files being generated

* fix oauth check
2020-05-14 17:23:54 +08:00