8767 Commits

Author SHA1 Message Date
William Cheng
b1efe20a04
[PowerShell] minor improvements and bug fixes (#5635)
* add output type, minor format fix

* minor test improvement
2020-03-19 22:51:13 +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
Lars Hvam
d42f27c9f5
[typescript-fetch] add interfaces, withInterfaces (#5612)
* typescript-fetch: interfaces, first draft

* fix name in description
2020-03-17 22:04:30 +01:00
Adam
47e24af369
[Kotlin] Remove kotlin-reflect dependency when not needed (#5502)
* Remove kotlin-reflect dependency when using CodeGen

* Update Kotlin tests

* Regenerated unit test samples

* Remove newline in generated build.gradle files
2020-03-17 21:24:14 +08:00
Clemens Angermann
e99b3e038a
Adding Response Interceptor (#5500)
* added Response interceptor for native clients

* added Response interceptor for native clients
2020-03-17 16:59:36 +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
9ba7c4af3c
[swift5] stop hiding network error (#5603)
* [swift5] stop hiding network error

* [swift5] stop hiding network error
2020-03-17 15:42:09 +08:00
Sebastien Rosset
a16079ce7b
[Java] Generated API class has wrong dataType and does not compile Issue (#5331)
* add unit test assertion

* add check for composed schema

* add support for x-allOf-name

* change x-allOf-name to x-all-of-name

* Add more troubleshooting information

* Add more troubleshooting information

* Add more troubleshooting information

* Add more troubleshooting information
2020-03-17 15:37:33 +08:00
Aleksandr Nekrasov
b40257f53a
fix default value for abstract scala and scalatra server impl (#5578) 2020-03-17 15:04:13 +08:00
Antoine Reilles
27175c71df
[jaxrs-cxf-cdi] Support PATCH httpMethod (#5574)
Update the required CXF version to 3.1.2 since PATCH support appeared
with this version.

Add the cxf PATCH annotation to the imports so that the generated code
when defining a PATCH api compiles.
2020-03-17 14:59:35 +08:00
anoohya-n
d750d6643d
NodeJS - Adds missing keyword (#5606) 2020-03-17 14:54:29 +08:00
Marcin Kubala
0cf5d356cc
Scala-Akka: Add missing body to PATCH requests (#5605) 2020-03-17 01:02:06 -04:00
Justin Black
0a3272697d
Adds parseFlattenSpec (#5526)
* Adds parseFlattenSpec, updates tests and helper functions

* Adds parseSPec invocation inside parseFlattenSpec
2020-03-16 21:12:36 -04:00
Michele Albano
fc9d4584ca
PR to solve 2 open issues on enums: #5091 and #4293 (#5477)
* PR to solve 2 open issues on enums:
Issue 5091 needs to generate enums also when the enum is directly in a param to a API call, instead than in a model. I did that by copying and adapting enum code from *model* to *api*
Issue 4293 needs to decorate enums, for when enum names or enum values are repeated over the yaml definition.

* PR to solve 2 open issues on enums:
Issue 5091 needs to generate enums also when the enum is directly in a param to a API call, instead than in a model. I did that by copying and adapting enum code from *model* to *api*
Issue 4293 needs to decorate enums, for when enum names or enum values are repeated over the yaml definition.

* Enums decorated: with {{projectName}}_{{classVarName}}_{{enumName}}_ in the models, with {{projectName}}_{{classVarName}}_{{enumName}}_ in the operations.

* Changes to the c client:
- Removed white space.
- Removed ToJSON and FromJSON function for the enums, since they are not used
- Sanitized project name in the .java file. For example, this solves a problem with the issue #2338, where the yaml file had title: "Skycoin REST API."

* Changes to the c client:
- Removed white space.
- Removed ToJSON and FromJSON function for the enums, since they are not used
- Sanitized project name in the .java file. For example, this solves a problem with the issue #2338, where the yaml file had title: "Skycoin REST API."
2020-03-16 13:53:53 +08:00
Sebastien Rosset
5e6a261d12
[go-experimental] Do not generate HTTP signature unit test for every generated SDK (#5588)
* Do not generate HTTP signature unit test for every generated SDK

* Add golang 1.14 to CI environment

* fix unit test issues

* remove script commands that were commented out

* add support for ed25519 private keys
2020-03-14 19:34:58 -04:00
Jon Schoning
972bd8e280
[haskell-http-client] update stack; exclude problem time versions (#5589) 2020-03-13 11:40:06 -05: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
Bruno Coelho
86159cba49
[Swift] fix URLSession file upload (#5546)
* [swift5] - fix URLSession file upload

* [swift5] - fix URLSession file upload

* [swift5] fix file upload

* [swift5] - fix URLSession file upload

* [swift] add unit tests for file upload

* [swift] update samples copyright
2020-03-13 22:04:57 +08:00
Esteban Gehring
ddeef5114b
typescript-angular: fix zone-js version for angular 8 (#5585) 2020-03-12 10:00:01 +01:00
Samuel Hoffstaetter
de2753dfc7
[markdown] Fix broken links when generating markdown (#5569)
* [markdown] Fix broken links when generating markdown

The `api.mustache` file generates links to the markdown model files.
These links were previously brokeen.

Additionally, the defaultPackage for markdown is "/Models", so this
looked pretty in the heading for model files. So this prefix has been
stripped from the header in `model.mustache`.

* Re-generate Petstore samples for markdown
2020-03-11 01:30:00 +08:00
Sebastien Rosset
b1aecaded0
[Java] fix runtime exception when there are multiple auth methods (#5530)
* fix runtime exception when there are multiple auth methods

* Refactor a bit so that it does not cause conflict with relative url token branch
2020-03-11 01:22:56 +08:00
Sebastien Rosset
6034c09130
[Java] Fix exception when OAuth2 token URL is a relative URL (#5535)
* Add support for case when OAuth2 token URL is a relative URL

* Add support for case when OAuth2 token URL is a relative URL

* run scripts under bin
2020-03-11 01:18:08 +08:00
Bruno Coelho
f402126460
[Kotlin][client] fix file upload (#5548)
* [kotlin] fix file upload

* [kotlin] fix file upload

* [kotlin] fix file upload

* [kotlin][client] fix jackson integration

* [kotlin] fix file upload

* [kotlin] fix file upload
2020-03-11 01:04:53 +08:00
siada
a93186b8e3
Update generic model to support nullable properties (#5568) 2020-03-10 08:20:51 +01:00
Richard Whitehouse
16646b39c1
[Rust Server] Make parse error Display-able (#5490)
* [Rust Server] Make parse error displayable

  Change error type to be displayable to prevent compile errors

* [Rust Server] Add test for enum in path

* Update samples
2020-03-08 11:12:17 +00:00
Richard Whitehouse
e4be8a107f
[Rust Server] Test allOf objects including base properties (#5457)
* [Rust Server] Add operationIds for rust-server-test

* [Rust Server] Add test for allOf

* Update samples
2020-03-07 20:53:13 +00:00
Richard Whitehouse
b60fc900b2
[Rust Server] Support OpenAPI v3 callbacks (#5405)
* [Rust Server] Support Callbacks

* [Rust Server] Support callbacks in the examples

* [Rust Server] Update features documentation

* [Rust Server] Mark as supporting callbacks

* Update samples

* [Rust Server] Add tests for callbacks

* [Rust Server] Fix README

Don't suggest examples which don't exist
2020-03-07 19:24:42 +00:00
Justin Black
67e3bf5271
Fixes kwargs typos, removes E501s (#5552) 2020-03-06 20:22:19 -08:00
Sebastien Rosset
20011194c0
Add serialization of ModelComposed (#5551) 2020-03-06 17:25:45 -08:00
William Cheng
0ffcbfe75e
update jackson dependency to newer version (#5527) 2020-03-06 14:49:58 +08:00
William Cheng
3588990a4f
[PHP] complete support for form style (#5519)
* [BUG][PHP] Parameter property style not fully implemented (related to comment on PR #3984)

* [AUTOGENERATED][PHP] Sample Files
2020-03-05 22:20:59 +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
William Cheng
6db09f40be
[php] replace $collectionFormat with $style (#5517)
* php - remove $collectionFormat

* update php openapi3 petstore sample
2020-03-04 15:54:44 +08:00
copypasta-g
3e5fb670e2
fix(php): no need to serialize collections, Guzzle does that, fix #2292 (#3984)
* fix(php): only serialize collections if !explode, Guzzle handles the rest, fix #2292

* fix(php): update petstore samples

Co-authored-by: Mahdi Dibaiee <mdibaiee@pm.me>
2020-03-04 10:23:30 +08:00
Daniel Klessing
33129ca104
[Java][Spring][Spring-Cloud] Fix #5144 - Use conditional package declaration to avoid unnecessary dependencies (#5145)
* FIX: Use conditional package declaration to avoid unnecessary dependencies

* DEV: Adjusted sample ClientConfiguration.java for async spring-cloud
2020-03-04 10:21:46 +08:00
Yuriy Belenko
39aeb4a8ae
[Slim4] Add Data Mocker middleware (#4978)
* [Slim4] Store response schemas

* [Slim4] Add Data Mocker middleware

* [Slim4] Enhance Slim router

* [Slim4] Enhance config

* [Slim4] Fix data format key in object mocking

* [Slim4] Add tests for Data Mocker middleware

* [Slim4] Add Mock feature documentation

* [Slim4] Refresh samples
2020-03-03 23:53:57 +08:00
Jim Schubert
51cc7c2f2a
[core] Sanitize/underscore/camelize cache expiry (#5484)
The helper methods for sanitize/underscore/camelize were recently
updated to cache values in static maps. This would lead to a memory leak
in hosted environments as the maps had no cleanup/expiry.

This moves those cached entries to Caffeine caches with expiry based on
last access to allow the edge-case performance improvement gains on very
large documents, without the memory leak in hosted or embedded
environments.
2020-03-03 17:29:51 +08:00
Bodo Graumann
c27d4001e1
Typescript array alias array (#4981)
* Add failing tests for typescript type declaration

* Refactor array and map child type string fallback

* Add unaliasSchema to typescript getTypeDeclaration

* TypeScriptRxjs: Use Blob as file type declaration

This was inadvertantly changed in
https://github.com/OpenAPITools/openapi-generator/pull/5266
2020-03-03 17:20:49 +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
ChristianCiach
a10452e37f
Add missing @Generated annotation. (#5384)
The annotation is present on other generated files when using jaxrs-spec, but it missing on model classes.
2020-03-01 23:19:17 +08:00
Jorge Rodriguez
21e285cea9
[BUG] [JAVA | Spring] Cookie in parameter is not correctly generated (#5393)
* Cookie in parameter is not correctly generated

* gh-5386: Fix cookie parameter in

* gh-5386: Fix cookie parameter in

* gh-5386: Update test file

* gh-5386: Fix cookie parameter in

* gh-5386: Fix cookie parameter in

* gh-5386: Regenerate samples

* gh-5386: Fix test

* Added Spring CookieValue tests

Co-authored-by: Gonzalo <gonzalo.nom.es@gmail.com>
2020-03-01 23:12:20 +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
Richard Whitehouse
8f8443d175
[Rust Server] Don't change API version (#5458)
Don't change the API version which is exposed in `crate::API_VERSION`.

- If the API version isn't set, we don't expose it.

- If it is set, we leave it well alone.

- Always pass a package version:
 - Pass in the passed package version by preference
 - Pass in the API version if it's not.
   - If the API version isn't set, we use 1.0.0
   - If it is set, and isn't a valid semver, we append .0 such that we have
     something with three digits (so that an API version of 1 works).
2020-03-01 10:32:11 +00:00
Yutaka Miyamae
015b404729
[kotlin]Fix ktor doesn't generate nullable types (#5258)
* If not required, need `? = null`

* run  ./bin/kotlin-server-petstore.sh

* Added `?` when value is `required` and `isNullable`

* Rerun ./bin/kotlin-server-petstore.sh. But No differences
2020-03-01 17:58:58 +08:00
Jim Schubert
f6f5c9b8b9
[cli][gradle] Validate now uses parseOptions w/setResolve (#5471)
* [cli] Validate now uses parseOptions w/setResolve

The validate command now uses ParseOptions#setResolve(true) to match how
we parse in CodegenConfigurator and online's Generate. Without this
option, the OpenAPI 3 parser skips the "resolve" block, which made lead
to validations in the command not matching validations during
generation.

* [gradle] Validate now uses parseOptions w/setResolve

The Graldle validate command now uses ParseOptions#setResolve(true) to match how
we parse in CodegenConfigurator and online's Generate. Without this
option, the OpenAPI 3 parser skips the "resolve" block, which made lead
to validations in the command not matching validations during
generation.
2020-03-01 17:26:13 +08:00
Jiri Kuncar
a03f7a58c3
[java] Support aliasing of API keys (#4966)
* [java] Support aliasing of API keys

* Rebuild Java Jersey2 sample client

* x-lookup to x-auth-id-alias

* Regenerated
2020-03-01 16:33:18 +08:00
Jiri Kuncar
35e90a553d
[go-experimental] Support aliasing of API keys (#4940)
* [go-experimental] Support aliasing of API keys

* Use {{.}} inside condition

* Use name instead of keyParamName for lookup

* x-lookup to x-auth-id-alias
2020-03-01 16:31:37 +08:00
Hui Yu
10d5d27a7c
[C-libcurl] The name in API parameter should not be escaped even though it includes a C key word. (#5487) 2020-03-01 10:54:53 +08:00
Richard Whitehouse
dc0da57f96
[Rust Server] Suffix reserved words with _ (#5455)
* [Rust Server] Suffix reserved words with _

Suffix reserved words with an underscore instead of prefixing them.

This follows convention in the Rust community, as prefixing with an underscore
indicates an unused variable in Rust.

* Update samples
2020-03-01 00:23:00 +00:00
Richard Whitehouse
a196296e57
[Rust Server] Support RFC 7386 (#5454)
* [Rust Server] Support RFC 7386

Support application/merge-patch+json as defined by RFC 7386 -
https://tools.ietf.org/html/rfc7386

Handle exactly the same as application/json.

* [Rust Server] Add test for RFC 7386

* Update samples
2020-02-29 21:54:11 +00:00