Commit Graph

13482 Commits

Author SHA1 Message Date
Nicholas Muesch
2722c602ac Escape query params before invoking api (#5023)
* Escape query params before invoking api

* Update petstore file

* Update remaining petstore examples
2020-01-18 17:25:18 +08:00
Hippolyte HENRY
ee984c38a5 [Java][jersey2] Use builder pattern for requests (#4666)
* Use builder pattern for requests

* petstore

* Add @throws annotation

* regenerate jersey2 test files

* Also group bodyParam in builder class

* petstore java6

* regenerate java8

* ensure up to date
2020-01-18 16:12:20 +08:00
Yuriy Belenko
420039c9eb [Slim4] Add integer formats support to Data Mocker (#4965)
* [Slim4] Support int32 and int64 data formats

* [Slim4] Fix data format key in object mocking

* [Slim4] Refresh samples
2020-01-18 16:08:13 +08:00
William Cheng
ffc69699c0
Add a link to Scala Gatling blog post (#5029) 2020-01-18 15:55:53 +08:00
William Cheng
3f074a280a
minor improve to rust server (#5020) 2020-01-17 18:54:31 +08:00
aandyl
67d23fcf7e [Rust Server] fix handling of special characters in path param names (#4897)
* test for hyphen in path parameter name

* fix handling of hyphens in path parameter names
2020-01-17 15:44:23 +08:00
Josh Burton
f48325ac45 [dart-dio] Fixes issues with DateTime import and form date paramaterToString function (#4929)
- due to the addition of the timemachine library, models were importing ‘DateTime’ when using the core library, which is not a valid import.

- the parameterToString function was copied from the dart2 generator and had some errors when some enums were classes.
2020-01-17 15:35:38 +08:00
William Cheng
bb10e8cdd8 Merge branch 'master' of https://github.com/openapitools/openapi-generator 2020-01-16 21:46:35 +08:00
William Cheng
ef31e8f86b fix permission of codegen classes 2020-01-16 21:46:12 +08:00
William Cheng
0ebdac4ffe
Replace http://central.maven.org with https://repo1.maven.org 2020-01-16 18:38:32 +08:00
Sebastien Rosset
fa0ef2be25 [Python] Conditionally set auth attributes (#4988)
* Enhance python API keys

* Run python scripts under ./bin/openapi3

* fix unit test issue

* Fix unit tests

* Fix unit tests

* Invoke bin scripts
2020-01-16 17:42:23 +08:00
Liv Fischer
b94fe7a40f add multipleOf to CodegenProperty (#2192) (#5009) 2020-01-16 17:27:49 +08:00
chatelao
3218587d2f Fix Maven repo links (incl. https instead of http) (#5013)
The current URLs return a 501 due to missing https and worng url
2020-01-16 17:26:07 +08:00
Justin Black
fcdbcb095e Updates maven urls, fix #5011 (#5012)
* Updates maven urls

* Runs ensure up to date'
2020-01-16 17:24:20 +08:00
Hippolyte HENRY
e09f1c9b37 [go-experimental] Use builder pattern for requests (#4787)
* [go-experimental] Use builder pattern for requests
2020-01-15 09:19:23 -05:00
William Cheng
55c6c0385b
add k8s to the user list (#5002) 2020-01-15 16:21:18 +08:00
Sebastien Rosset
fe8775a5a5 fix php ordering issue for CodegenSecurity (#5001) 2020-01-15 07:39:04 +01:00
William Cheng
50f7e14a99 update samples 2020-01-14 23:07:37 +08:00
sullis
6a48dd7cd6 upgrade Jackson, swagger-core, and swagger-parser (#4915)
- swagger-parser 2.0.17
- swagger-core 2.1.1
- jackson 2.10.1
2020-01-14 22:40:01 +08:00
Justin Black
8a94a3a7d5 [Java] Fixes Spring generator devaultValues for int64/float/double (#4969)
* Updates spring generator to omit type suffixes from int float double defaults, adds testDefaultValuesFixed

Adds the test testDefaultValuesFixed

* Updates SpringCodegen to only remove character suffixes from CodegenParameter defaultValues, updates tests

* Updates java function comment

* Adds early return in postProcessParameter

* Removes unneeded imports

* Fixes decorators on java method postProcessParameter

* Fixes typo

* Fixes paste error

* Removes unused import
2020-01-14 22:38:16 +08:00
Hui Yu
4767259df4 [C-libcurl] Support setting basePath and apiKeys when creating an apiClient (#4960) 2020-01-14 21:36:12 +08:00
Akihito Nakano
65a6d94842 Add a link to blog post in TECHSCORE (#4996) 2020-01-14 20:51:00 +08:00
William Cheng
0344f14e9a
fix csharp-netcore doc (#4987) 2020-01-14 14:11:35 +08:00
Justin Black
bf24d646c5 [PHP] fix php-slim4-server CI tests #4994 (#4995)
* Suggested no-api fix

* Adds sample update
2020-01-14 08:29:18 +03:00
Sai Giridhar P
fb6daa89b0 [r] Ignore cran-comments file from the build (#4986)
* fix(cran-comments): Ignoring CRAN comments file from build

* fix(cran-comments): Ignoring CRAN comments file from build
2020-01-13 21:31:40 +08:00
William Cheng
cf67725e4f
comment out broken tests due to bad data (#4985) 2020-01-13 16:38:29 +08:00
valery1707
b22fde6caa Use UTF-8 charset on writing files (#4984) 2020-01-13 15:26:56 +08:00
valery1707
b22f7f033f Reduce scope of recommended git configuration (#4983) 2020-01-13 10:34:43 +08:00
Jim Schubert
b680d7cd7f
[kotlin] Fixing merge conflict and re-running CI for #4565 (#4977)
* [fix-kotlinArrayEnumEmbedded] fix embedded enum array
* Add new gen props to bin/ci/kotlin-client-string.json

Co-authored-by: nekkiy <hard-t@mail.ru>
2020-01-11 20:52:45 -05:00
Jim Schubert
78bf3adc4a
[core] Initial FeatureSet structures and definitions (#3614)
[core] Initial FeatureSet structures and definitions
Add default feature set to DefaultCodegen
Initial FeatureSet definitions for:

*  ada 
*  android 
*  apache2 
*  asciidoc 
*  aspnetcore 
*  avro 
*  bash 
*  c 
*  clojure 
*  cpp-pistache-server 
*  cpp-qt5-client 
*  cpp-qt5-qhttpengine-server 
*  cpp-restbed-server 
*  cpp-restsdk 
*  cpp-tizen 
*  csharp 
*  csharp-nancyfx 
*  csharp-netcore 
*  cwiki 
*  dart 
*  eiffel 
*  elixir 
*  elm 
*  erlang 
*  flash 
*  fsharp-functions 
*  go  Client/Server
*  graphql-nodejs-express-server 
*  graphql-schema 
*  groovy 
*  haskell 
*  haskell-http-client 
*  java 
*  jmeter 
*  kotlin 
*  kotlin vertx 
*  kotlin-server 
*  kotlin-spring 
*  lua 
*  mysql 
*  nim 
*  nodejs 
*  nodejs-express 
*  objc 
*  ocaml 
*  openapi 
*  openapi-yaml 
*  perl 
*  php 
*  php-laravel 
*  php-lumen 
*  php-silex 
*  php-slim 
*  php-symfony 
*  php-ze-ph 
*  powershell 
*  protobuf 
*  protobuf-schema 
*  python 
*  python-aiohttp 
*  python-blueplanet 
*  python-experimental 
*  r 
*  ror 
*  ruby 
*  ruby 
*  ruby-sinatra 
*  rust 
*  scala-akka 
*  scala-finch 
*  scala-gatling 
*  scala-http-client 
*  scala-lagom 
*  scala-play 
*  scalatra 
*  scalaz 
*  spring 
*  static docs 
*  swift 
*  typescript
2020-01-11 16:20:47 -05:00
William Cheng
4627c7d534
Add Cisco to the user list (#4971) 2020-01-11 10:48:44 +08:00
William Cheng
5e5536367b comment out php slim4 in ensure-up-to-date 2020-01-11 01:01:42 +08:00
William Cheng
20c7400d56 update samples 2020-01-10 21:51:59 +08:00
Justin Black
cbc12543a9 [Python] Allow models to have properties of type self (#4888)
* Refactors openapi_types into a staticmethod

* Adds a Player model with a self type rpoperty, adds a test to ensure that it is working right
2020-01-10 17:43:35 +08:00
Steve Porter
75508f5ce0 Add npmRepository option to javascript generators (#4956) 2020-01-10 17:02:50 +08:00
Yuriy Belenko
6dcdf5c311 [Slim4] Add ref support to Data Mocker (#4932)
* [Slim4] Add new method to Mocker interface

* [Slim4] Add implementation and tests for new method

* [Slim4] Add test fixture to encrease code coverage

* [Slim4] Add ref support to mockArray method

* [Slim4] Add mockFromRef method

* [Slim4] Add ref support to mockObject method

* [Slim4] Add ModelInterface

* [Slim4] Refresh samples

* [Slim4] Add ref support to mockFromSchema method

* [Slim4] Run all test suites by default test command

As it turnes out to generate coverage report for a whole project I need
to run all test suites at once.

* [Slim4] Fix enum option of string mocking
2020-01-10 16:27:43 +08:00
Artem Shubovych
2d24d42e65 Fix auto-labeler for jax-rs (#4943) 2020-01-08 23:55:32 -05:00
Jim Schubert
a2532cc3c5
[doc] full generator details (#4941) 2020-01-08 21:54:05 -05:00
William Cheng
5ec34b9b59
comment out python flask 2 test (#4949) 2020-01-08 21:59:18 +08:00
Jérémie Bresson
c27a6ed2bf [jaxrs-spec][quarkus] update to version 1.1.1.Final (#4935)
* [java][quarkus] update to version 1.1.0.Final

* [java][quarkus] update to version 1.1.1.Final
2020-01-08 21:30:36 +08:00
Jim Schubert
e23f2aa6aa
[cli] Full config help details (#4928)
* [cli] Dump additional generator info via config-help (plain text)
* [cli] Dump additional generator info via config-help (markdown)
2020-01-07 13:33:58 -05:00
Ryan N Johnson
d51354783f Add RequestFile to typescript-node model template (#4903)
RequestFile is defined in the [api-all.mustache
template](ac4ead9e78/modules/openapi-generator/src/main/resources/typescript-node/api-all.mustache (L29)),
and it gets used [as a special
case](ac4ead9e78/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java (L92))
[in the model.mustache
template](ac4ead9e78/modules/openapi-generator/src/main/resources/typescript-node/model.mustache (L21)).

When this special case is triggered and `RequestFile` is used in a model
file, Typescript complains that the type is not found.

```
TSError: Unable to compile TypeScript:
path/to/model.ts:15:16 - error TS2304: Cannot find name 'RequestFile'.

15      'myFile'?: RequestFile;
                   ~~~~~~~~~~~
```

This solution is to import `RequestFile` by adding it to the model
template.

Here is an openapi schema that would trigger this use-case:

```yaml
openapi: 3.0.0
components:
    schemas:
        IUploadMyFileBody:
            type: object
            properties:
                myFile:
                    type: string
                    format: binary
```
2020-01-06 10:09:56 +01:00
Jim Schubert
ec1e9a4c9b
[csharp] enum suffix changes enumValueNameSuffix to enumValueSuffix (#4927)
* [csharp] Change enum value suffix name

'enumValueNameSuffix' and 'enumNameSuffix' were introduced in a recent
commit. This changes 'enumValueNameSuffix' to 'enumValueSuffix' to
better differentiate between the two options. This also adds a caveat to
the default description which explains that this flexibility may cause
issues when used by client generator.

* [csharp][aspnetcore] Regenerate samples
2020-01-05 16:18:19 -05:00
scott dallamura
9b893ef3c1 [C#] allow customization of generated enum suffixes (#4301)
* [C#] allow customization of generated enum suffixes
2020-01-05 10:25:08 -05:00
Matt Traynham
38185d8558 [Kotlin] Correct isInherited flag for Kotlin generators (#4254)
* Correct isInherited flag for Kotlin generators

* Update Kotlin Client inheritance test to check variables
2020-01-05 10:10:03 -05:00
Richard Whitehouse
79d11d7129
[Rust Server] Fix panic handling headers (#4877)
[Rust Server] Fix panic handling headers

If we have an API which has multiple auth types, we may panic. This is because
in Hyper 0.11, the following code will panic:

```
use hyper::header::{Authorization, Basic, Bearer, Headers};
fn main() {
    let mut headers = Headers::default();
    let basic = Basic { username: "richard".to_string(), password: None };
    headers.set::<Authorization<Basic>>(Authorization(basic));
    println!("Auth: {:?}", headers.get::<Authorization<Bearer>>());
}
```

as it mixes up an `Authorization<Basic>` and `Authorization<Bearer>` as both
have `Authorization:` as the header name.

This is fixed by using `swagger::SafeHeaders` added in
https://github.com/Metaswitch/swagger-rs/pull/90
2020-01-05 14:46:09 +00:00
Jim Schubert
c2ee4aefe1 Initial CODEOWNERS (#4924) 2020-01-05 22:23:04 +08:00
Jim Schubert
25036e48d5
[scala] Support for Set when array has uniqueItems=true (#4926)
* [scala] Set support for unique arrays

This includes and builds upon community contribution for better Set support in Scala.
It makes property + model work as expected with Set and default values
across all Scala generators. Included tests to account for new changes.

This also reverts the community contribution to remove ListBuffer
imports and change the default for array to ListBuffer. Users should use
the instantiation types map to modify the desired array instantiation
type. Any new default should target a new minor release after community
discussion, as it affects all existing SDKs generated with
openapi-generator.

* [scala] Improve default handling of monadic collection type

* [scala] Regenerate samples

* Update ScalaPlayFrameworkServerCodegen.java

Scala Play defaulted to List and should continue to do so.

Co-authored-by: František Kocun <frantisek.kocun@gmail.com>
2020-01-05 09:20:56 -05:00
William Cheng
965efdd965
remove nodejs server samples, scripts (#4919) 2020-01-05 21:53:22 +08:00
Andrii
6dc3216f6d Added ability to work with defaultHeaders and fixed authentication for code generated by openapi-generator for typescript-node (#4896)
* Added ability to work with `defaultHeaders` and fixed authentication for code generated by openapi-generator for typescript-node:
 - added getter/setter for `defaultHeaders` property
 - fixed authentication for clients that support several auth methods (use auth method only if auth credentials are set)

* Update petstore templates
2020-01-05 21:41:51 +08:00