Commit Graph

647 Commits

Author SHA1 Message Date
Kenny Jones
63fce58931 [Java][Spring] Resolve serialization warning from RFC3339DateFormat (#6960)
Adds `serialVersionUID` to RFC3339DateFormat.java to avoid Java warning.
2017-11-21 12:14:02 +08:00
William Cheng
15bbb52b22
check for dot in path and throw exception if found (#6986) 2017-11-17 20:18:06 +08:00
Gustavo Paz
b404dafa02 Issue 6694 2.3.0 (#6845)
* The get method template is modified to return the value of the enum instead of the enum itself.

* Update of the Petstore CXF server sample

* Update of the Petstore CXF client sample

* Update of the Petstore CXF server annotated base path sample

* Update of the Petstore CXF server non spring application sample
2017-11-10 15:32:05 +08:00
afrolovsky
9a44512d03 @JsonProperty annotation for jaxrs-spec server model classes (#6911) (#6916) 2017-11-09 21:46:26 +08:00
wing328
8b251555ac update php symfony petstore, remove spaces in empty line 2017-11-09 16:36:25 +08:00
Kenny Jones
b6699f6068 [python] Convert unicode to six.u (#6881)
`unicode` does not exist in py3, therefore since six is already imported
switch to using `six.u` so that `unicode` is used on py2 and `str` is used
on py3.
2017-11-04 23:24:51 +08:00
stkrwork
659e64206a - Updated cpp generators to name boolean getter functions with an is at the beginning (ex. isActive) (#6880) 2017-11-04 22:04:38 +08:00
Jean-François Côté
16373b9f70 Fix the fake endpoint example. Now all cases are handled by the java play framework! (#6850) 2017-11-02 17:54:34 +08:00
Kenny Jones
74f70a1924 [python-client] Modify python templates to resolve linting errors (#6839)
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.

pyclient            7714 vs. 120
pyclient3           7717 vs. 120
pyclient3-asyncio   7584 vs. 120
pyclient-tornado    7633 vs. 120
pyclient3-tornado   7633 vs. 120

For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/2eb69a7e8db75e9fd53789f01570d9f2

Enforces linting for python clients by running flake8 for the generated
python client.
2017-11-02 00:47:14 +08:00
craffael
8fec429158 [NancyFx] Support Async (#6755)
* add support for async routes/endpoints

you can now set --optional-properties async=true to generate
a nancyfx server stub that uses asynchronous programming.

(cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4)

* add nancyfx-petstore-server-async.sh to generate sample of async nancyfx.

* Rename async => asyncServer

* update bin/nancyfx-petstore-server-async.sh

* rename async => asyncServer in api.mustache + small bugfix

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh

* remove additional new line in api.mustache + add space after if

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh
2017-11-01 22:50:49 +08:00
Euan Kemp
c97b63d2bb [Rust] Implement 'object' type conversion (#6846)
* [Rust] Use serde Value for objects

This hopefully fixes the previous TODO; it at least fixes compilation
errors for the specific swagger model I'm working with.

* [Rust] Update Cargo.toml to specify versions

Letting the version float freely is scary, to say the least.

This gives it a better chance at being future-proof.

When the crate author had a recommended selector I picked that,
otherwise I went semver compatible.

* [Rust] Regenerate the example
2017-11-01 22:00:56 +08:00
Jean-François Côté
18ba90f5ac [JavaPlayFramework] Add parameters for beanValidation in the application.conf + fix bugs (#6794)
* Add configuration to split input and output bean validations. When useBeanValidation is used, the variable are created in the application.conf file and can be tweaked by environment. For example, dev and stage can have true to both but only have input in prod.

* Refactor of mustache tags for more clarity

* sample generation with refactor

* Fix a couple of bugs with the fake-endpoint yaml but there is still 2 cases where it doesn't work.
2017-10-27 22:48:27 +08:00
Christophe Bornet
fe2ed67f20 Remove Accept request header from api signature (#6704)
* Remove Accept request header from api signature

* Inject HttpServletRequest to get request header and clean templates

* Use constructor injection for HttpServletRequest

* Implement example in default controller responses
2017-10-27 22:45:30 +08:00
Kenny Jones
28d14e34c4 [python-flask] Apply template tweaks to improve lint results (#6826)
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.

flaskConnexion          1843 vs. 20
flaskConnexion-python2  1841 vs. 19

For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/edc9d71ef7fd2bf23714ecbb693d52b3
2017-10-27 22:18:14 +08:00
Kenny Jones
54b670b7e0 [python-flask] Create main function and entrypoint (#6814)
Enable the creation of the entrypoint so that the server can be started
using a named command instead of needing to always use `python -m` to
run the server.
2017-10-26 20:38:30 +08:00
Jérémie Fraudeau
681b1c20ea [Scala][Finch] Fix interpretation of queryParams and headers (#6809)
* [Scala][Finch] Fix interpretation of queryParams and headers

* [Scala][Finch] Updates the sample for Finch generated server
2017-10-26 16:44:06 +08:00
wing328
6814530d69 fix enum in path parameter (spring) (#6810) 2017-10-25 22:30:36 +08:00
Dimitar Ivanov
ab338f8cb9 Erlang-server: fix dialyzer; fix min and max checks (#6752) 2017-10-25 10:57:53 +08:00
naelrashdeen
b034e4446a [PHP][Symfony] Enhancements (#6615)
* Removed commented code

* Input validation is now supported as strict JSON validation

* [PHP][Symfony] Improve the implementation
Closes #6614

* Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer

* Updated shell script because shippable tests were failing
2017-10-23 22:50:56 +08:00
Gustavo Paz
7cbd36e75b [Java][JAXRS-CXF] Improve API documentation in the CXF Server stub and Client generation (#6708)
* Inclusion of API documentation in CXF Server stub generation

* Inclusion of API documentation in CXF client generation

* Update of the Petstore CXF server sample

* Update of the Petstore CXF client sample

* Update of the Petstore CXF server annotated base path sample

* Update of the Petstore CXF server non spring application sample

* Changed {{{appDescription}}} to {{appDescription}} to use the HTML-escaped value in handling special characters like <, > in the description following the correction made by @wing328

* Update of the Petstore CXF samples
2017-10-22 23:00:48 +08:00
wing328
f0b7daeec6 [Rust] rename rust2 to rust-server (#6747)
* rename rust2 to rust-server

* update rust-server batch file to use petstore test spec
2017-10-19 20:17:08 +08:00
Gustavo Paz
d37894199b [Java][JAX-RS-CXF] Add JsonProperty to POJO (#6710)
* Included Open Systems International in the list of companies using Swagger Codegen

* Force Jackson to use the real names of the properties of the Data type defined in the YAML

* Update of the Petstore CXF server sample

* Update of the Petstore CXF client sample

* Update of the Petstore CXF server annotated base path sample

* Update of the Petstore CXF server non spring application sample

* Changed {{name}} for {{baseName}} following the correction posted by @wing328

* Update of the Petstore CXF server sample
2017-10-19 16:58:16 +08:00
Will Neild
e4abddf253 Fix spring api operation annotation (#6700)
* * Fix apioperation annotation using generics in class reference for spring server generation

* * Regenerate classes for new spring template
2017-10-18 16:38:12 +08:00
wing328
1ac04ae13a new files genreated by security shell scripts 2017-10-18 10:46:01 +08:00
wing328
c783ec1d41 update all petstore security samples 2017-10-18 10:10:44 +08:00
Giacomo
abe1be1a14 JAXRS-SPEC: fix container return type (#6659)
* JAXRS-SPEC: fix container return type

* Run
./bin/jaxrs-spec-petstore-server.sh
./bin/jaxrs-spec-petstore-server-interface.sh
2017-10-17 22:51:37 +08:00
Jean-François Côté
8b70f24371 There was no validation when a required field was null, creating crash and null pointer exception further down the line in the business code. Now, it throws a InvalidArgumentException. (#6673) 2017-10-16 21:23:05 +08:00
wing328
619c391be9 update python flask petstore samples 2017-10-16 11:48:13 +08:00
Elias Ovchynnikov
3f7f6b8599 Add operationId as nickname to @ApiOperation (#6688)
* Add operationId as nickname to @ApiOperation

* Refresh samples after adding nicknames to @ApiOperation
2017-10-16 10:18:32 +08:00
stkrwork
027fb2fe47 - Removed unnecessary line in in Restbed Codegen Constructor (#6675)
- Updated samples
2017-10-15 23:38:46 +08:00
Graham Johnson
1bdb104738 Add Serializable import to JaxRS-spec models if serializableModel is set (#6651) 2017-10-10 22:45:47 +08:00
wing328
d054a43b65 update java server samples 2017-10-09 23:00:44 +08:00
wing328
3b134319fa add java version to pom in resteasy eap java8 2017-10-09 22:51:58 +08:00
Jean-François Côté
e6d4362012 Fix for regression in issue: https://github.com/swagger-api/swagger-codegen/issues/6472 (#6480) 2017-10-09 22:51:32 +08:00
jarlesat
8a7940f199 Issue 5431 Support jaxrs client api interfaces (#6412)
* Adds the ability to create code for an interface-based jaxrs client.

* Adds shell script and sample files for jaxrs-spec-interface

* rebase into adds shell

* Fixes bug in creation of Produces/Consumes in method annotation. Allows for instance "application/json; charset=utf-8"

* Fixes generated pom.xml

* Generate pom.xml by default

* Prettier output from api.mustache

* Fixes bug in mediatype, allowing charset-specification in swagger.yaml.

* Merges generation of interface-based jaxrs client/api into jaxrs-spec.

* Moves jaxrs-spec server interface to match location of jaxrs-spec server

* Makes Generated-annotation in genereated classes slightly prettier.
2017-10-08 15:28:12 +08:00
wing328
5175281f32 rename silex-PHP to php-silex (#6612) 2017-10-03 23:46:56 +08:00
craffael
1896e96648 [nancyfx] fix interface prefix (#6595)
* Retrofit2: Return ResponseBody if response if file.

Until now
--------------------
If a swagger endpoint returned a file (e.g. an image), then the Retrofit2
template has choosen the return type java.io.File. However, retrofit cannot
deal with this and throws a com.google.gson.stream.MalformedJsonException.

New:
-------------------
If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint
will return a okhttp3.ResponseBody which can be used to retrieve the file.

* fix Interface Prefix
2017-10-03 15:14:28 +08:00
craffael
1f4013e7f1 [NancyFx] provide option to override package context (#6593)
* Retrofit2: Return ResponseBody if response if file.

Until now
--------------------
If a swagger endpoint returned a file (e.g. an image), then the Retrofit2
template has choosen the return type java.io.File. However, retrofit cannot
deal with this and throws a com.google.gson.stream.MalformedJsonException.

New:
-------------------
If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint
will return a okhttp3.ResponseBody which can be used to retrieve the file.

* Add the option packageContext for nancyFx which allows a better adjustment of the namespace.

* run nancyfx-petstore-server.bat
2017-10-02 11:10:09 +08:00
Brad Crumb
c5c639b62b Zend Expressive fix and upgrade to version 2 (#6461)
* upgraded zend-expressive from version 1 to 2

* Changed error handler for compatibility with Zend Expressive 2

* generated newest sample files for Petstore ze-ph

* removed ErrorMiddleware because it is never been used anymore. Regenerated samples

* removed ErrorMiddleware Template from Codegen

* remove ErrorMiddleware from petstore sample

* Fixed some code styles

* regenerated ze-ph samples with corrected code styles

* added new line at the end of the file
2017-09-23 15:31:20 +08:00
Lance Hannestad
a6d6432e6d [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays) (#6463)
* [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays)

* Was modified by ./bin/python-petstore.sh
2017-09-11 10:23:38 +08:00
Daniel Ochoa Rodríguez
cfa2074802 Fix Uuid parse (#6382)
* Fix Uuid parse

* Add isString = true when property is Uuid

This will not break previous code

* Update conversionBegin.mustache

* Update conversionEnd.mustache
2017-09-03 23:10:25 +08:00
Giacomo
a1c1a82725 - Added javax.validation.Valid annotation to modules/swagger-codegen/… (#6398)
* - Added javax.validation.Valid annotation to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/bodyParams.mustache
- Added bean validation and api description to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/headerParams.mustache
- Added api description to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/queryParams.mustache
- Added interfaceOnly parameter management to modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java to generate only interfaces and models.
- Added interfaceOnly parameter management to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache
- Added throws java.lang.Exception to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache

* Run ./bin/jaxrs-spec-petstore-server.sh

* jaxrs-spec: javax.validation.Valid model attributes for array items

* Run ./bin/jaxrs-spec-petstore-server.sh
2017-09-03 22:45:35 +08:00
Shimin Guo
37f48239b0 Map ByteArray to Text for haskell codegen (#6402)
* Support ByteArray in haskell codegen

* update petstore example
2017-08-31 10:19:42 +08:00
Jean-François Côté
d80c0f5546 [Java Play Framework] Fix a small error of using paramName instead of baseName (#6395)
* Fix a small error of using paramName instead of baseName

* Add sample generation
2017-08-30 17:58:24 +08:00
David Fischer
506c58ec74 [JaxRS] Fix response annotation generation (fixes #2588) (#6373)
* [JaxRS] Fix response annotation generation (fixes #2588)

* [JaxRS] Fix jaxrs jersey1 usetags sample provider

* Revert "[JaxRS] Fix jaxrs jersey1 usetags sample provider"

This reverts commit 73fef2e451e376b23f6c1d43d8781f0b4a0bd1f5.

* [JaxRS] Fix jaxrs jersey1 sample generator

* [JaxRS] Fix samples for jersey1 and jersey2

* [Server: Java] Fix diamond operator defaultValue for Java < 1.7
2017-08-30 00:31:56 +08:00
Jean-François Côté
006b97525f Update the Java Play Framework generator to version 2.6.3 (#6356) 2017-08-24 10:23:10 +08:00
wing328
6ff612ffcb fix pom in jaxrs-cxf-cdi (#6343) 2017-08-21 15:51:30 +08:00
wing328
da4deda278 update jaxrs-cxf petstore samples 2017-08-20 23:46:08 +08:00
wing328
71123e157e [Java][JAX-RS] Add Petstore samples with "useTags" option (#6300)
* add samples for jaxrs (jersey1,2) usetags

* fix duplicated id
2017-08-12 22:05:25 +08:00
Jean-François Côté
ab28c7c825 [Java Play Framework] Remove most warnings + bug fixes (#6275)
* Removals of most of the warnings found by lint

* Removals of most of the warnings found by lint (PART 2)

* Removals of most of the warnings found by lint (PART 3)

* Removals of most of the warnings found by lint (PART 4)

* Removals of most of the warnings found by lint (PART 5)

* Fix conversion error

* Removal of unnecessary import. Other will need more complex login in the generator itself (not in the mustache files)

* Add missing imports + fix to the regex. Generation of the samples
2017-08-11 15:38:18 +08:00