1230 Commits

Author SHA1 Message Date
Hippolyte HENRY
3693d60840 Add newline between function signature of operation and summary of operation (#4112)
* Add newline after function signature

* update Petstore

* [go] Add newline after function signature

* update petstore
2019-10-15 14:46:45 +08:00
Thiago Arrais
cb2bf4d2bf Do not check status code for default response (#3322)
* Do not check status code for default response

* Updated generated code/docs

Because Circle CI said

> Please run 'bin/utils/ensure-up-to-date' locally and commit
> changes (UNCOMMITTED CHANGES ERROR)
2019-10-15 01:29:46 +08:00
Colin Arnott
3274592e29 [Go] Fix go.mod and go.sum for 1.13 (#4084)
The openapi-generator-cli currently creates an invalid go.mod file,
according to the go1.13 compiler. This change uses the correct pseudo
version without upgrading or modifying either dependency. It also adds
several missing go.sum dependencies that will break when the toolchain
is run in -mod=readonly mode.
2019-10-10 21:59:53 +08:00
William Cheng
e9a0a51b50
Fix file type in avro template (#4105)
* fix file type in avro template

* update doc
2019-10-09 20:22:57 +08:00
Akira Tanimura
08613691e8 fix enum which is not string of Go (#4077) 2019-10-09 18:35:56 +08:00
Perennes
87c77076ef [AVRO] Fix the package handling for the avro generator (#3987) (#4078)
* [AVRO] Fix the package handling for the avro generator (#3987)

Also fix an issue with the outputFolder that wasn't overridable through opts

* Update sample files through avro-petstore.sh

There's an issue with inlined object but it's already present with the previous commit

* Revert the fix on outputFolder (not a bug)
2019-10-09 15:46:29 +08:00
Jan
bbfcd3bf64 [kotlin-client][kotlin-server] Feature/kotlin data class serial version uid (#4021)
* feat: add companion object to data classes if the implement the interface java.io.Serializable

* style: format template file

* style: adapt to project's original code style

* fix: add missing imports

* style: reverted mustache template to original styling

* test: generate additional samples for kotlin-springboot-reactive and kotlin-springboot

* docs: name full qualified classname of interface java.io.Serializable to prevent confusion with kotlinx.serialization
2019-10-09 15:17:53 +08:00
William Cheng
cf38c56aa6
Fix readonly with isReadOnly (#4102)
* fix readonly

* update samples
2019-10-09 15:16:22 +08:00
William Cheng
8f86f0f04a Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-10-08 21:21:04 +08:00
William Cheng
d4500b307f Merge remote-tracking branch 'origin/master' into 4.2.x 2019-10-04 15:02:58 +08:00
William Cheng
83d64b7e38
[Ruby] fix ruby test, update error message (#4041)
* fix ruby test, update error message

* use block

* update template for api client spec

* update test files
2019-10-04 01:42:28 +08:00
Hinrik Örn Sigurðsson
60567bddd6 [PHP] Correctly format JSON in headers (#4024)
* [PHP] Correctly format JSON in headers

`ObjectSerializer::toHeaderValue()` in the generated PHP code calls
`toString()` on the values, which formats JSON with the `JSON_PRETTY_PRINT`
option. This will result in a multi-line header which cannot be parsed
since linebreaks aren't allowed by RFC 7230.

In my case I have a header schema called `UpdateUser` which I had hoped
would be serialized as `{"type":"staff","id":123}`.

Every single `__toString()` in the generator does the same thing, so I
figured it's safe to change `toHeaderValue()` to convert to JSON directly,
without `JSON_PRETTY_PRINT`. This fix works for me.

* More sensible approach to providing a header value

* Just strip the newlines

* Go back to previous solution
2019-10-03 20:38:15 +09:00
Jan
baa53cbf57 [kotlin-client][kotlin-server] feature: allow creation of kotlin data classes that implement java.io.Serializable (#3997)
* feat: allow creation of kotlin data classes that implement java.io.Serializable, by adding the config option serializableModel=(true|false)

* docs: add markdown docu for new configOption serializableModel

* fix: do not use parcelize in script

* update kotlin samples

* add the option, update the doc
2019-10-02 00:13:00 +08:00
Jim Schubert
7bb3579345
Regenerate go openapi3 samples (#3975) 2019-09-27 19:33:54 -04:00
William Cheng
5eb67d471b Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-09-22 21:00:38 +08:00
William Cheng
3019b5a5e1 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-09-22 14:18:07 +08:00
William Cheng
91a610ec0e
[Kotlin][multiplatform] minor improvements (#3931)
* minor enhancement to kotlin multi platform client

* better code format

* fix kotlin test

* use build

* update kotlin openapi3 sample
2019-09-22 10:00:26 +08:00
Andrew Emery
21e0e0d5d5 Kotlin multiplatform client (#3900)
* Includes Kotlin multiplatform client

Kotlin multiplatform allows Kotlin code to be shared across various target platforms.
This implementation generates Swagger clients for JVM and iOS platforms.

* Includes Kotlin Multiplatform sample scripts

* Updates existing Kotlin samples

* Includes Kotlin Multiplatform samples

* Fixes incorrect Windows sample resource location

* Updates Kotlin client documentation

* Removes unnecessary workaround to remove duplicate entries

* Includes additional multiplatform type and import mappings

* Fixes Kotlin client definitions with multiple enums

https://github.com/OpenAPITools/openapi-generator/issues/3917

* Updates Kotlin samples
2019-09-21 21:48:41 +08:00
William Cheng
ea029b4029
update doc, samples (#3875) 2019-09-11 21:17:11 +08:00
William Cheng
3ebefccfa9
Prepare v4.1.2 release (#3873)
* update samples

* update date
2019-09-11 18:33:27 +08:00
William Cheng
91daca36ef
Better Go code format (#3819)
* better varible naming

* better comments

* better code format for go experimental client

* better comment, update samples
2019-09-04 14:22:06 +08:00
Quim Muntal
8f13b88ed9 Support custom git repository (#3757)
* add gitHost param to GeneratorSettings and related

* parameterize gitHost in READMEs

* parameterize gitHost in go.mod

* parameterize gitHost in git_push

* update petstore samples

* run ./bin/utils/export_docs_generators.sh

* run meta-codehen.sh

* Revert "run meta-codehen.sh"

This reverts commit d6d579f6159186531257cdfdd73b9caf9e9ffeba.

* Revert "run ./bin/utils/export_docs_generators.sh"

This reverts commit 1b81538198d4319fd1b4e97447303e3cc0e8dc99.

* Revert "update petstore samples"

This reverts commit f513add88396707f6991ae2e4920359583ec88f1.

* run ensure-up-to-date
2019-09-03 21:35:49 +08:00
William Cheng
a8fe5d355c Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-08-29 14:48:00 +08:00
prisoneroftech
8f7e43b500 [Kotlin][client] Support gson and moshi as serialization libraries (#3734) 2019-08-29 05:37:13 +02:00
William Cheng
9182784955 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-08-28 14:01:20 +08:00
William Cheng
d0d545bbdd
Prepare 4.1.2 snapshot (#3758)
* update pom

* update samples

* update ts axios samples
2019-08-26 22:13:12 +08:00
Jim Schubert
ee7c8a82e8
[BUG][CLI][GENERATOR] NullPointer when not setting outputDir (updated) (#3752)
* Fixes NPE when no outputDir is set

* Fix behaviors of default values for values not provided by user

* Easier handling of default behavior in settings.

* Fixes for dynamic config deserialization (specifically, ruby client sample fix)

* Tests for WorkflowSettings (defaults, modified defaults, nulls)

* Test modification of WorkflowSettings defaults for both class constructor and builder
2019-08-25 19:19:52 -04:00
Armand Mégrot
1f5aa22f5c Fix null assignation to header/query param map (#3749)
Also regenerates the clients
2019-08-24 23:09:57 +08:00
Armand Mégrot
4898ffa4e9 [Kotlin-client] Authentication support (#3722)
* Handle and document authorization for kotlin client

* Regenerate clients and tests

* Remove testing files
2019-08-22 21:32:07 +08:00
Shogoki
a748e1ff9a [BUG][Python-Flask] Primitive type bytearray deserialization missing in util.py. #2724 (#3642)
* added bytearray to list of types

* adding regenerated sample files for python-flask
2019-08-22 17:15:10 +08:00
William Cheng
8741a8ca35
Minor enhancements to the Avro schema generator (#3728)
* minor enhancements to the avro generator

* add option to customize package name

* update doc
2019-08-22 16:06:04 +08:00
sgadouar
abfef86c8b feature/add-avro-generator (#3662)
* feature/add-avro-generator

* feature/add-avro-generator

* review/test/change output folder generation for avro

* doc/update copyright for avro generator
2019-08-22 14:39:35 +08:00
Justin Sherrill
ef88bd175f [Ruby][faraday] Properly pass verify_mode to faraday (#3652) 2019-08-16 09:45:18 +09:00
Qingping Hou
99fcfbc802 [Python] support api key refresh in configuration module (#3594) 2019-08-15 22:06:36 +08:00
William Cheng
c3535cf9ca
Add test cases to cover different collection formats (#3640)
* add test cases to cover different collection format

* add space params to retrofit 1.x

* add space params to retrofit 2.x

* rename url to localVarUrl

* fix exception in haskell servant
2019-08-15 11:09:12 +08:00
Oliver Ponder
5e27f11ef1 Use the latest version of superagent. (#3579)
* Use the latest version of superagent.

* Run javascript shell scripts.
2019-08-13 15:19:22 +08:00
Qingping Hou
850c493c63 [Python] avoid unnecessary dictionary lookup in get_api_key method (#3592) 2019-08-13 13:55:45 +08:00
William Cheng
1c31dce4bd Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-08-12 00:22:19 +08:00
William Cheng
01222268e8 update samples 2019-08-11 18:56:47 +08:00
William Cheng
5956569e7a
Prepare 4.1.1-SNAPSHOT (#3603)
* update pom

* update samples

* update pom
2019-08-10 09:41:08 +08:00
William Cheng
36dd848440
[OCaml] Add file post-processing (#3583)
* post process file in ocaml, remove unused sample

* auto-format ocaml petstore

* revert formatting

* remove openapi3 ocaml client
2019-08-09 00:17:24 +08:00
William Cheng
7f36f26422
using partials in ruby api_client (#3564) 2019-08-08 09:49:01 +08:00
cgensoul
411199bc99 [OCaml] Added optional params support in API operations (#3568)
* Added handling of api keys in headers.

* Added handling of optional arguments in api functions.

* Optional header params.

* Fixed a bug in path param replacement.

* Relaxed deserializing of model records with @@deriving yojson { strict = false }. It allows receiving more fields in the JSon payload than declared in the OCaml record, fields not matching any record field are ignored.

* Reformatted api-impl.mustache.

* Generate shorter enum value names by allowing underscore character.

* Cleanup of optional params generation.

* Updated the OCaml samples with the latest version of the generator.

* Corrected a bug encountered when generating default value for optional enum fields.

* Added v3 version of the samples for the OCaml generator.
2019-08-07 11:25:32 +08:00
William Cheng
2bbebf9752 [Ruby] clean up Ruby dev dependencies (#3551)
* clean up ruby dev dependencies

* update ensure uptodate to cover ruby faraday
2019-08-06 09:52:48 +09:00
William Cheng
86228e9964
[Ruby] remove auto-generated Gemfile.lock (#3541)
* remove auto-generated gemlock file

* update test file to conform to rubocop format
2019-08-03 16:36:22 +08:00
William Cheng
d45e306480
Use partial for Ruby HTTP libraries (#3539)
* use partial for ruby http libraries

* fix isFaraday

* add back client side validation switch

* remove blank lines
2019-08-02 21:18:24 +08:00
William Cheng
ca85ecb283
[Ruby][Faraday] Various improvements (#3520)
* update ruby faraday oas v2 samples

* skip some default tests in faraday

* add ruby faraday oas v3 client

* add tests, fix url

* add tests to CI

* fix file upload

* undo changes to ruby-client-petstore.sh

* test faraday first

* combine gemspec tempaltes

* test ruby faraday in drone.io

* use smaller image

* update bundler

* use official ruby image

* skip bundler installation

* skip autotest

* install make

* use different image

* skip ruby tests in drone.io
2019-08-02 07:00:29 +08:00
Ivan Aksamentov
ed82aaae97 Fix PHP Symfony OpenAPI 3 sample location. Fixes #3531 (#3532)
* Fix PHP Symfony OpenAPI 3.0 sample location

* Update PHP Symfony OpenAPI 3.0 sample
2019-08-02 06:55:58 +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
Guillaume SMAHA
049f69c55b Use range for dependencies in python-flask (#3470) 2019-07-28 10:40:10 +08:00