Commit Graph

7218 Commits

Author SHA1 Message Date
Shimin Guo
0cd5fb6dc2 [haskell-http-client] fix indentation in .cabal file (#2306) 2019-03-06 07:33:30 -06:00
Shimin Guo
0695cf99e6 [haskell-http-client] update katip version bound (#2305)
* haskell-http-client: update katip version bound

0.8.0.0 is needed due to the interface change in `mkHandleScribe`

* update petstore
2019-03-06 07:31:45 -06:00
Vincent Devos
4f37e81d55 Minor fix on pom (#2304) 2019-03-06 17:22:12 +08:00
Adrian Price
2985c0f0b8 JAX-RS/CXF 1158 Options to generate fully functional method bodies passing fully populated test data (#1879)
* add option to generate alias as model

* [JAXRS/CXF] Emit method bodies, test data (#1158)

New jaxrs-cxf-extended generator with options:
 - supportMultipleSpringServices Support generation of Spring services
   from multiple specifications
 - generateOperationBody (boolean) Enables generation of fully
   functional test/service method bodies that pass/return random
   but valid values & models.
 - loadTestDataFromFile (boolean) When true, generated method bodies
   load test data from a generated JSON file. When false, generated
   method bodies contain inline code to construct the test data.
 - testDataFile (string) The path of a JSON file to contain generated
   test data. The file is initially generated but editable; edits are
   preserved by subsequent generations.
 - testDataControlFile (string) The path of a JSON file to control test
   data generation - specifically, to control the number of items
   required in array properties, structured by API class
   / operation name / parameter name. The file is initially generated
   but editable; edits are preserved by subsequent generations.
 - tests for the jaxrs-cxf-extended generator, including the new options
Bug fixes:
 - fix bug (DefaultGenerator): handle absolute paths in supporting file
   spec
 - fix bug (DefaultCodegen): process enums in allVars
 - fix bug (AbstractJavaCodegen): support multiple inheritance via
   allOf (inheritance code deleted, as a subsequent pull broke it)
 - fix bug (JavaCXFServerCodegen): use operationId instead of nickname
(gets out of step with duplicate operationIds)
 - fix bug (JavaCXFServerCodegen): set appropriate default
consumes/produces for operations with body parameters or non-void
returns (CXF providers don't handle */*)
 - fix indentation (DefaultCodegen)
 - add support for a system property openapitools.implementation.version
to specify the package implementation version when running non-JAR'd
classes in an IDE (otherwise {{{generatorVersion}}} evaluates to
'unset'.

* reformat code

* make sh executable

* fix template folder

* fix template folder, update samples

* run test data manually to avoid ci failure
2019-03-06 08:58:11 +08:00
William Cheng
37c890f755
minor wording change (#2299) 2019-03-06 01:13:28 +08:00
Benjamin Gill
bcb4b03798 Refactor and use some Java 7 features (#2225)
* Fix typo in (unused) method name

* Tidy up Rust server generator

Remove some repetition and use some nifty new methods introduced in Java 8

* Start using Objects.hash and Objects.equals

* Convert more equals implementations over

To use Objects.equals

* Convert more hashCode implementations over

To use Objects.hash. Might have the pleasant side-effect of improving
performance a bit.
2019-03-06 01:12:52 +08:00
William Cheng
c57abbe5bd
js_flow_improve (#2298) 2019-03-05 19:09:40 +08:00
Michael van Niekerk
caf404d857 Typescript+Axios: Separate model and api classfiles and package (#2005)
* 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

* Codegen having the model and api extra flag

* Revert to 2.4 Typescript

* COLLECTION_FORMAT.{{collectionFormat}} everywhere for consistency

* Consistency on the CollectionFormats, comment on the vendor extension

* Throw exception if api and model packages are not given

* Templates splitting api and models

* Post process the operations in the the process

* Beginning to get the axios tests up

* Ensure-up-to-date doesnt include TS/Axios tests

* Docs update for Typescript/Axios

* Merge master

* Api tests re-run

* Add windows bat file
2019-03-05 16:44:33 +08:00
Ramzi Maalej
cc1fe6eebf fix resources management (#2229)
* fix resources management

* remove obselete if statement

* throw exception when body is null

* prevent potentional nullpointerexception

* use valueOf instead of constructor

* remove duplicated code

* avoid unclosed resources

* remove redundant key

* fix broken tests

* fix sonar issues

* fix tests

* add Veamly as a company using openAPI generator

* revert back if statement to explicitly express the intention behind it
2019-03-04 22:27:54 +08:00
kemokemo
0c54286909 Apply GIN_MODE=release for the Dockerfile of go-gin-server (#2283)
* chore: apply release mode for the Dockerfile

* docs: update by `./bin/go-gin-petstore-server.sh`

* docs: update by `./bin/openapi3/go-gin-petstore-server.sh`
2019-03-04 22:24:12 +08:00
Akira Tanimura
1d02f0374b [Ruby] Escape string interpolation notation of Ruby (#2261) (#2287)
* escape string interpolation notation of Ruby (#2261)

* update samples (#2261)
2019-03-04 22:22:45 +08:00
ota42y
88abea1755 update ZenTest (#2289)
* update ZenTest

ZenTest 4.11.1 requires rubygems 2.x.

But Ruby 2.6.0 include rubygems 3.x.
So we can't use ruby client in Ruby 2.6.0.
https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/

ZenTest 4.11.2 removed rubygems dependency so we should update.
1883b210aa

* update ruby client sample
2019-03-04 22:18:15 +08:00
William Cheng
8843df65a4
[aspnetcore] - make more configurable and generate abstract class library #2181 (#2282)
* Add ability control out put generation and support to generate a library

* Roll back pom version - it seems to break the CI/CD checks

* Roll back pom version - it seems to break the CI/CD checks

* Match with genrators - no changes from new code

* Fix inadvertent changes

* No idea why the names of params have changed pet to body for instance

* Match generated document

* Clarify logic as per PR review

* Remove the generatewwwroot option and use the buildtarget option

* Remove ar artifactVerson (not used), update docs and TODO notes

* Add ability control out put generation and support to generate a library

* Roll back pom version - it seems to break the CI/CD checks

* Roll back pom version - it seems to break the CI/CD checks

* Fix inadvertent changes

* Match generated document

* Add ability control out put generation and support to generate a library

* Roll back pom version - it seems to break the CI/CD checks

* Roll back pom version - it seems to break the CI/CD checks

* Fix inadvertent changes

* Match generated document

* Clarify logic as per PR review

* Remove the generatewwwroot option and use the buildtarget option

* Remove ar artifactVerson (not used), update docs and TODO notes
2019-03-03 23:23:17 +08:00
kemokemo
8c88f46fba Fix 2278: migrate the docker image for the aspnetcore generator (#2281)
* fix: migrate the docker image.

* doc: fix the inner port of the docker image

* docs: update samples by `./bin/aspnetcore-petstore-server.sh`
2019-03-02 19:04:03 -05:00
William Cheng
24f20941e5
fix npe when array item missing (#2247) 2019-03-02 21:48:00 +08:00
Bernd
052879d6cb [typescript-rxjs] fix enums (#2242)
* fix issue with duplicate enum exports

* regenerate typescript-rxjs samples
2019-03-01 19:09:06 +08:00
Jon Schoning
c30a21ac3c
[haskell-http-client] Allow logger selection via cabal flags. Emit Consumes */* for requestBody when not specified
[haskell-http-client] Allow logger selection via cabal flags. Emit Consumes */* for requestBody when not specified
2019-02-28 13:04:50 -06:00
William Cheng
54d9c19c77
Use https URL to download dependencies (#2248)
* fix groovy default value, use https to download dep

* update groovy build gradle file
2019-02-27 23:26:53 +08:00
William Cheng
92757581d6
better info message about using generateAliasAsModel (#2246) 2019-02-27 17:31:07 +08:00
Dec12 | Fujigon
5fe0c94135 [Java][JaxRs] bean validation annotation (e.g. NotNull) is applied to body param of api interface (#2239)
* fix template so that bean validation annotation (incl. NotNull) is applied to api interface.

* regenerate samples
2019-02-27 11:38:57 +08:00
William Cheng
b5ce0bddee
[JavaScript] Add petstore integration test to JS ES6 client (OAS3) (#2245)
* add test for js es6 oas3 client

* fix test with proper done

* add test, fix servers index check
2019-02-27 11:14:51 +08:00
Dec12 | Fujigon
aa339d6046 [core] add test cases for referenced enum case (#2237)
* add test case

* regenerate samples
2019-02-27 11:14:21 +08:00
William Cheng
9e2a9e1515
[Ruby] various improvements (#2226)
* add to_s in api error class

* rename variable to align with code sample

* fix initalize, better validation

* update petstore samples

* add code sample for model

* add auto-generated travis file

* improve error message

* add travis file

* uncomment to_s
2019-02-27 03:38:20 +08:00
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
Sven Panne
0b10092262 [python-flask] [python-aiohttp] [bug] Fixed handling of dotted module names (#2041)
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-09 02:51:36 +08:00
karismann
cd2ff0b041 [angular-typescript] Wrong Typescript Version for Angular 6 with Npm (#2097)
The Angular Compiler 6 requires TypeScript >=2.7.2 and <2.10.0
2019-02-09 02:44:48 +08:00
William Cheng
0a2fb8db8f
Remove localVarPrefix from Java client (#2045)
* remove localVarPrefix from java client

* rename local varaible

* update samples
2019-02-08 11:51:26 +08:00
William Cheng
36fa7102dd
[Python] Add "servers" support in path, operation (#2052)
* add servers to path, operation

* add path/operation server support to python client

* update python samples

* fix index

* fix python code style
2019-02-08 11:48:37 +08:00
William Cheng
7cee2b62e4
fix JS default ot ES6 (#2084) 2019-02-08 11:47:33 +08:00
Pablo Lázaro
aa24f07433 [TypescriptAngular] gets package npm version from API specification (#2019) 2019-02-07 15:53:01 +08:00
Sven Panne
dd3e6c6a3b Use actual value of generateSourceCodeOnly in python generator. (#2015) 2019-02-06 15:04:53 +08:00
autopp
28768244d6 [Ruby] Use double-quote string to enable string interpolation (#2067) (#2068) 2019-02-06 14:59:54 +08:00
William Cheng
0b66fa5c82
add servers to path, operation (#2048) 2019-02-05 17:07:52 +08:00
William Cheng
454adec32d
Fix isFreeFormObject check for allOf, oneOf, anyOf (#2044)
* fix free form object detection

* refator
2019-02-04 22:12:59 +08:00
William Cheng
931c03beca
add methods to name interface (#2046) 2019-02-04 17:34:55 +08:00
Matej Vehar
f4088f8ee8 Enable serialization of non-null negative values (array, false, etc) (#2032) 2019-02-04 15:25:16 +09:00
Benoît Courtine
888068d122 Rust reqwest improve (#1890)
* Resolves #525 for Rust client generator with reqwest library.

* Use Reqwest "query" method to generate query URL.

* urlencode URL string parameters.

* Generate rust-reqwest client, and verify it compiles and work as intended.

* Map file params (to "&std::path::Path") and support multipart operations (with file params) in Reqwest library.

* Cleanup: template compression to remove unecessary blank lines in generated code.
2019-02-01 15:02:16 +08:00
Jeremie Bresson
16f52cf2ad Set version to 4.0.0-SNAPSHOT
This reverts commit 6a414af13f.
2019-02-01 00:03:51 +01:00
Jérémie Bresson
6a414af13f
4.0.0-beta2 release (#2036) 2019-02-01 00:00:22 +01:00
William Cheng
453eeb9e40
Add Bearer authentication to PHP API client (#2013)
* add php bearer auth support

* add partial mustache

* add bearer format

* update php ze-ph samples
2019-01-31 17:54:10 +08:00
William Cheng
6801741592
Add Bearer authentication support to JS client (#2020)
* add bearer authentication support to js client

* add bearer format to js client

* fix test case

* update php ze-ph samples
2019-01-31 15:27:24 +08:00
Daniel Miller
cbda3fad98 [C++][Client][C++ Rest SDK] Fix path parameters with format (#1987)
* Create parameterToString for shared_ptr<T>

* Update cpp-restsdk sample petstore client
2019-01-31 10:47:00 +08:00
William Cheng
2eb99f602a
Add Bearer authentication support to Python client (#1999)
* add bearer auth support to python

* add bearer auth support to python

* update python oas2 petstore samples

* update samples

* add bearer format

* update php symfony samle
2019-01-30 22:16:53 +08:00
Arthur Mogliev
77d2de4e3d [PHP][php-ze-ph] Support for PHP 7.1+, Zend Expressive 3.2 and PathHander 0.4 (#1902)
* - support for PHP 7.1, Zend Expressive 3.2 and PathHander 0.4 for php-ze-ph generator

* - fixed mess with petstore samples (added new files, removed obsolete files)

* php-ze-ph:
- overwriting "*/*" media type for producers with "n/a" (PathHandler does not support that cause it makes no sense to return response with "Content-Type: */*")
- "array" return type declaration for handler methods with ambiguous "container" return type
- better way to generate attribute annotation stub for request body data with ambiguous "container" type
- fixed missing dependency in composer.json
- minor optimization for container.php
- samples for OAS3 petstore spec

* php-ze-ph:
- note about ext-yaml in stub README
- updated .gitignore

* php-ze-ph:
- logging '*/*' replacement as warning
2019-01-30 15:36:00 +08:00
Jérémie Bresson
c871e3bc81 [core] Handle referenced enum case correctly (#2001)
* [core] Handle referenced enum case correctly

* Update all samples

* Fix compile error after merge
2019-01-30 11:07:58 +08:00
Dennis Kieselhorst
bcfa86d401 update CXF and Jackson to latest version (#2017) 2019-01-29 20:43:41 +08:00
William Cheng
83d34bd8d7
Add multiple servers support to JS API client (#1974)
* add multiple servers support to JS ES6

* multiple server support in js es5

* using exports in es5

* fix index check

* add oas v3 js es6 client to travis
2019-01-29 11:19:21 +08:00
Jérémie Bresson
046db19a85 [core] cleanup: remove OpenAPI parameter from CodegenConfig methods (#1953)
* Add OpenAPI parameter to DefaultCodegen#toDefaultValue(..)

* Remove CodegenConfig#fromOperation()

* Remove allDefinitions parameter from fromModel(..)

* Remove definitions parameter from CodegenConfig#fromOperation(..)

* remove schemas parameter from DefaultCodegen#fromRequestBody(..)

* remove schemas parameter from DefaultCodegen#fromCallback(..)

* Remove openAPI parameter from CodegenConfig#fromModel(..)

* Remove openAPI parameter from CodegenConfig#fromOperation(..)

* Remove openAPI parameter from DefaultCodegen#fromProperty(..)

* Remove openAPI parameter from DefaultCodegen#fromParameter(..)

* Remove OpenAPI parameter from several methods

* Use ModelUtils.getReferencedParameter(..)

* Remove unused variable

* Remove openAPI parameter from DefaultCodegen#fromResponse(..)

* Remove openAPI parameter from DefaultCodegen#addHeaders(..)

* Remove from addConsumesInfo(..)/addProducesInfo(..)

* Improve test: add property to prevent Pet from being a free-form object

* remove globalSchemas Map<String, Schema>

* remove deprecated method: postProcessOperations()

* Remove 'Map<String, Schema> allSchemas' from addProperties(..)

* Remove 'Map<String, Schema> allDefinitions' from createDiscriminator(..)

* Remove 'Map<String, Schema> allSchemas' from unaliasPropertySchema(..)

* Rename globalOpenAPI to openAPI

* Update documentation

* Run “Optimize import” in IntelliJ IDEA
2019-01-28 16:19:36 +08:00
MBcom
6f16b45976 added bearer authentication to typescript-angular package (#1986)
* added bearer authentication to typescript-angular package

* updated samples
2019-01-28 16:16:32 +08:00
William Cheng
7811390b7b
Add multiple servers support to Python client (#1969)
* add multiple server support to python client

* various fixes

* minor fixes, add tests

* test oas2 python first

* fix tests

* fix issues reported by flake8

* update code format

* add python petstore to ensure up-to-date

* rearrange test

* fix E501

* fix tests

* add new files

* fix script permission

* fix index check

* update samples
2019-01-28 11:24:48 +08:00
William Cheng
887b688014
[Java] Generate OAuth related files only if OAuth security schema is used (#1907)
* optionally include oauth files in java client

* fix java templates

* fix tests

* fix CI issues
2019-01-28 11:05:37 +08:00
William Cheng
9029103c94
fix index check, add test cases (#1993) 2019-01-27 21:18:20 +08:00
William Cheng
c438f67b66 fix index, add test case in php client (#1994) 2019-01-27 20:29:59 +09:00
Yuriy Belenko
4f8164e713 [Slim] Update Readme (#1995)
* Add OpenAPI Generator link to readme

* Update Readme example to match config
2019-01-27 18:05:42 +08:00
gfeun
860b91e45e [lua] Allow connection on port != 80 or 443 (#1712)
* Allow connection on port != 80 or 443

In the current implementation a client can't connect on another port than 80 or 443
This commit allows to specify a host like "localhost:8080" when creating the client
The port is then used when initiating http requests

* Update Petstore Sample for CI

* Fix unused return value

* Update petstore sample

* Rename host parameter into authority
2019-01-26 21:05:22 +08:00
Joke Durnez
1a07bd6573 Bugfix/rheaders (#1965)
* debug headers in R client

* fixes to R client

* petstore samples

* missing space

* other space :)
2019-01-26 17:27:24 +08:00
Justin Black
9ec594eec5 [Spec] adds XmlItem model and route for xml testing (#1883)
* Adds xmlitem model and route, rest-assured Api suffix fix, updates pytest and pytest-cov versions

* Adds python client sample files

* Adds samples update

* Adds rest-assured sample client update

* Adds sample updates in ensure-up-to-date

* Changes rest-assured files back to master version, removes fix for issue #13

* Updates samples
2019-01-26 17:26:38 +08:00
William Cheng
65d9e859be
Fix customized source folder in Java client (#1978)
* fix customized source folder in java client

* update samples
2019-01-25 21:05:13 +08:00
d3v-cl
bc6997f0e5 [DART2]: fix Map<String, nativeType> fromJson (#1936) 2019-01-25 10:54:46 +08:00
William Cheng
33b7547da3
Add multiple servers support to PHP client (#1964)
* add multiple server support

* update php samples

* update wording

* make variables optional
2019-01-24 11:32:03 +08:00
William Cheng
3ea6cf356f
Fix C# discriminator's mapping name (#1942)
* fix C# mapping name

* add back jsonsubtypes

* add new files
2019-01-23 15:54:24 +08:00
Uku Loskit
ab840ff000 In case of a Integer Enum, add N-prefix, because Ruby does not allow identifiers that start with numbers (#1945)
In case of a Integer Enum, add N-prefix, because Ruby does not allow identifiers that start with numbers
2019-01-22 16:16:52 +08:00
Bernd
d33c4bb4a3 add new generator: typescript-rxjs (#1884)
* Merged in feature/rxjs (pull request #2)

Feature/rxjs

* feat: duplicate typescript-fetch, add docs

* duplicate fetch codegen to use for rxjs

* remove mapping helpers from modesl

* introduce rxjs, adjust apis

* make middlewares work

* fix namespace issue with babel

* fix enum generation

* fix formatting of enum

* remove other readme

* feat: duplicate typescript-fetch, add docs

* duplicate fetch codegen to use for rxjs

* remove mapping helpers from modesl

* introduce rxjs, adjust apis

* make middlewares work

* fix namespace issue with babel

* fix enum generation

* fix formatting of enum

* remove other readme

* add bash scripts to generate samples

* remove environment import

* add rxjs dependency to package.mustache

* add genereated samples

* add docs

* add windows scripts

* adjust license info

* update "ensure-up-to-date" by typescript-rxjs

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache

Co-Authored-By: denyo <hacker.bernd@gmail.com>

* fix missing return for Observable<void>

* use shorthand syntax

* improve linting

* improve linting

* revert previous changes

* Revert "Update modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache"

This reverts commit 26f65ca4ce29ab9ab4602e7cb0367895e93ddf4e.

* recreate typescript-rxjs samples
2019-01-21 23:26:18 +08:00
Jérémie Bresson
956512a9bf [java-jaxrs] Add Javadoc to enum (x-enum-descriptions) (#1951) 2019-01-21 23:24:56 +08:00
William Cheng
f415332406
update java default value (#1949) 2019-01-21 01:47:49 +08:00
Jérémie Bresson
06824622bf [html] Use ModelUtils to avoid NullPointerException (#1948) 2019-01-21 00:51:18 +08:00
eddy
c16354218a SCM and license parameters are now also for resteasy clients available. (#1934) 2019-01-20 23:01:48 +08:00
Jim Schubert
6fe9a52229 [feat][docs][website] Initial docusaurus based site (#1770)
* Iniital docusaurus based site

* Remove error about default local being used by String.format

* Change pinned users to represent global presence rather than alphabetical order pinning

* Include generator indexes in ensure-up-to-date (docusaurus site and /generators/README)

* Add Font Awesome attribution footer

* Remove feature callout until it is completed

* Include NPM try it out section

* Improve "Getting Started" type docs

* Include new custom template documentation

* Updating templating and customization docs

* Add vendor extension docs

* Cleanup templating page(s).

* Move users to yaml file for easy edit.

* travis configuration, and baseUrl mods to image URLs

* [docs] Migrate FAQ, release summary  from wiki

FAQ has been split into multiple smaller documents to better categorize
and allow users to find what they're looking for (in docs folder or in
new website).

Release summary information (versioning strategy and cadence) has been
migrated from the Wiki and clarified a bit.

Also adds copy button for all code snippets in website.

* Copy current contributing/code of conduct to website

* [docs] Creating a new generator
2019-01-18 17:39:33 +08:00
Jyhess
17218117b9 Fix missing __init__.py (#1933) 2019-01-18 12:41:43 +08:00
Geoff Brown
f4133e726d Fixing response headers so that the values are turned into a comma delimted string instead of "System.String[]" (#1935) 2019-01-17 22:26:25 -05:00
William Cheng
1676aefa8b
[Java] Update okhttp version to the latest (#1897)
* update okhttp to latest version

* update templates to use okhttp3

* update java samples

* fix tests

* update tests under CI/samples.ci

* add tests to java client

* fix bin script to restore test files

* fix debugging

* add more tests and minor fixes

* update samples
2019-01-16 20:30:52 +08:00
Daniel Schreiber
192e366bff fixing wrong model file suffix when identical with model suffix (#1876)
relates to #1467
2019-01-16 18:23:14 +08:00
na-o-ys
4117b2ebb1 [BUG][typescript-node] Generated package causes compilation errors (#1911)
* changed typescript-node build dir

* fixed missed json

* to pass integration test
2019-01-16 10:58:49 +08:00
William Cheng
e0137f670c
Update Maven plugin README with new options (#1917)
Update Maven plugin README with new options
2019-01-16 10:32:28 +08:00
Silas Boyd-Wickizer
f5d6aaebb2 [TypeScript-Node] support setting the content-type header per-call (#1868)
* [TypeScript-Node] support setting the content-type header per-call

This approach is inspired by the typescript-fetch implementation in
swagger-codegen.

Fixes https://github.com/OpenAPITools/openapi-generator/issues/1867

* Update modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache

Co-Authored-By: silasbw <silasbw@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache

Co-Authored-By: silasbw <silasbw@gmail.com>

* Update Petstore sample

* Fix types

* update "npm" petstore example

* Rename
2019-01-16 10:31:30 +08:00
Dec12 | Fujigon
df8137cf21 [JAVA][JAX-RS] don't forget to support @JsonValue for enum (#1833)
* don't forget to support JsonValue

* re-generate samples
2019-01-16 10:29:31 +08:00
Akihito Nakano
dec852ca9f Add primitive type support (#1835) 2019-01-16 10:12:49 +08:00
William Cheng
03711d572f
Rename graphql-server to graphql-nodejs-express-server (#1822)
* rename graphql server

* update windows batch file

* fix openpai3 shell script
2019-01-15 22:54:06 +08:00
sunn
963c002830 Update Readme for qt5 server (#1912) 2019-01-15 20:58:52 +08:00
Jim Schubert
db9102a440 Clean up file output handling (#1895)
* Clean up file output handling

This attempts to normalize all generators to use OS agnostic
File.separator.

It also cleans up some areas in code where we replace "." in full file
output path with File.separator. We should only be modifying directory
names we own, and should avoid modifying anything that can be provided
by a user.

It would probably be better to use Paths.get(…).toString() in all cases.

* Fix missed path separators in java codegen

* Adjust Java codegen path replacements

* Convert / in full path replacements, as / is forbidden in Windows, and noop elsewhere

* Use Paths.get where files are written, to better handle Windows path constraints
2019-01-14 22:49:39 +08:00
Akihito Nakano
b4fecd9f9e Remove unnecessary override (#1906) 2019-01-14 20:58:51 +08:00
Akihito Nakano
7674d11d75 Fix missing RequestBody.required of inline request body (#1847)
* Add test case that reproduce the issue #1782

* Fix missing RequestBody.required

* Update samples

./bin/utils/ensure-up-to-date

* Run ensure-up-to-date script

./bin/utils/ensure-up-to-date
2019-01-14 12:28:21 +08:00
William Cheng
470fc2065d
better NPE handling for undefined request body (#1896) 2019-01-13 12:25:35 +08:00
Jyhess
80ca67cfda Python AIOHTTP server generator (#1470)
* Astract factory for generators based on connexion

* Add aiohttp server generator

* Fix flask tests

* Normalize python-flask folder names
2019-01-11 23:35:21 +08:00
Akihito Nakano
4652023b7c Fix a problem that points to a folder that doesn't exist (#1863)
* Add test case that reproduce issues

* Fix a problem that points to a folder that doesn't exist

* Improves for windows

* Run ensure-up-to-date script

./bin/utils/ensure-up-to-date
2019-01-11 19:16:45 +08:00
Jacob Floyd
00a9cfdbc9 Python: Update api_doc_example for multiple auth (#1870)
APIs may more than one auth method (for example both an app key and basic auth).
This changes the example to only initialize the config option once instead of once per auth method.
2019-01-11 19:15:03 +08:00
Jim Schubert
4fa926604f [gradle] Add 4 boolean properties supported by codegenConfigurator (#1881)
* [gradle] Add 4 boolean properties supported by codegenConfigurator

* [gradle] Add Windows workaround for Android Studio

After release 3.0.0, a guava dependency was updated and this exposed an
issue in Windows where Guava's CharMatcher.ASCII is called to validate a
path. The version of Guava referenced by OpenAPI Generator causes a
'NoSuchField' error because the referenced dependency names this static
field CharMatcher.Ascii.

This error is not surfaced on macOS, and appears to be Windows-specific.

This adds a potential workaround to the Gradle plugin's readme.

See #1818 for more details.
2019-01-11 19:14:05 +08:00
Jérémie Bresson
8305df6b4a [java-client][okhttp-gson] no oauth2 usage when hasOAuthMethods is false (#1872)
* Fix Javadoc error

* [java-client][okhttp-gson] no oauth2 usage when hasOAuthMethods is false
2019-01-10 22:00:45 +08:00
Sebastian Rühl
faf1f5d81d [BUG-1848] Remove redundant right parenthesis (#1864) 2019-01-10 02:33:16 +08:00
Jérémie Bresson
d584833781 Support for "x-enum-descriptions" (#1752) 2019-01-10 00:47:55 +08:00
sunn
3b7f4c3879 Fix typo in template (#1859) 2019-01-09 16:13:10 +08:00
Hemant Zope
87d5484f2e add isModel to updatebooleanflagwithcodegenproperty (#1844) 2019-01-09 11:22:51 +08:00
Justin Black
539ec23298 [python-client] Add model default values (#1776)
* Adds two models to the v2.0 spec, uses examples as defaults in python client

* Adds array default and type_holder_default and type_holder_example tests

* Re-generated python security client with ./bin/security/python-petstore.sh

* Changes comment text, rebased master

* Updates client + server samples

* Adds missing samples updates

* Changes python client to look for true or false with booleans in toDefaultValue

* Changes boolean casting to use Boolean.valueOf

* Adds deserialization fix for python tests

* Changes Mock to namedtuple in python deserialization tests

* Actually remove unittest.mock
2019-01-09 11:18:35 +08:00
Daisuke Shimada
189849319c fix: force to decode as utf-8 when header contains application/json to avoid text garbling. (#1700)
* fix: force to decode as utf-8 when header contains application/json to avoid text garbling.

The original processing is using `response.body` to deserialize as json.
However, this is decoded by latin1 if the header contains only "application/json" instead of "application/json; charset=utf-8".

Because of this behavior, if the response body is encoded UTF-8 but the headers doesn't contain charset, the body will garbling.

cf: https://github.com/dart-lang/http/issues/175

Since playframework 2.6 returns "Content-Type: application/json" without "charset=utf-8", I changed this parsing algolithm.

* fix: force to decode as utf-8 when header contains application/json to avoid text garbling on error.
2019-01-09 11:08:35 +08:00
William Cheng
60dd3d51be
Better support for composed schema (allOf) (#1842)
* better support for composed schema

* remove commented code
2019-01-09 10:50:02 +08:00
Adrian Price
4c14c85542 Add additional properties to Java CodegenModel (#1854)
Fixes the first part of https://github.com/OpenAPITools/openapi-generator/pull/1729#issuecomment-451991109 (see https://github.com/OpenAPITools/openapi-generator/pull/1729#issuecomment-449937728). The second part was fixed by https://github.com/OpenAPITools/openapi-generator/pull/1845 (commit d65dd763d814fba356a61abeae6dd1dbc4193fd2).
2019-01-09 10:49:43 +08:00
FallenRiteMonk
9331df791f Minor Angular type improvements (#1843)
Update api.service.mustache

update samples
2019-01-09 00:30:37 +08:00
d3v-cl
9ccf872290 [DART] fix: set fields to null if json value is null. (#1798)
* fix: set fields to null if json value is null.

* rebuild dart2 petstore

* rebuild dart petstore

* rebuild petstore

* [DART]fix: set fields to null if json value is null.
2019-01-09 00:26:46 +08:00
William Cheng
293066bb0d
add options to maven plugin (#1845) 2019-01-08 21:32:51 +08:00
William Cheng
fbf570e7bd
fix unqiue name in handling forward slash (#1839) 2019-01-08 07:51:25 +08:00
William Cheng
ed5bd5ffb0
better handle of oauth (#1838) 2019-01-08 07:51:02 +08:00