Commit Graph

6997 Commits

Author SHA1 Message Date
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
Hemant Zope
233ce093e5 [C] Support for authentication methods (#1628)
* added auth support in apiClient

* added httperror response in detail

* added apikey to apiClient create

* remove unnecessary print statements

* remove freeing of apiclient object from apiclient_free function

* added auth params to apiClient_free function

* free only received data and apiClient object to be freed by user
2019-01-07 23:31:42 +08:00
William Cheng
b7971e2e3d better error message when parameter ref not defined (#1837) 2019-01-08 00:29:13 +09:00
Akihito Nakano
6e4556772c Delete langs command (#1836)
* Delete langs command

* Delete "langs" from docker entrypoint script

* langs -> list

* langs -> list
2019-01-07 08:57:05 -05:00
William Cheng
60776b8cb5
deprecated initialCaps (#1821) 2019-01-07 17:47:07 +08:00
sredbull
eff0c5e8d0 Added proper error response (#1814) 2019-01-07 12:19:50 +08:00
sredbull
1189362466 [JavaScript] Added plugins variable for the javascript/ES6 client (#1797)
* Added plugins variable for the javascript/ES6 client

* Ran the javascript and javascript-es6 shell script
2019-01-07 12:18:03 +08:00
William Cheng
f0f214743e
Use JS ES6 as the default (#1825)
* set JS ES6 as the default

* update doc
2019-01-07 11:43:11 +08:00
sunn
651395d426
Update base class due to failed compilation in case of plain object type with no properties or additionalProperties specified (#1826) 2019-01-06 18:20:23 +01:00
sunn
fda35ea263
Fix missing const keyword in array and maps (#1828) 2019-01-06 18:19:08 +01:00
sunn
c65ef987af
Emit worker also in response signal (#1829) 2019-01-06 18:18:20 +01:00
William Cheng
b015ac9307
use 4-space instead of tab in perl templates (#1830) 2019-01-07 00:22:24 +08:00
Akihito Nakano
bdf32775fb
Add test cases for ExampleGenerator (#1802)
* Add test case : generateFromResponseSchemaWithArrayOfModel

* Add test case : generateFromResponseSchemaWithArrayOfPrimitiveTypes

* Add test case : generateFromResponseSchemaWithModel

* Add test case : generateFromResponseSchemaWithNoExample

* Use String.format for windows

* Specify locale to prevent issues due to locale
2019-01-06 13:27:27 +09:00
William Cheng
1a2deb016b
Fix security issue with dependencies (#1820)
* fix security issue with dependency

* update samples

* update pom and sample
2019-01-05 23:30:59 +08:00
William Cheng
8f561f1ef3
[C#][Refactor] Fix nullable required property in the constructor (#1819)
* add serialization test, fix nulllable reuqired

* remove vs folder
2019-01-05 18:54:29 +08:00
Marco
b931da2909 [java][webclient] Register Jackson modules on ObjectMapper (#911)
* [java][webclient] register jackson modules on object mapper

* Regenerate client

* Removed findAndRegisterModules() call

* ObjectMapper is initialized only if NOT provided by client

* Remove (now) useless DateFormat inside buildWebClient signature and regenerate client
2019-01-05 18:29:49 +08:00
Yuriy Belenko
fa9bd1f567 [Slim] Add ApiKey and OAuth authentication middleware (#1207)
* [Slim] Add fork of token middleware

This commit will be dropped, when official repo approves submitted PRs.
Right now it's for test purposes only.

* [Slim] Adds token middleware to template

* [Slim] Move auth implementation to external classes

* [Slim] Update readme

* [Slim] Add config example

* [Slim] Remove deprecated package

Considered to use dyorg/slim-token-authentication for all authentication
schemes. User needs to decode and parse Basic token himself, but it's
pretty simple task and there are many code examples in
the web. Most of time solution is two lines of code.

* [Slim] Format phpdoc comments

I've changed PHP version to 7 and updated comments to follow  main
recommendations. Used PHPCodesniffer rules are Generic.Commenting,
Squiz.Commenting, PEAR.Commenting. Of course I applied only reasonable
sniffs from this standards.

@category tag has been deleted as deprecated accordingly to
phpDocumentor offical docs.

Ref: http://docs.phpdoc.org/references/phpdoc/tags/category.html

* [Slim] Refresh samples
2019-01-05 11:32:23 +09:00
William Cheng
d35f4b08d9
Fix various typos in the templates (Ruby, C#) (#1803)
* Fix typos

* update petstore samples
2019-01-05 09:39:10 +08:00
William Cheng
ad5184efc1
Add process utils class to add index to properties (#1796)
* add process utils to add index to properties

* fix javadoc warning
2019-01-03 16:06:22 +08:00
Jim Schubert
8fd474d4a7 [gradle-plugin] Fix test, ensure tests run in CI (#1789)
* Update GenerateTaskDslTest to remove "Pets" array model which is no longer generated
* Ensure check on uploadArchives task
2019-01-02 17:15:01 +08:00
Akihito Nakano
af6757ccde Refactor InlineModelResolver (#1788)
* Extract a method "flattenPaths" to reduce the scope of method

* Tweak

* Rename parameter name

* Extract a method "flattenModels" to reduce the scope of method

* Rename parameter name

* Rename: models -> components

* Delete comment

* Extract a method "flattenRequestBody" to reduce the scope of method

* Extract a method "flattenParameters" to reduce the scope of method

* Extract a method "flattenResponses" to reduce the scope of method

* Tweak types

* Reduce indentation
2019-01-02 17:14:34 +08:00
Akihito Nakano
9334dd391a
Improve test codes of InlineModelResolver (#1787)
* Delete unnecessary "throws"

* Delete unnecessary cast expressions

* Tweak redundant assertions

* Delete unnecessary comment
2019-01-01 13:14:23 +09:00