Commit Graph

7095 Commits

Author SHA1 Message Date
William Cheng
9695090d9b
[R] Fix NPE issue due to default value using example value (#2231)
* fix NPE issue due to default value using example value

* update r petstore sample
2019-02-25 19:09:26 +08:00
William Cheng
8e7ad9c9b6
Removal of number being default to example in python client (#2228)
* remove number default to example in python client

* update python samples
2019-02-25 16:44:38 +08:00
William Cheng
e6658278ad
R client refactoring (#2215)
* [R] fix namespace, use 2-space indentation (#2105)

* fix namespace, indentation

* use 2-space indentation in model files

* update gitignore

* use PascalCase for function naming (#2106)

* [R] improve .travis.yml, .Rbuildignore (#2109)

* update travis

* enhance travis.yml

* update travis, .Rbuildignore

* [R] Add auto-generated documentations, change parameter naming (#2114)

* add auto-generated doc for r client

* remove module name

* replace nil with void

* [R] fix object serialization to JSON (#2129)

* fix object serialization

* fix array property seriziation

* fix deserializing array of string

* fix array of object deserialization

* [R] Fix return type (#2140)

* fix return type

* update r petstore sample

* add auto-generated tests (#2141)

* rename file to conform to style guide (#2142)

* add authenticaiton support to R (#2153)

[R] Add authentication support, minor ApiClient refactor

* rename test files

* [R] various improvements and bug fixes (#2162)

* fix api keys in headers

* use optional parameter in function signature

* fix property naming

* fix doc assignment operator

* [R] fix base64 encode (#2171)

* fix base64 encode

* fix basic http auth

* fix typo, update instruction (#2203)

* rename test files to conform to style guide (#2206)

* [R] improve class constructor (#2208)

* update constructor with optional parameter, default value

* update r petstore sample

* clean up files

* regenerate files

* Revert "rename test files to conform to style guide (#2206)"

This reverts commit 90a6302a6565d208a6ab298fda41a47836a63d9c.

* fix query parameter in api client (#2214)
2019-02-23 23:51:11 +08:00
William Cheng
f2002b25da
[Python] remove default value from being fallback to example (#2213)
* remove example fallback

* reset test case
2019-02-22 20:44:27 +08:00
Kevin Howell
329843bc92 Gradle - make GenerateTask properties optional (#2185)
This allows easier creation of custom `GenerateTask`. Specifically, this makes:

 - generateModelTests
 - generateModelDocumentation
 - generateApiTests
 - generateApiDocumentation
 - withXml

optional, following the same pattern as other properties in GenerateTask.

Without this change, we get `java.lang.IllegalStateException: No value
has been specified for this provider.` until these properties are
specified for the task, when attempting to define a custom generate task
(such as one to generate API docs).
2019-02-21 18:18:47 -05:00
Stefan Dresselhaus
ae376c151b Something in the dependencies changed. This switch is no longer needed. (#1850) 2019-02-20 15:25:11 +08:00
boxdot
bc6c94d412 Use oauth token for basic bearer auth in Rust. (#2161)
* Use oauth token for basic bearer auth in Rust.

* Add bearer_access_token instead of reusing oauth_access_token
2019-02-20 10:17:22 +08:00
Akihito Nakano
1d08296f96 Fix missing nullable (#2189)
* Add test case which reproduces the issue

* Fix missing `nullable`

* Tweak property name

* Add test case which covers `Paths`

* Add test case for CodegenProperty.isNullable

* Fix missing CodegenProperty.isNullable

* Rename r -> referencedSchema
2019-02-19 23:57:24 +08:00
Lukas Steinbrecher
c79d27708f Enable error handling in Java WebClient library, fixes #1243 (#1244)
* enable error handling in Java WebClient library, fixes #1243

* remove custom error handling logic in Java WebClient library, fixes #1243
2019-02-19 22:47:22 +08:00
Jérémie Bresson
fda867ebfe [core] fix referenced enum case (#2175) 2019-02-19 22:42:32 +08:00
victor-xplore
1dadd45ffe rest-template: allow array parameters in path using collectionFormat (#2177)
* 2125: java-resttemplate: Support collection formats in pathParams

* run ./bin/java-petstore-resttemplate.sh
run ./bin/java-petstore-resttemplate-withxml.sh
2019-02-19 22:00:27 +08:00
rhard
70180e074c Fix string types for cpprestsdk client generator (#1676)
* Fix string types for cpprestsdk client generator

* Regenerate the samples for restsdk-client
2019-02-18 22:34:51 +08:00
Diego Mascialino
cd1885d29e Remove API Key Authentication code for go when cookie is used. (#1601) 2019-02-18 21:51:31 +08:00
MBcom
b4c36425c2 changed the package install instructions to install the .tgz package … (#1989)
* changed the package install instructions to install the .tgz package instead of symlinking the package - otherwise you'll get trouble with links on windows

* samples added

* added samples
2019-02-18 21:32:30 +08:00
Jacob Weber
534ff3607f okhttp-gson: allow array parameters in path using collectionFormat (#2137)
* okhttp-gson: allow array parameters in path using collectionFormat

* run bin/java-petstore-okhttp-gson-parcelable.sh
2019-02-18 21:30:56 +08:00
Akira Tanimura
8d6278bd4c [Ruby] Fix regualr expression in error message (#2069) (#2139)
* Fix usage of regular expression literals in Ruby client (#2069)

* update samples of Ruby client (#2069)
2019-02-18 21:18:55 +08:00
Alexander Navratil
aace459217 [kotlin][client] bytearray conversion (#2166)
* use kotlin.String for ByteArray fields (type: string, format: byte)

* revert "use kotlin.String for ByteArray fields (type: string, format: byte)"

* add ByteArrayAdapter for string <-> ByteArray conversion with moshi
2019-02-18 18:46:44 +08:00
Luis Alejandro Herrera León
b4b8c28b2a [rust-server] Added client documentation to rust-server (#2159)
* Added client documentation to rust-server

* Removed comments

* Removed go auth example
2019-02-18 18:02:40 +08:00
Vincent Devos
594af33fb8 [Java] Getter/Setter naming convention not followed in generated models (#2095)
fix the getter/setter when the second letter of the field name is already uppercase (following the JavaBeans API specification)
2019-02-18 18:00:35 +08:00
Pablo Lázaro
ad8aa7dc0e [Java] adds snapshotVersion CLI option and uses API version as artifactVersion by default (#2033)
* [Java]: adds snapshotVersion CLI option and uses API version as artifactVersion by default

* fix some typos

* fix naming diff between branches

* ensure-up-to-date

* update samples
2019-02-18 17:54:27 +08:00
Vincent Devos
8d5b600277 [typescript-angular] Update default Angular version from 4.3 to 7.0 (#2117)
* [typescript-angular] Update default Angular version from 4.3 to 6.0 (NPM Client)

* [typescript-angular] Update default Angular version from 4.3 to 7.0 (NPM Client)
2019-02-18 17:49:42 +08:00
sunn
851d11cf72 Fix failing build due to deprecation of initialCaps (#2168)
Include functional for failing build in debian
2019-02-18 00:46:20 +08:00
Vincent Devos
027e6c4a5c [plugin][maven] add missing General Configuration parameters in README (#2156) 2019-02-16 22:12:19 -05:00
Luis Alejandro Herrera León
cefd29b6ff [rust-server] Changed query parameters to be url encoded (#2136)
Based on this [issue](https://github.com/servo/rust-url/issues/416) the `utf8_percent_encode` doesn't percent encode `+` instead treats it as a space which is may cause a problem if the query parameters contain one. For example if we wanted to use a DateTime range in query parameters:

`{base_path}{path}?start=2019-02-12T00:00:00+00:00&end=2019-02-13T15:00:00+00:00`

These parameters may be decoded as:

```
start = 2019-02-12T00:00:00 00:00
end = 2019-02-13T15:00:00 00:00
```

To solve this I changed query parameters to be form-urlencoded using `url::form_urlencoded` based on what's done in [`rust` client generator](ea08106c80/modules/openapi-generator/src/main/resources/rust/request.rs (L106)).
2019-02-15 13:18:08 +00:00
alex-korobko
42544b8234 Issue 1766 Modified mustache files for Go to support nullable in the … (#1869)
* Issue 1766 Modified mustache files for Go to support nullable in the spec v3.0+; Updated model files running .sh scripts for Go.

* Add "nullable" to fake yaml

* Add sample script for OAS3

* Fix output folder (openapi3)

* Run bin/openapi3/go-petstore.sh

* Update samples

* Update jaxrs-jersey

* Update python and php samples

* Add bin/openapi3/go-gin-petstore-server.sh

* Run bin/openapi3/go-gin-petstore-server.sh

* Update bin/openapi3/go-petstore-server.sh to generate "nullable" samples

* Run bin/openapi3/go-petstore-server.sh

* Fix duplicated `import`
2019-02-15 11:08:52 +09:00
Gocha Ossinkine
161cb88e88 Don't try to detect response format if method return nothing (#2073) 2019-02-14 19:55:40 +09:00
Gocha Ossinkine
2593d78ce6 Use Symfony Validator service (#2143) 2019-02-14 19:34:20 +09:00
Gocha Ossinkine
d87a3b90da Validate input objects (#2144) 2019-02-14 19:32:21 +09:00
Esteban Marin
e01a786bc9 #2147: fix compiler error in angular typescript codegen (#2149)
* #2147: fix compiler error in angular typescript codegen

* #2147: generate samples
2019-02-14 16:39:08 +08:00
Esteban Marin
804b589f5f Revert "Don't escape [ and ] in query param keys (#2107)" (#2128)
This reverts commit ba9c12f2e0.
2019-02-13 18:17:42 +08:00
Michael van Niekerk
550774a6e2 Typescript+Axios: multipart/form-data correctly handled (#2002)
* Typescript 3.2

* Typescript spread operator

* Add vendor extension to the operation

* Remove url.URLSearchParams

* Generate form data in API

* Make axios scripts executable

* Reran generator

* Generate sample code

* Revert to 2.4 Typescript

* COLLECTION_FORMAT.{{collectionFormat}} everywhere for consistency

* Consistency on the CollectionFormats, comment on the vendor extension

* fix compilation error
2019-02-13 16:29:46 +08:00
Jérémie Bresson
598bf0cd09 [core] consider schema in headers when computing unused schemas (#2138) 2019-02-13 16:19:05 +08:00
Benoît Courtine
b6c2266a14 [Rust][Client] Code format (#2042)
Rust clients code format cleanup (with some breaking changes for model structures):

* Application of Rust style in client files (4 spaces padding). Remove useless blank lines.
* Replace getters/setters in models by public fields.
* Add a trailing comma in struct fields.
* Sample Rust clients regeneration.
2019-02-13 00:51:16 +00:00
Jérémie Bresson
ea08106c80 [core] Fix NullPointer when schema is not set in header (#2133) 2019-02-13 02:27:20 +08:00
karismann
de33360883 [typescript-angular] Incorrect OperationId Generated (starting with number) (#2130)
append _ at the beginning, as reserved keyword
2019-02-13 02:26:45 +08:00
Julian
add63cb981 [PHP] Replace File.seperator with slashes in PHP projects #2004 (#2007)
* [FIX] Replace File.seperator with slashes in PHP projects.

* Replaced 'File.separator' with slashes in AbstractPhpCodegen.
2019-02-13 02:26:15 +08:00
Jérémie Bresson
f1fa0a80ad
[clean-up] Centralize Swagger-Parser calls in the unit tests (#2110) 2019-02-12 06:09:21 +01:00
Sven Panne
fd0847864a Fixed handling of dotted module names in python generator. (#2016)
Previously, if you used a packageName of the form "foo.bar.baz", half of the
generated files of the python generator went into a subdirectory
"foo/bar/baz" (correct), the other half went into a subdirectory
"foo.bar.baz" (incorrect).
2019-02-12 12:20:34 +08:00
Akira Tanimura
33a8939bd5 [Ruby] Fix enum expansion in Ruby client (#2081) (#2104)
* use double-quote string for enum value (#2081)

* use enumVars in templates for Ruby client (#2081)

* delete unnecessary line in enum model of Ruby client (#2081)

* update samples of Ruby client (#2081)
2019-02-12 00:32:36 +08:00
Gocha Ossinkine
5c64b58bae Fix JMSSerializerBundle version (#2057) 2019-02-12 00:17:43 +08:00
BastiOfBerlin
ba9c12f2e0 Don't escape [ and ] in query param keys (#2107)
rails' default naming for arrays is name[]=...&name[]=...
It doesn't recognize the escaped forms %5B + %5D but fails silently
2019-02-12 00:17:04 +08:00
Gocha Ossinkine
73d309b9ba Catch serializer exception (#2074) 2019-02-10 15:41:09 +08:00
john lilley
f76dca84f5 Fix Bug 1433 decimal literal in C# maybe other languages (#1436)
* Trivial change to kick PR again

* Fix issue 1433 (default decimal literal broken for C#)

* Replace tab with space

* update samples
2019-02-10 15:28:40 +08:00
Akira Tanimura
7dcffff20b [Ruby] Fix Ruby client to prevent Rubocop's rule violations (#2100) (#2102)
* [Ruby] Delete empty lines and trailing newline in template to prevent Rubocop's rule violation (#2100)

* [Ruby] update samples of Ruby client (#2100)
2019-02-10 09:29:34 +09:00
William Cheng
20d5adcdd5 [PHP] remove deprecated options (#2083)
* php remove deprecated options

* update php doc

* clean up composerVendorName in code, templates

* update samples
2019-02-10 09:25:20 +09:00
William Cheng
e0ed6719a0 Add "servers" support to the operation, path in PHP API client (#2072)
* add servers support to path, operation in php client

* remove servers from spec

* update based on feedback
2019-02-10 08:27:41 +09:00
davidwcarlson
ef7b28de00 fix 457 Support for Bearer Auth (#1930)
* fix #457 by introducing an HttpBearerAuth object

See https://github.com/OpenAPITools/openapi-generator/issues/457
Also https://github.com/OpenAPITools/openapi-generator/issues/1446 for typescript, https://github.com/OpenAPITools/openapi-generator/issues/1577 for python

Specs defined as follows currently generate BasicAuth and send an "Authorization: Basic [base64Encode(username + ":" + password)]" header
    components:
      securitySchemes:
        bearer:
          type: http
          scheme: bearer

This change will generate code which uses a new HttpBearerAuth class, which will send a "Authorization: [scheme] [accessToken]" header.
This change is slightly larger and more impactful than simply using OAuth for bearerBearer, but it allows for scheme values other than bearer.

This fix was enabled by the recent commit of 80ca67cfda

This PR is an alternative to https://github.com/OpenAPITools/openapi-generator/pull/1972

* update petstore samples

* Update HttpBearerAuth mustache templates and samples

* correct the expected number of generated java client files

* update the retrofit2 HttpBearerAuth template and samples

* Add resttemplate-specific HttpBearerAuth mustache and samples

* add vertx-specific HttpBearerAuth template and samples

* add java webclient-specific HttpBearerAuth template and samples
2019-02-09 22:51:44 +08:00
William Cheng
348c22c883
Add "servers" support to operation, path in the JS client (#2060)
* add operation, path servers to js es6 client

* add servers support to operation, path in js es5

* fix null check
2019-02-09 22:25:01 +08:00
Gocha Ossinkine
8f5fa4df83 Add controller.service_arguments tag to controllers to make them public (#2059) 2019-02-09 22:19:42 +08:00
Matthieu Berthomé
cf6f10252d [Python] handle nullable parameters with None added to allowed_values (#2034)
* handle nullable parameters with None added to allowed_values

* update samples

* spec for testing enum with null/nullable
2019-02-09 22:08:47 +08:00