7409 Commits

Author SHA1 Message Date
Thibault Duperron
4c9d023468 Enable async option for spring-cloud library (#2670)
* Enable async option for spring-cloud library

* Samples
2019-07-31 14:22:05 +08:00
julaudo
6824bd8b24 #2694 [BUG][Typescript Axios] Content-type not set (#2695)
* #2694 [BUG][Typescript Axios] Content-type not set

* Test required allOf

* re-generate typescript-axios samples

* re-generate typescript-axios samples
2019-07-30 15:47:17 +02:00
Benjamin Gill
c684505cba
Stop deriving Eq for models (#3463)
It fails if the model contains a float, which don't implement Eq.

Fix for bug introduced in #3309.

We really need to improve the testing of the rust generator to catch this sort of mistake in future. I don't have time to do this now, though.
2019-07-29 14:01:01 +01:00
Sebastian Rühl
1bf8c15206 [BUG-1865] Added serialization support for typescript on complex object headers. (#1874)
* [BUG-1865] Added serialization support for typescript on complex object headers.

* Update api.mustache

integrate feedback from https://github.com/OpenAPITools/openapi-generator/pull/1874#discussion_r268981304

* [BUG-1865] post merge fixes

* [BUG-1865] addded windows scripts

* Apply suggestions from code review

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* [BUG-1865] regenerated samples
2019-07-29 11:31:42 +02:00
William Cheng
981b3a53ef update ocaml openapi3 petstore script 2019-07-29 12:05:15 +08:00
tjnet
9cb3ae1048 remove unecessary null check as it cannot be reached due to the Null Pointer Exception (#3480) (#3481) 2019-07-29 10:34:57 +08:00
William Cheng
6e3176557c
[OCaml] various enhancements (#3483)
* add ocaml template creator

* various enhancement to ocaml generator

* update instruction

* update doc

* remove readme

* add back readme
2019-07-29 10:07:32 +08:00
cgensoul
1713c7610d [OCaml] new client generator (#3446)
* Début d'un générateur pour OCaml.

* Ajout du script bash de generation pour OCaml.

* Implémentation de la partie model du générateur OCaml.

* Suppression du fichier Model.mustache.

* Légère modification dans le générateur OCaml.

* Début d'implémentation de la génération des opérations.

* Avancées dans l'implémenatation des opérations.

* Avancée dans la gestion des enums : reste à traiter le fait que Yojson sérialize les variants comme des tableaux JSON.

* Prise en compte du fait que Yojson représente les variants constants sous forme d'un tableau JSON contenant une unique string.

* Utilisation des variants polymorphe pour les enums car il se peut que plusieurs énumérations partagent des valeurs communes ce que ne permettent pas les variants ordinaires au sein d'un même module.

* Avancées dans le générateur de code OCaml : le code produit compile et prendre en compte les pathParams, les queryParams, les headersParams, les bodyParams et la réponse JSON. Manque le support du multipart, du form encoded et des mécanismes d'authentification.

* More tests.

* Correction de problèmes dans la génération mis en évidence par l'utilisation d'un fichier OAS plus gros et complexe que Petstore.

* Mapping du case Error de Ppx_deriving_yojson_runtime.ok_error vers l'exception Failure pour avoir des types plus simples et non dépendants de Pppx_deriving_yoson_runtime dans les APIs générées.

* Ajout de la génération des fichiers d'interfaces .mli pour les APIs.

* Ajout du support des parametres de type x-www-form-urlencoded.

* Le paramètres d'url de type number étaient mal gérés.

* Cleanup.

* Replace block comment start and end sequences in input text.

* Make apis calls without a return type return unit rather than Yojson.Safe.t.

* Make modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml generate properly.

* Added generated code for modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml.

* Better handling of enums and map container and better sanitizing of generated identifiers to support all the corner cases present in modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml.

* Correcting a violation : using toLowerCase without relying on the default Locale.

* Changed authoring in partial_header.mustache.

* Deleted commented code.

* Collect enum schemas in items properties of operation parameters in the case of ArraySchema parameters. This allows correct processing of modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml.

* Collect enums also in additional properties schemas of operation parameters in the case of MapSchema parameters (if this type of parameter can is allowed).

* Removed copy-pasted Copyright notice from SmartBear.

* update doc

* Use Locale.ROOT instead of Locale.ENGLISH for toLowerCase calls.

* Make GET operations with body generate compilable code.

* Updated ocaml-client generated samples using the latest version of the OCaml code generator.

* Added [@default None] for record fields with option types so that if those fields are missing at deserialization time, None is assumed.

* Added support of api keys in query params.

* Updated generated ocaml samples to reflect latest changes in templates.

* Added [@default] on enum record fields for which the enum type has only one accepted value so that those fields can be deserialized even if the value is absent of the json payload.

* Delete useless space character in template.

* Added proper handling of http response codes.

* Updated generated ocaml samples to reflect latest changes in templates.
2019-07-28 21:50:53 +08:00
William Cheng
fb7cd7315a update samples 2019-07-27 23:34:29 +08:00
Chris Couzens
6358b11516 Bash skip empty query param fix (#3290)
* Bash: Update samples

I'm about to make a fix to the bash generator. I'm regenerating the
samples in this commit so that the change I make isn't lost amongst
the noise.

https://github.com/OpenAPITools/openapi-generator/pull/3290

* Bash client: Fix query params seperation

Fix bug where empty query parameters weren't separated by ampersands.

For example, this
```bash
bash bash_keycloak/client.sh -v --oauth2-bearer "$access_token" --host "$api_host" realmUsersGet realm=demo_realm2 email=foo+bar@baz.com
```
would generate the path
`/auth/admin/realms/demo_realm2/users?briefRepresentation=email=foo+bar@baz.comfirst=firstName=lastName=max=search=username=`.

It now puts ampersands around them to make
`/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=&search=&username=`

Instead of predicting if there is going to be a `parameter_value` ahead of
time, we now put in the ampersand if there is a `parameter_value` and existing
`query_request_part`.

https://github.com/OpenAPITools/openapi-generator/pull/3290

* Bash: Skip query parameters with empty value

I have a route with many optional query parameters.
I observed that when they weren't specified, they were still included in
the routes, but without a value.

Running:
```bash
bash bash_keycloak/client.sh -v --header "Authorization: Bearer $access_token" --host "$api_host" --dry-run realmUsersGet realm=demo_realm2 email=foo+bar@baz.com username=foo
```

Would produce the route:
`http://localhost:8080/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=search=&username=foo`

After this change it produces the route:
``http://localhost:8080/auth/admin/realms/demo_realm2/users?email=foo+bar@baz.com&username=foo

---

I discussed with @wing328 in the pull request about if empty values (eg
`username=` should produce an empty query parameter, or if the query
parameter should be removed.

We decided it should remove the query parameter.

https://github.com/OpenAPITools/openapi-generator/pull/3290

----

The OpenAPI definition I was using:

Using:
https://github.com/ccouzens/keycloak-openapi/blob/master/keycloak/6.0.json
In particular:
```json
      "/{realm}/users": {
        "get": {
          "summary": "Get users   Returns a list of users, filtered according to query parameters",
          "parameters": [
            {
              "in": "query",
              "name": "briefRepresentation",
              "schema": {
                "type": "boolean"
              },
              "style": "form"
            },
            {
              "in": "query",
              "name": "email",
              "schema": {
                "type": "string"
              },
              "style": "form"
            },
            {
              "in": "query",
              "name": "first",
              "schema": {
                "type": "integer",
                "format": "int32"
              },
              "style": "form"
            },
            {
              "in": "query",
              "name": "firstName",
              "schema": {
                "type": "string"
              },
              "style": "form"
            },
            {
              "in": "query",
              "name": "lastName",
              "schema": {
                "type": "string"
              },
              "style": "form"
            },
            {
              "in": "query",
              "name": "max",
              "description": "Maximum results size (defaults to 100)",
              "schema": {
                "type": "integer",
                "format": "int32"
              },
              "style": "form"
            },
            {
              "in": "query",
              "name": "search",
              "description": "A String contained in username, first or last name, or email",
              "schema": {
                "type": "string"
              },
              "style": "form"
            },
            {
              "in": "query",
              "name": "username",
              "schema": {
                "type": "string"
              },
              "style": "form"
            }
          ],
```
2019-07-27 21:48:36 +08:00
William Cheng
3e027c61da Merge remote-tracking branch 'origin/master' into 5.0.x 2019-07-27 20:53:38 +08:00
William Cheng
93cb215531 update java native 11 samples 2019-07-26 15:21:23 +08:00
Erik Seliger
d5d8b7a118 fix(typescript-angular): use correct package with http-client (#3465) 2019-07-26 07:54:40 +02:00
William Cheng
45fcf3792a
[Java] add nullable support to the clients (#3453)
* add nullable support, update samples

* update samples
2019-07-26 10:00:27 +08:00
Benjamin Douglas
43590582c5 Java 11 native HTTP client library (#3434)
* Initial commit of Java 11 native HTTP client port

* Rebase to master and add JSR305 for @Nullable

* Update samples with @Nullable annotations
2019-07-26 09:59:21 +08:00
William Cheng
8253c28d6e
[Java] Replace "useNullForUnknownEnumValue" option with the nullable attribute (#3455)
* add nullable support to enum

* update test spec with nullable enum

* update samples

* update samples
2019-07-26 09:49:44 +08:00
Martin Delille
fabe021fb0 Revert "qt5 client: use openapi 3 spec (#3400)" (#3458)
This reverts commit 40f1f920dfa03c2c172d196e6ad4dd5950f17405.
2019-07-25 18:25:17 +02:00
Bernd Hacker
8231cbfe81 [typescript-rxjs]: support reponseType blob (#3437)
* feat(typescript-rxjs): add optional responseType to RequestOpts

* refactor(typescript-rxjs): remove redundant importMapping.clear() in codegen constructor

* feat(typescript-rxjs): update this.reservedWords

* fix(typescript-rxjs): add missing fields copied to ExtendedCodegenOperation

* feat(typescript-rxjs): add support for responseType blob

* feat(typescript-rxjs): regenerate samples
2019-07-25 15:16:54 +02:00
Freeman
a3cf964ce9 Upgrade babel packages for Javascript ES6 generator (#3424)
* Upgrade babel packages for Javascript ES6 generator

* Fix @babel/register in test script
2019-07-25 14:31:27 +02:00
William Cheng
64c2069256 update java samples 2019-07-25 15:30:13 +08:00
kassim
ee538be964 [Java] add nullable annotation to pojo template for non-required fields (#3409)
* add nullable annotation to pojo template

* add jsr305 dependency

* jsr305 dependency on all java build.gradle files

* jsr305 dependency on all java pom.xml files

* update samples

* more pom updates

* more sample/template updates
2019-07-25 10:35:18 +08:00
Benoît Courtine
28a16bea24 [Rust][Client] Correct the Rust client generated documentation (#3419)
Fixes #3418. Only generated API markdown files are impacted.
2019-07-24 17:33:11 +01:00
Gabriel Féron
2e81e612fc Fix enum types in structs (#3309)
I already contributed proper enum supports a few weeks ago, but somehow missed actually using them when they're used as a property. This PR fixes that.

I also took the liberty of fixing a bunch of unused warnings.

* Make sure we use the enum types in Rust

* Fix unused warnings in Rust and regenerate samples

* Use crate:: import path that works both with Rust 2015 and 2018

* Derive PartialEq and Eq in generated Rust structs and enums
2019-07-24 17:29:43 +01:00
Ramanth Addala
a4b1c269d8 fix(r): updated example in doc(.md) file (#3429)
* fix(r): updated doc(.md) files

* fix(r): changed enum representation
2019-07-24 23:15:21 +08:00
Martin Delille
40f1f920df qt5 client: use openapi 3 spec (#3400) 2019-07-23 22:26:42 +02:00
Bernd Hacker
d2576f411e [typescript-rxjs] runtime and api cleanup (#3316)
* feat(typescript-rxjs): use interfaces from rxjs/ajax, use shorthands

* feat(typescript-rxjs): regenerate samples

* docs(typescript-rxjs): extend readme by middleware howto

* feat(typescript-rxjs): stop generating empty comment when there is no description in model

* feat(typescript-rxjs): import throwIfRequired and COLLECTION_FORMATS only when needed

* feat(typescript-rxjs): generate HttpHeaders and HttpQuery only if needed, improve formatting

* feat(typescript-rxjs): conditionally import HttpHeaders and HttpQuery

* feat(typescript-rxjs): add encodeURI helper, refactor queryString helper

* feat(typescript-rxjs): improve condition for hasListContainers

* feat(typescript-rxjs): regenerate samples
2019-07-22 11:21:37 +02:00
Silas Boyd-Wickizer
76fecf744b [typescript-node] Promise-based Authentication interface (#3408) 2019-07-22 10:54:48 +02:00
Daniel Grünberger
f436904359 [typescript-angular] Add encoder configuration, fix default encoder (#3372) (#3389)
* [typescript-angular] Add encoder configuration and fix default encoder (#3372)

* Add encoder to configuration
* Fix import indention
* Default encoder workaround for https://github.com/angular/angular/issues/18261

* [typescript-angular] Refactor api.service template

* Extract encoder class variable initialized in constructor

* [typescript-angular] Updated samples

* [typescript-angular] Add missing imports

* [typescript-angular] Update samples

* [typescript-angular] Update samples

* [typescript-angular] Fix tests

* Fix typo
* Add missing interface method implementation
* Update samples
2019-07-22 10:54:14 +02:00
Daiki Matsudate
5cba55f8fb
[Swift4] Introduce XcodeGen (#3396)
* add XcodeGen.mustache

* generate code

* add dependencies
2019-07-22 17:12:34 +09:00
Martin Delille
1413775e0e qt5 client: strip whitespace (#3406) 2019-07-21 22:23:15 +02:00
Jim Schubert
944e1c3468
[fix] Assign template directory to additional properties (#3385)
* [fix] Assign template directory to additional properties
2019-07-18 09:50:54 -04:00
Benoît Courtine
26b8d1f4c2 Better Rust client imports (#3332)
* Better Rust client imports.

* No more "unused_imports" in models for serde_json::Value.
* No more compilation problem for apis requiring serde_json::Value.
* "crate::" prefix for models and apis imports, for compatibility with Rust 2018 edition.

* Rust samples regeneration using new code.
2019-07-18 10:08:48 +01:00
Slavek Kabrda
0fec25e92e [Go][experimental-client]: make struct members pointers, provide custom marshalling (#3371)
* [Go][experimental-client] Properly define packageName for go-experimental sample client

* [Go][experimental-client] make structure members pointers, provide custom marshalling.
2019-07-18 15:52:37 +09:00
Josh Burton
1aa8a2bec4 [dart-jaguar] Fixes error accessing default converters (#3361)
`this.converters` was causing errors as the default converters are declared outside of the API client.
2019-07-18 15:28:15 +09:00
Jérémie Bresson
4223743ee0 [java rest-assured] prevent reqSpec reuse between requests (#3375)
* [java rest-assured] prevent reqSpec reuse between requests

* Update sample
2019-07-18 14:46:44 +09:00
Jean-François Côté
610ca28681 Fix #3349 : [typescript-fetch] Proposition to follow spec (#3351)
* Fix 3349 : Proposition to follow spec closely

* Fix #3349 : Changes suggested by code review. Add an option for the single request parameter.

* Fix #3349 : Add sample with the use of the single request parameter

* Fix #3349 : Small fix that wasn't passing the tests

* Fix #3349 : Remove cariage return that might create an error

* Fix #3349 : Add chmod to make new sh file executable and fix the CircleCI issue

* Fix #3349 : Add windows sample generation

* Fix #3349 : Rename everything because of default value change

* Fix #3349 : Indentation fix

* Fix #3349 : Add 755 to typescript-fetch-petstore-multiple-parameters.sh

* Fix #3349 : Auto generation of the documentations

* Fix #3349 : Revert back a change that was auto-generated.
2019-07-17 22:30:27 +02:00
hello-brsd
3eac8391f5 [typescript-fetch] support custom stringify for query string (#3327)
* [typescript-fetch] support custom query stringify

* [typescript-fetch] support custom query stringify
2019-07-15 07:58:08 +02:00
Jim Schubert
4843dfc244 Updates to address recent lodash Object prototype vulnerability (#3348) 2019-07-13 16:43:05 +08:00
Josh Burton
f04ef76d07 [dart-jaguar] Adds option to customise the generated API client name (#3234)
* [dart=-jaguar] Adds option to customise the generated API client name

* [dart-jaguar] Removes explicit clientName CLI property and derives client name from pub name

* [dart-jaguar] Updates samples

* Reverts import changes
2019-07-13 12:32:24 +08:00
Jérémie Bresson
99ee68128d
[java-client][okhttp-gson] add missing import for bearer authentication (#3343) 2019-07-12 06:55:23 +02:00
William Cheng
0b7d3c4590 Merge remote-tracking branch 'origin/master' into 5.0.x 2019-07-10 11:41:13 +08:00
William Cheng
753be28782 Merge remote-tracking branch 'origin/4.1.x' 2019-07-09 23:56:30 +08:00
William Cheng
203fc812bd
v4.0.3 release (#3315)
* update snapshot version

* update doc

* comment out haskell servant server test
2019-07-09 20:44:31 +08:00
William Cheng
7cef5ed8ab update java rest assured sample 2019-07-08 22:49:49 +08:00
Victor Orlovsky
0e37719162 [Java][Rest-assured] Bump rest-assured version (#3282)
* Update rest-assured version to 4.0.0

* Added rest-assured version 4.0.0 to documentation

* Remove CatAllOfTest and DogAllOfTest
2019-07-08 22:20:35 +08:00
Jérémie Bresson
3943d1cc9d [java] fix javadoc configuration (#3302)
* [java] fix javadoc configuration

* [java-pkmst-microservice] fix generated javadoc
2019-07-08 21:25:47 +08:00
William Cheng
3f9e374c8d
update js flow dep to fix security issue (#3296) 2019-07-08 17:00:38 +08:00
Justin Black
109808e60d [Python] Adds new client generator, python-experimental (#3244)
* Adds python-experimental generator

* Adds python-experimental samples folder which uses its own v2 spec

* Adds enusre-up-to-date updates

* Removes samples/client/petstore/perl/t/AnotherFakeApiTest.t

* Removes comment line from python-experimental generator

* Reverts perl docs file

* Updates perl sample client

* Adds python-experimental to pom.xml

* Copies the python test foldeers tests and testfiles into python-experimental

* Copies python test folder into python-experimental

* Moves python testing from Travis (samples pom.xml profile) to Circlci (samples.circleci pom.xml profile)

* Adds python-experimental pom.xml

* Adds python-experimental makefile and .sh files

* Chenges python-experimental to use gitignored venv rather than .venv which is not ignored when testing

* Adds dev-requiremnts.txt and removes .travis.yml from python-experimental so CI tests will pass

* Moves python-experimental from CicleCI to Travis to get support for multiple python environments

* Updates generator java comment so CI tests will run over again
2019-07-06 22:43:29 +08:00
Nathan Broadbent
78551d0180 Set error_reporting(E_ALL) in phpunit.xml settings, to crash on undefined variables (#3266)
* Set error_reporting(E_ALL) in phpunit.xml settings, so that undefined variables will always cause a test failure

* Update petstore sample for php-laravel
2019-07-06 22:21:41 +08:00
William Cheng
e9809294a5
update travis, support java9+ (#3279) 2019-07-05 23:32:10 +08:00