Commit Graph

850 Commits

Author SHA1 Message Date
William Cheng
803f337d24
[Scala][Lagom] rename generator from scala-lagom to scala-lagom-server (#7014)
* rename scala-lagom to scala-lagom-server

* add back pom.xml and shell script

* update scala-lagom-server path in circleci pom.xml

* make shell script executable

* rename batch file
2017-11-21 23:24:02 +08:00
William Cheng
573b5518be
[Scala][Lagom] minor enhancements (#7011)
* rename lagom scala, minor enhancements

* add scala lagom to circle ci

* test sala lagom with jdk8 only
2017-11-21 17:34:09 +08:00
gmkumar2005
32abb72769 [LagomScala] Add Scala API generator for lagomframework #6900 (#6901)
* Initial Commit

* Removed unneeded class, Updated names as per naming conventions, Removed licensing info from  generated code

* Moved samples from client folder to server

* Fixed naming issue with scripts in the bin

* improved code format for api

* fixed compile issue and improved formatting

* fixed compile issue and improved formatting
2017-11-21 15:40:04 +08:00
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
stevecookform3
adfe4b6e6c add @Valid/@Validated annotations to controller methods/nested models (#6254)
* add @Valid/@Validated annotations to controller methods and nested models

* update spring samples
2017-08-11 08:44:51 +08:00
wing328
974a2abdd5 make shell script executable 2017-08-09 22:39:51 +08:00
wing328
ce0dc64dd5 add back pom and shell script for java play petstore 2017-08-09 22:03:20 +08:00
Jean-François Côté
1e991be5f3 [JavaPlayFramework] Fix for issue #6100 (#6128)
* Fix issue #6100. Tested with all the samples.

* Fix multiple issue with the examples. Removing all of this.
Adding fake endpoint .sh but it is not compiling right now.
2017-08-09 22:00:46 +08:00
wing328
c05db535e1 Merge branch 'issue-3371' of https://github.com/gcernier-amadeus/swagger-codegen into gcernier-amadeus-issue-3371b 2017-08-08 15:31:52 +08:00
mobreza
b433afebdd withXml replaces useJaxbAnnotations (#6152)
* Regenerated bin/jaxrs-*

* Replace `useJaxbAnnotations` with `withXml`
2017-08-03 15:35:33 +08:00
Chandan Singh
1c4e77585f Issue 6172 (#6173)
* Changes to allow field names as examples for string properties and multiple items in array during example generation

* Reverting the version to 2.3.0-SNAPSHOT and autogenerated petstore files
2017-08-02 17:59:54 +08:00
wing328
92b129708d update spring samples 2017-08-02 16:43:54 +08:00
wing328
443b0f142b remove ref to SO (#6209) 2017-07-29 18:53:08 +08:00
Ximo Guanter
e4e9a985e3 [Java Play-Framework] Remove unneeded deps (#6097)
* Remove unneeded deps in Java Play Framework codegen

* rebuild petstore project with latest java-play-framework changes

* fix: pr feedback
2017-07-27 23:47:04 +08:00
Sebastiano Miano
1eadb4201b Pistache server (#6189)
* Added C++ generator for Pistache

* Revert of CodegenOperation

* Updated template

* Removed isRestful from method declaration

* Updated httpMethod variable

* Changed isRestfulCreate

* Updated pistache library name

* Update pistache petstore sample with the new library name
2017-07-27 14:56:56 +08:00
wing328
bc68e9706e update java play petstore sample 2017-07-25 17:48:13 +08:00
Jean-François Côté
79e10c427a Fix for issue #5460 (#5778)
* Fix issue 5460

* Handling only first and last double quote to support example with double quote in the middle

* Fix proposed by @ePaul

* Add comments to explain de fixStringModel function. Add an enum model called PetStatus that test this scenario. Update sample only for JavaPlayFramework generator
2017-07-25 01:20:36 +08:00
wing328
5cbce712fd update spring petstore samples 2017-07-23 23:07:03 +08:00
Jean-François Côté
bf327519b8 Add support for endpoint examples. Right now it doesn't work because {{{example}}} is always empty (#5775) 2017-07-23 22:45:30 +08:00
Jean-François Côté
8597b3f843 [JavaPlayFramework] Add automatic bean validation method when activated (#6125)
* Add automatic validation of return type when beanValidation is activated

* Small fixes for the automatic validation

* Add validation of entering body object + fix problem when receiving list + do not validate when the return value is a file
2017-07-23 21:49:55 +08:00
Jean-François Côté
bca35f6645 Fix for issue #6094 (#6121) 2017-07-20 15:42:56 +08:00
Jean-François Côté
dad3e6018a [Java Play Framework] Fix collection utils (#6025)
* Major fix to the collection handling in Play Framework Generator

* Major fix to the collection handling in Play Framework Generator (small details missing from previous commit)

* Add the fix to header and form parameters too
2017-07-18 19:36:43 +08:00
wing328
f999936c1d [JAX-RS][RESTEasy] Add Petstore integration tests for RESTEasy EAP (java8) (#6091)
* add petstore integration tests for resteasy eap java8

* update circle pom.xml
2017-07-17 23:25:38 +08:00
Ian O'Neill
dc800c79cc [JaxrsResteasy] Fix EAP dependencies for Java 8 (#6058)
* Depend on Joda by default, like the default JAX-RS server
* If Java 8 is specified add Jackson JSR-310 dependency and import
  in the JacksonConfig.
2017-07-17 21:44:51 +08:00
Jean-François Côté
bf74de3a5a [Java Play Framework] Fix to the default values (#5879)
* Fix to the default values. It did not take care of the "default" and also was setting to a bad default when not set.

* Just make a difference between string and non string instead of placing all types in the mustache file
2017-07-17 16:51:02 +08:00
wing328
094dbd00ed Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-13 23:35:22 +08:00
stkrwork
9d4ebf6998 Swagger version info (#6038) 2017-07-13 17:31:23 +08:00
wing328
e964702550 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-12 21:54:23 +08:00
mobreza
5d32edd964 Java support for application/xml (#5962)
* WIP: CodegenProperty with XML

* WIP: CodegenModel XML bits

* WIP: Jackson XML

* WIP: Java templating

* WIP: Java client withXml flag

* WIP: resttemplate work

* WIP: withXml only when Jackson is used

* WIP: Tabs to spaces

* WIP: java-petstore-resttemplate-withxml sample

* WIP: language: spring

* WIP: language "spring" using library "spring-boot" should include apiPackage in @ComponentScan to detect the API

* WIP: javax.xml for non-Jackson Java and enabled payload logging for jersey2

* WIP: updated java petstore samples

* WIP: JavaSpring with non-jackson XML

* WIP: bin/spring-all-pestore.sh
2017-07-11 17:01:51 +08:00
stkrwork
f2f303b2e8 [C++] [Restbed] Reworked Resource class names (#6017)
* - Added Restbed Generator

* - Added Json processing functions to model
- Removed unnused code from restbed codegen class
- Added response header processing to api template

* Changed it to respect alphabetical order

* Made the string joining java 7 compatible

* Added samples

* Started work on restbed improvment

* - Updated samples
- Reworked Resource class names
- Added vendor extension for new formatted resource class names

* fix indention
2017-07-11 00:37:08 +08:00
wing328
d56b7ae037 Merge branch 'feature/java-vert.x' of https://github.com/phiz71/swagger-codegen into phiz71-feature/java-vert.x 2017-07-10 23:41:47 +08:00
wing328
b852e61ee9 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-09 00:59:41 +08:00
Frank Fleige
0274ba79ad #6012 - fixed mustache template for lumen server (#6013) 2017-07-09 00:51:47 +08:00
Florent Chamfroy
d044498de4 adding Vert.X Codegen
Adding the possibility to generate java Vert.X servers.
It uses Vertx-Swagger-Router project.
It can generate an Async callback version or a Rx version.
2017-07-08 16:10:07 +02:00
Joel Reymont
4b9d0e6a10 Fix Erlang auth method code generation (#5994)
Broken code is generated when no authentication methods are supplied
in the API schema. Fix this by providing code to fall back to.
2017-07-07 15:14:06 +08:00
wing328
9a56d4560a Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-03 18:47:10 +08:00
wing328
25a46374c5 Updated Spring, Boot, Fox and Cloud dependencies (#5969)
* updated Spring, Boot, Fox and Cloud dependencies

* run scripts for java, jaxrs-cxf and spring samples (although changes are not related to my changes)

* update jersey java8 petstore samples

* update java feign samples

* update java petstore samples

* add new files for java petstore clients

* roll back spring cloud dep version

* fix jaxrs-cxf error
2017-07-03 18:44:22 +08:00
wing328
ecf924e78f [Spring] Adds feature useOptional (#5968)
* Adds Valid annotation for request body (#4847)

If useBeanValidation is active, this change will add Valid annotation to ReqeustBody

* Adds generated samples for bean vaildation in spring boot (#4847)

* Adds feature option (#3819)

When you enable the feature useOptional the JavaSpring generator will use type Optional for non required parameters.

* Adds generated sample for #3819

* Adds generated sample for #3819

* Reverts commit for bean validation

* Adds generated sample for #3819

* Reverts commit for bean validation

* Fix alignment

* update spring samples

* update pom.xml to include spring use optional samples

* update artifactId to "spring-boot-beanvalidation"

* rpelace tab with 4-space

* check mvn task result
2017-07-03 17:40:00 +08:00
wing328
76481d1d80 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-02 22:43:08 +08:00
mmosemmle
94814176b7 [CPP] Fixing some more ordering of checks (#5951)
* Fix more ordering of checks.

* Update cpp petstores.
2017-07-02 22:30:42 +08:00
wing328
afd535f415 rollback to 2.6.4 for jackson threetenbp in springmvc 2017-07-01 23:46:31 +08:00
wing328
8d31e57e2a fix spring dep version 2017-07-01 22:22:02 +08:00
wing328
9269dac6cf Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-01 15:47:27 +08:00
rubms
6fa4853fe7 [NancyFx] Fixed bug in the generation of enum models that were generated with compilation errors (#5910) (#5913)
* NancyFx - Fixed bug in the generation of enum types in the NancyFx server, which cause enums to be generated as general classes, without the enum values and with compilation errors (#5910)

* NancyFx - Changes in the nancyfx sample after the updates in the nancyfx model.mustache template. (#5910)
2017-06-29 22:35:41 +08:00
Dennis Kieselhorst
407d728908 updated Spring and Spring Boot dependencies (#5948) 2017-06-29 22:28:08 +08:00
Jordan Zimmerman
b2efb70410 Support a true "java8" option (#5864)
* Closes #5863

The "dateLibrary" option for java, sadly, sets a mustache value "java8". This change updates this so that "java" in the mustache
libraries means what it should mean - use all java8 classes. In this case, there's no need for the third party Base64 library
as java8's JDK has this built in. In my view, the "dateLibrary" should be deprecated but that should be a separate PR.

* updated samples

* fixed tests for new CLI java8

* regenerated samples after master merge

* oops - left in an end tag after master merge

* rerun checks

* rerun checks
2017-06-29 13:23:44 +08:00
Dennis Kieselhorst
a64c7d7986 updated jackson-version (#5943) 2017-06-29 10:56:12 +08:00
Dennis Kieselhorst
e3da4f9fde updated maven-war-plugin (#5941) 2017-06-29 00:14:16 +08:00
wing328
5d7ff49658 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-06-28 16:23:55 +08:00
Dennis Kieselhorst
4f6e2857cc removed obsolete jersey2-version (#5933) 2017-06-28 16:22:29 +08:00
Tony Tam
1e2465735b [2.3.0] Update Swagger Codegen to v1.5.15 (#5929)
* updated versions

* match fix in 2.2.x branch

* updated with 73df07d64c

* regenerate pom.xml for jaxrs-cxf-petstore-server-annotated-base-path

* regenerate pom.xml for jaxrs-cxf-petstore-server-non-spring-application
2017-06-28 00:13:52 +08:00
Tony Tam
73df07d64c Merge branch 'master' into issue-5753 2017-06-26 13:15:00 -07:00
wing328
49dbb51957 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-06-26 23:39:04 +08:00
Dennis Kieselhorst
68d878c244 update to latest CXF release (#5923) 2017-06-26 15:55:34 +08:00
wing328
9f83a1adb1 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-06-19 23:17:35 +08:00
stkrwork
981ad60050 [C++] [Restbed] Reworked the model template for restbed to create generic models (#5873)
* - Added Restbed Generator

* - Added Json processing functions to model
- Removed unnused code from restbed codegen class
- Added response header processing to api template

* Changed it to respect alphabetical order

* Made the string joining java 7 compatible

* Added samples

* - Reworked the getter setter generation
2017-06-19 22:56:01 +08:00
Tony Tam
9286e26162 updated versions 2017-06-16 11:49:32 -07:00
wing328
fee54157c0 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-06-15 17:14:39 +08:00
wing328
e58342bacb udpate spring samples 2017-06-15 14:33:16 +08:00
Elizabeth Thomas
b752c0a030 Adding the generator version template to api mustache file (#5691) 2017-06-15 13:59:42 +08:00
Sebastiano Miano
e66eceeaaa [C++] Server Stub Code Generator based on Pistache (#5838)
* Added C++ generator for Pistache

* Revert of CodegenOperation

* Updated template

* Removed isRestful from method declaration

* Updated httpMethod variable

* Changed isRestfulCreate
2017-06-14 22:40:00 +08:00
Paŭlo Ebermann
4b9988c4f2 Update samples for several language (just whitespace changes, reordering, VERSION) (#5828)
* Update samples for several languages.

Just whitespace changes and some reordering where the order doesn't matter.

* Adding generated .swagger-codegen/VERSION files.
2017-06-14 01:17:31 +08:00
Paŭlo Ebermann
ceff3762cc Update samples for ze-ph. (#5823) 2017-06-14 00:42:24 +08:00
wing328
1da52bf8ba Merge remote-tracking branch 'origin/master' into 2.3.0 2017-06-11 21:43:34 +08:00
wing328
12bcb18e9e Merge branch 'java-spring-throw-exceptions-#5686' of https://github.com/stevecookform3/swagger-codegen into stevecookform3-java-spring-throw-exceptions 2017-06-11 17:30:53 +08:00
wing328
f163fdb980 update spring samples 2017-06-11 15:39:08 +08:00
Mads Hvelplund
8f7e2a1563 Allow overriding the service delegate (#5662)
* Added support for injecting service implementations via web.xml

* Updated samples
2017-06-09 16:09:27 +08:00
wing328
022eb0d379 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-06-09 15:24:53 +08:00
Jean-François Côté
ccf2f2ff07 Add basic support for collection. (#5776) 2017-06-07 17:12:30 +08:00
wing328
87bbbc1a1b Merge remote-tracking branch 'origin/master' into 230_merge_master 2017-06-05 23:27:11 +08:00
stkrwork
b53a668517 [C++] Restbed Server Stub Code Generator (#5742)
* - Added Restbed Generator

* - Added Json processing functions to model
- Removed unnused code from restbed codegen class
- Added response header processing to api template

* Changed it to respect alphabetical order

* Made the string joining java 7 compatible

* Added samples
2017-06-02 14:40:07 +08:00
wing328
98684d872c Merge remote-tracking branch 'origin/master' into 2.3.0 2017-06-01 07:10:03 +08:00
Jonathan Leitschuh
d6f2424152 Fix spring generated controller annotations only generating for first return type (#5399)
Fixes the spring java code generator so that the ApiResponse fields are populated correctly
on the controller.

Related to #4693
2017-05-31 17:27:32 +08:00
stevecookform3
b185d03a1b update Spring petstore examples 2017-05-31 09:48:34 +01:00
wing328
651a3e388b Merge remote-tracking branch 'origin/master' into 2.3.0 2017-05-21 01:35:13 +08:00
Jean-François Côté
ef2028e53f [Java Play Framework] Warnings removal and default value fix (#5660)
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.

* Fix suggestions in the PR discussion + add .bat and .sh file as requested.

* Updated Readme.md file

* Remove unused mustache file + fix baseName vs paramName in all the mustache files.

* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.

* Fix the problem with the Http.MultipartFormData.FilePart

* Removal of warning (final) and fix of a missing default value for boolean query parameters
2017-05-19 22:32:19 +08:00
wing328
cc55dfbf13 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-05-18 16:22:42 +08:00
Jean-François Côté
4479382ced [Java Play Framework] Fix conversions (#5604)
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.

* Fix suggestions in the PR discussion + add .bat and .sh file as requested.

* Updated Readme.md file

* Remove unused mustache file + fix baseName vs paramName in all the mustache files.

* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.

* Fix the problem with the Http.MultipartFormData.FilePart

* Fix the conversion of boolean type

* Add samples for the fix with the boolean

* Fix bugs introduced by polci related to the bean validation.

* Refactor to use the "beanValidationCore". Asked by @wing328
2017-05-18 16:19:48 +08:00
wing328
e1e5ac4d37 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-05-17 22:00:06 +08:00
wing328
de427297ec update petstore samples for flask connexion 2017-05-16 21:09:16 +08:00
Kyle Cacciatore
046b730446 Upgraded connexion to 1.1.9 - required change to encoder as connexion is isolating implementation specific code (#5645) 2017-05-16 21:07:21 +08:00
wing328
0a67696de8 Merge branch 'empty_classes' of https://github.com/bbdouglas/swagger-codegen into bbdouglas-empty_classes 2017-05-16 17:51:42 +08:00
wing328
1fc969b050 Merge branch 'sync_samples' of https://github.com/bbdouglas/swagger-codegen into bbdouglas-sync_samples 2017-05-16 16:51:41 +08:00
Elizabeth Thomas
41cfcc6f23 Marking Accept as an optional header (#5622)
* Making Accept Header as not required by default

* Adding the auto-generated spring mvc petstore sample controllers
2017-05-16 16:30:11 +08:00
wing328
b8715fc4a5 add back example support to java spring (breaking changes) (#5606) 2017-05-10 23:31:25 +08:00
wing328
45ff39c237 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-05-10 18:04:49 +08:00
wing328
9b68f02f83 [Java][Spring] Undo "Add examples defined in the spec to Spring MVC server generator " (#5599)
* remove unused pom.xml in go pestore

* remove example support in JavaSprin (undo changes)
2017-05-10 17:31:43 +08:00
Luca Favatella
ea16da813c [Erlang] Plant CI for server (#5559)
* [Erlang] Address apparent reproducibily issue of sample

Spotted running `bin/erlang-petstore-server.sh` on d08d55d41 .

Apart from newlines, this is the opposite change of ec6248cbc .

* [Erlang] Perform basic testing of sample server on CI

* [Erlang] Install recent Erlang/OTP version

... in order to satisfy `jesse` compilation.

The error I faced is:
```
$ curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  766k  100  766k    0     0  1041k      0 --:--:-- --:--:-- --:--:-- 1041k
rebar 3.3.6 on Erlang/OTP R16B03 Erts 5.10.4
...
===> Verifying dependencies...
===> Fetching jesse ({git,"https://github.com/for-GET/jesse.git",
                                 {tag,"1.4.0"}})
===> Fetching jsx ({git,"https://github.com/talentdeficit/jsx.git",
                               {branch,"v2.8.0"}})
===> Skipping jsx (from {git,"git://github.com/talentdeficit/jsx.git",
                                    {tag,"2.8.0"}}) as an app of the same name has already been fetched
===> Compiling jsx
===> Compiling jesse
===> Compiling _build/default/lib/jesse/src/jesse_tests_util.erl failed
_build/default/lib/jesse/src/jesse_tests_util.erl:28: can't find include lib "common_test/include/ct.hrl"
_build/default/lib/jesse/src/jesse_tests_util.erl:55: undefined macro 'config/2'

_build/default/lib/jesse/src/jesse_tests_util.erl:24: function do_test/2 undefined

_build/default/lib/jesse/src/jesse_tests_util.erl:72: function test_schema/3 is unused
_build/default/lib/jesse/src/jesse_tests_util.erl:102: function get_path/2 is unused
_build/default/lib/jesse/src/jesse_tests_util.erl:105: function load_schema/1 is unused

[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751)
	at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Erlang Test) on project ErlangServerTests: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
```

* [Erlang] Bump `jsx` dependency to latest stable version

* [Erlang] Disable sample server from CI until compilation works
2017-05-06 11:23:30 +08:00
wing328
fb357086c8 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-05-04 19:04:39 +08:00
Andrea Polci
fd17955685 #5548 Avoid html escaping of pattern in bean validation (#5549)
* Issue #5548 Avoid html escaping of pattern in bean validation

* Run spring-all-petstore.sh and java-petstore-all.sh scripts
2017-05-04 17:12:13 +08:00
Benjamin Douglas
34d9dca5e7 Update samples to current code/scripts
This is the result of

  - `$ git checkout master`
  - `$ bin/run-all-petstore`

No change was made to the code, just ran the aggregate sample generation
script.
2017-05-02 10:33:06 -07:00
wing328
2ac169c750 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-28 02:03:42 +08:00
wing328
2324e927bd [Java][Spring] fix missing import for java.io.IOException (#5501)
* fix issue about import io exception for spring mvc

* fix spring-mvc-petstore-j8-async script, config

* update spring cloud client, restore petstore.yaml
2017-04-28 00:45:06 +08:00
wing328
b5949f61e4 update spring petstore samples 2017-04-27 22:24:23 +08:00
wing328
7b57dd0c04 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-27 21:18:52 +08:00
wing328
3c9b495eb1 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-27 21:16:16 +08:00
wing328
89464cbe5f Update pom.xml for CircleCI to test java-related projects only (#5477)
Update pom.xml for CircleCI to test java-related projects only
2017-04-27 00:49:03 +08:00
wing328
58db6a5e14 Revert "Issue#5376- changes to include swagger version in generated api files (#5449)" (#5489)
This reverts commit 702f193f61.
2017-04-26 17:53:36 +08:00
wing328
f4d78079de Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-25 23:34:45 +08:00
Elizabeth Thomas
702f193f61 Issue#5376- changes to include swagger version in generated api files (#5449)
* Elizabeth - changes to include swagger version in generated api files

* Filtering version.properties in swagger codegen module

* Removing resource filtering from swagger codegen cli module

* Merging master
2017-04-25 23:28:16 +08:00
Elizabeth Thomas
efb337dd92 Issue 5413 - Use ConstructorBased Injection for ObjectMapper (#5430)
* Converting to constructor based injection

* Correcting spelling mistake

* Adding the bean for ObjectMapper

* Adding files modified by running the petstore scripts

* Adding final qualifier to objectMapper variable in apiController mustache
2017-04-25 23:11:18 +08:00
wing328
3ef7694b9f Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-25 21:39:17 +08:00
Kenny Jones
c14da15b3e Feature: Enable validation (#5391)
When useBeanValidation is enabled make sure the annotation @Valid
is added to the attributes of the model.
2017-04-24 23:18:04 +08:00
wing328
59801d5167 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-24 21:35:38 +08:00
Phillip Novess
7282ad2d6a updated to place environment files in the correct location (#5168) 2017-04-24 18:37:37 +08:00
Phillip Novess
a2080810f8 updated to fix issue #5053 (#5057)
* updated to fix issue #5053

* updated test
2017-04-24 18:16:10 +08:00
wing328
863f431dfb update all spring petstore samples 2017-04-24 00:27:20 +08:00
wing328
4067986e1c update spring mvc samples 2017-04-24 00:06:42 +08:00
wing328
f7cbb2c0e6 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-23 15:26:15 +08:00
antihax
3ed1aa8e79 Rewrite of Go Client #2 (#5037)
* Rewrite of Go Client

* Revert to older version of context.Context

* Clean and bulk up concurrency test.

* Correct {{path}} to {{{path}}}

* change custom date type to string.

* Add APIKey authentication

* Correct missing line from resolving conflicts.

Correct missing line from resolving conflicts.
2017-04-22 01:17:18 +08:00
wing328
a1e745bdda add back petstore sample for spring boot with bean validation 2017-04-19 01:09:14 +08:00
wing328
813949dd00 add lamda to clean up examples, fix spring tempalate format 2017-04-18 18:14:00 +08:00
Benjamin Douglas
7d22605473 Adding stub test for CXF
It looks like these are not automatically generated and so needed to be filled
in manually.
2017-04-17 18:23:11 -07:00
Benjamin Douglas
07ba1eb6f8 Fixup generation of Javascript samples
The generation code was ignoring top-level aliases for any language config that
contained "java", which included "javascript", a completely different language.

Changed this to be those configs based on the JavaAbstractGenerator class.
2017-04-17 17:50:01 -07:00
Benjamin Douglas
73454e95dc Fixed up duplicate pom ids
These were generated by bin/run-all-petstore, so ultimately that script should
be modified to not generate the duplicate artifact ids.
2017-04-17 16:30:38 -07:00
Benjamin Douglas
9058099e5b Add alias type definitions for Java
When a spec defines a Model at the top level that is a non-aggretate type (such
as string, number or boolean), it essentially represents an alias for the simple
type. For example, the following spec snippet creates an alias of the boolean
type that for all intents and purposes acts just like a regular boolean.

    definitions:
      JustABoolean:
        type: boolean

This can be modeled in some languages through built-in mechanisms, such as
typedefs in C++. Java, however, just not have a clean way of representing this.

This change introduces an internal mechanism for representing aliases. It
maintains a map in DefaultCodegen that tracks these types of definitions, and
wherever it sees the "JustABoolean" type in the spec, it generates code that
uses the built-in "Boolean" instead.

This functionality currenlty only applies to Java, but could be extended to
other languages later.

The change adds a few examples of this to the fake endpoint spec for testing,
which means all of the samples change as well.
2017-04-17 12:58:31 -07:00
wing328
a17e80dfb1 minor fix to spring use of examples 2017-04-18 01:42:29 +08:00
wing328
34a99d6dba update spring petstore samples 2017-04-17 23:32:03 +08:00
wing328
a32774c541 update spring boot bean validation script 2017-04-17 23:25:27 +08:00
wing328
c7ccb1a9a9 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-17 23:05:46 +08:00
wing328
4e6a342c13 replace tab with 4-space in spring templates (#5389) 2017-04-13 19:03:34 +08:00
wing328
c637157f9e update project identifier for spring boot beanvalidation 2017-04-13 18:38:34 +08:00
wing328
50c6f87d98 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-13 17:48:34 +08:00
wing328
0682e41d6d update spring petstore sample 2017-04-13 17:44:38 +08:00
dhuning
8cf0f7046e Adds @Valid to request body for the JavaSpring (#4850)
* Adds Valid annotation for request body (#4847)

If useBeanValidation is active, this change will add Valid annotation to ReqeustBody

* Adds generated samples for bean vaildation in spring boot (#4847)

* Adds Valid import to Controller

* Adds generated code for bean validation change
2017-04-13 17:42:02 +08:00
Benjamin Douglas
ab69ce5dc3 Add null pointer check to add/put methods (#5385) (#5386)
Commit e3d04ee01 (issue #5240) introduced unsafe add/put methods for optional
list/map parameters. This change maintains the spirit of issue #5240 (optional
containers are null by default) while still making add/put calls safe. It does
this by checking for null first and, if so, initializing it with an empty
container.

Also updated the affected samples using the various scripts in bin/.
2017-04-13 17:37:49 +08:00
wing328
1f4261d20b Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-11 22:29:28 +08:00
wing328
1fdd3e6ffa [Java][Spring] fix enum allowable values in Spring generators (#5364)
* fix enum allowable values in spring generators

* use values instead of enumVars in spring annoation
2017-04-11 22:23:09 +08:00
wing328
e3d04ee01f [Java] remove initialization for optional list property (#5363)
* set list to null in java if not required

* update petstore sample for java server stub

* update sample for msf4j

* add null assignment to new list/map in java
2017-04-11 19:07:48 +08:00
wing328
7662924ce1 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-10 23:32:06 +08:00
Jean-François Côté
2e46bb9b9f Add File support + some fixes to Play generator (#5263)
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.

* Fix suggestions in the PR discussion + add .bat and .sh file as requested.

* Updated Readme.md file

* Remove unused mustache file + fix baseName vs paramName in all the mustache files.

* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.

* Fix the problem with the Http.MultipartFormData.FilePart

* Return a FileInputStream when the returnType is "file" + Fix a couple of other bugs with boolean + updated sample

* Return an InputStream instead of FileInputStream (except in the instantiation)

* A little cleanup for the form param of type file.
2017-04-10 23:23:28 +08:00
wing328
956e7b4cb5 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-04 23:04:25 +08:00
Paŭlo Ebermann
f0b0226e46 [Java][JaxRS][Spring-MVC] Update samples for jaxrs with Jersey 1/2 and for spring-mvc (#5212)
* Update samples for Spring-MVC.

* Update samples for Spring-MVC-Jav8-async.

* Update samples jaxrs/jersey1.

* Update samples jaxrs/jersey2.

* Update samples spring-mvc

* Update samples spring-mvc-j8-async
2017-04-04 21:41:22 +08:00
wing328
ad2552ace6 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-04 15:27:17 +08:00
Paŭlo Ebermann
ffb4d52469 Update security samples: server (#5285) 2017-04-04 14:44:59 +08:00
Ian O'Neill
f303183b44 [JaxrsResteasy] Fix JacksonConfig package and RestApplication imports (#5302) (#5303)
This is for the EAP version specifically.

* The JacksonConfig class always used the io.swagger.api package
* The RestApplication class did not import the service implementations
  from the correct package
* Added shell script for generating test applications
2017-04-04 00:43:40 +08:00
wing328
cf8a9a0de0 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-04-03 14:54:50 +08:00
Paŭlo Ebermann
ce41a343d8 Updating all samples (except feign) (#5281) 2017-04-02 17:01:15 +08:00
wing328
4916142450 Merge remote-tracking branch 'origin' into 2.3.0 2017-04-02 16:06:33 +08:00
jfiala
ca6b5d09d0 [Jaxrs-cxf] Add check for useGenericResponse for jaxrs-cxf server + client (#4779)
* add check for useGenericResponse for jaxrs-cxf

* move check for genericresponse to cxf codegen #4713
2017-04-02 16:05:16 +08:00
Sebastian Mandrean
7cc20cbeba [C#][aspnetcore] Improve generated code (#5257)
* Migrate from Swashbuckle to Swashbuckle.AspNetCore

* Fix typo

* Add SwaggerResponse for all responses

* Remove model constructor

* Add required attribute if available

* Improve whitespace and remove some redundant code

* Remove redundant code from Dockerfile

* Add disable warning 1591 pragma for model utility methods for bringing down compiler warnings to zero

* Add proper model state validation before controller is called

* Regenerate AspNetCore PetStore sample
2017-03-30 22:58:25 +08:00
wing328
c9182ba00f Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-30 22:49:11 +08:00
wing328
a15af0828c update nodejs petstore samples 2017-03-30 22:39:53 +08:00
wing328
ad4de91d92 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-30 09:57:07 +08:00
Paŭlo Ebermann
db71d97370 Updating samples after #5232. (#5243)
* Updating samples after #5232.

* Fix tests after #5232.

* Fix Javascript client tests.

* JaxRS server: set serverPort only when not given from outside.

* Update JaxRS sample creator scripts to fix serverPort.

* Preliminary test fix for JaxRS server generators.

* Updating samples for JaxRS with Jersey1/2.

* Updating JaxRS samples again.
2017-03-30 01:28:53 +08:00
Paŭlo Ebermann
2830fb1794 [JaxRS Server][Jersey1/2] Pass server port by cli (#5246)
* JaxRS server: set serverPort only when not given from outside.

* Update JaxRS sample creator scripts to fix serverPort.

* Preliminary test fix for JaxRS server generators.

* Updating samples for JaxRS with Jersey1/2.
2017-03-30 01:26:37 +08:00
wing328
8f37e68049 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-29 17:25:10 +08:00
Paŭlo Ebermann
dd883e4125 Issue #3084: remove timestamps from undertow samples (#5231)
* Issue #3084: Support hideGenerationTimestamp for Undertow.

* Issue #3084: disable timestamp generation for undertow samples.

* Update samples for Undertow.
2017-03-28 16:55:08 +08:00
wing328
e41dd761b5 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-28 10:37:19 +08:00
wing328
05c671aa5a fix msf4j bin script 2017-03-28 10:07:38 +08:00
wing328
f4d1261522 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-27 16:05:44 +08:00
Paŭlo Ebermann
b275b8f9da Updating samples for spring-stubs, springboot-delegate, springboot-delegate-j8. (#5211) 2017-03-27 15:24:18 +08:00
Paŭlo Ebermann
ec6248cbcf [Erlang] pretty print swagger json (#5215)
* Pretty-print swagger.json.

(This was done via `jq`. In a later commit we'll generate it pretty-printed.)

* Erlang Server: pretty-print generated swagger.json.

* Update samples for Erlang-server.
2017-03-27 14:50:17 +08:00
wing328
1a1f5afddc add ci test for msf4j server (#5220) 2017-03-27 14:37:42 +08:00
Paŭlo Ebermann
c0e42d2ae0 Updating samples for JaxRS servers: Spec + CXF-CDI. (#5213) 2017-03-27 14:31:46 +08:00
Paŭlo Ebermann
a505822b86 Update samples for JaxRS/RestEasy/Joda. (#5205) 2017-03-27 14:28:06 +08:00
Paŭlo Ebermann
c73c7ff3b9 Update samples for Undertow. (#5207) 2017-03-27 14:27:38 +08:00
Paŭlo Ebermann
b3fac54df6 Update samples for Java Inflector. (#5204) 2017-03-27 14:10:15 +08:00
Paŭlo Ebermann
6fef9c5ce6 [java][msf4j] Update msf4j samples (and fix artifact name) (#5210)
* Fix MSF4J pom indentation.

* Set MSF4J sample artifactId in the generator script.

* Update MSF4J samples.
2017-03-27 14:09:36 +08:00
Paŭlo Ebermann
4ec23e6694 Update samples for Ruby-Client + Rails server. (#5214) 2017-03-27 13:27:13 +08:00
wing328
05a3c8d5df Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-27 12:01:56 +08:00
Paŭlo Ebermann
f0b9c2b761 [Go] #3084: remove timestamps from go server (#5218)
* Issue #3084: add hideGenerationTimestamp option to Go server generator.

* Issue #3084: use hideGenerationTimestamp in go server sample script.

* Update Go server samples.
2017-03-27 11:47:15 +08:00
wing328
7e5f65340e Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-26 23:19:25 +08:00
wing328
f719a743a0 update jaxrs-cxf sample 2017-03-26 23:16:39 +08:00
wing328
20cc80d170 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-26 23:05:46 +08:00
Paŭlo Ebermann
9b113d5a19 Update samples flask connexion (#5203)
* Update samples for flaskConnexion-python2.

* Update samples for flaskConnexion.
2017-03-26 23:02:51 +08:00
Paŭlo Ebermann
9b25c0f529 Update samples for JaxRS/CXF. (#5201) 2017-03-26 22:55:55 +08:00
wing328
41a505a1f8 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-25 14:37:59 +08:00
Jean-François Côté
282b22744c [Java][PlayFramework] Added some CLI Options + many fixes (#5180)
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.

* Fix suggestions in the PR discussion + add .bat and .sh file as requested.

* Updated Readme.md file

* Remove unused mustache file + fix baseName vs paramName in all the mustache files.

* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.

* Fix the problem with the Http.MultipartFormData.FilePart

* - Add "wrapCalls" and "useSwaggerUI" CLI Options and updated what handleException does to follow Play Framework lifecycle more closely
- Updated all mustache files accordingly
- Updated the sample
- Updates Play Framework version to the latest 2.5.13
2017-03-25 14:36:01 +08:00
Tony Tam
0e64149f63 rebuilt sample 2017-03-23 11:05:08 -07:00
wing328
8aceed7557 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-23 18:26:07 +08:00
wing328
8fbe82a66b replace tab with 4 spaces (#5174) 2017-03-23 17:18:01 +08:00
wing328
aa3a5c6347 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-23 16:54:49 +08:00
jfiala
43aa4a8569 [Jaxrs-cxf] Add method-level cascaded beanvalidation (@Valid) (#4921)
* add ApiResponse/s to operation #4718

* add method-level cascaded beanvalidation #4847
2017-03-23 15:56:23 +08:00
wing328
c206086abe Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-22 23:03:02 +08:00
wing328
2b0efda3bd [Java][Play] Remove swagger play dependency, cleanup (#5159)
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.

* Fix suggestions in the PR discussion + add .bat and .sh file as requested.

* Updated Readme.md file

* Remove unused mustache file + fix baseName vs paramName in all the mustache files.

* Add an CLI option to generate interface. These interfaces are implemented by the controllerImp and help to generate the code with an IDE like IntelliJ because on updates of the code the controllerImp must follow the contract of the interface. If it don't, IDE will provide support to generate missing functions or parameters. I also did some cleanup of options we don't use in Play Framework.

* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.

* Fix the problem with the Http.MultipartFormData.FilePart

* Small fixes

* Remove everything related to swagger-play. No need for annotation anymore because we export the swagger.json directly and show the documentation using swagger-ui with the direct path. Also added the sample.

* Remove/Rename paramsX mustache because there is no more documentation. Remove unused file. updated sample

* Fix the problem with default values that was not set correctly.

* Small fix related to bad merging

* Add handleException CLI options

* Fix default values once and for all!

* Update sample files + fix bug

* Fix bug with body that is required and have a list as a parameter + add bean import for interface to prevent compilation error
2017-03-22 23:00:30 +08:00
wing328
bea9e265e9 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-22 20:52:26 +08:00
wing328
a4d4b0f0bd fix pattern in python flask (#5155) 2017-03-22 20:41:12 +08:00
wing328
4f6b3bd48b Merge remote-tracking branch 'origin/master' into 2.3.0 2017-03-22 15:55:56 +08:00
wing328
3c308ca40e update sample for spring boot 2017-03-21 23:30:54 +08:00
Fábio Franco Uechi
0afa084158 Add docker support to python flask (#5133)
* added supporting files for Dockerfile and dockerignore generation for python-flask lang

* documenting how to build the docker image and how to spin up a container

* updating pet store sample
2017-03-21 23:21:53 +08:00
wing328
6708cc50eb [Java][Play] update CI (travis) to cover Play framework petstore server (#5130)
* add test to cover play framework

* add sample for java play framework

* add script to test only if running sdk8 for play petstore
2017-03-21 22:49:05 +08:00
Sebastian Mandrean
58198939c7 [C#][aspnetcore] Fix broken Docker build option & documentation (#5128)
* Use lower-case packageName for README.md docker build example

* Use dotnet:1.0.3-sdk instead of just "latest"

* Regenerate Petstore server sample
2017-03-21 14:39:24 +08:00
wing328
08d4545947 Merge remote-tracking branch 'origin' into 2.3.0 2017-03-20 15:07:43 +08:00
foxx1337
090d80b42c [JAVA][jaxrs-spec] Add @DefaultValue for query parameters in API (#5023) (#5024)
This was previously missing and I don't think it was intentional.
It appears that swagger-codegen is already correctly processing
the yaml and the placeholder in the template was the only thing
missing.
2017-03-20 15:04:27 +08:00
wing328
1010ecc8d5 Merge remote-tracking branch 'origin' into 2.3.0 2017-03-18 15:39:10 +08:00
Sebastian Mandrean
5ed94a002c [Haskell] Fix broken client/server compilation errors (#5097)
* Remove dead legacy code

* Update cosmetics according to Haskell standard practices

* Fix failing pattern matching for lookupEither

* Bump to latest dependencies without any breaking changes

* Remove duplicate instance declarations already existing in Servant.API.Verbs

* Fix double Java/Haskell escapement bug

* Re-generate Petstore sample client/server
2017-03-17 16:55:11 +08:00
Paŭlo Ebermann
1c160df338 Fix Issue #5063 (deleting wrong sample files) (#5064)
* Update samples for springboot, spring-delegate, spring-delegate-j8.

* Issue #5063: delete samples in the correct directory.
2017-03-16 01:36:25 +08:00
Paul Ebermann
5bb0f7a933 Update all samples. 2017-03-15 18:25:40 +01:00
Paul Ebermann
784169bc3f Merge branch 'master' into new-sync-master-to-2.3.0 2017-03-15 16:41:33 +01:00
Paul Ebermann
08ea36b13d Merge remote-tracking branch 'upstream/2.3.0' into new-sync-master-to-2.3.0 2017-03-15 16:34:27 +01:00
wing328
c1f422b965 Merge pull request #5072 from swagger-api/sync_master_230
Sync master to 2.3.0 branch
2017-03-15 23:09:31 +08:00
Sebastian Mandrean
55508d9c24 [Haskell] Bump dependencies (#5061)
* Bump haskell-servant dependencies

* Update haskell-servant petstore sample
2017-03-15 17:42:08 +08:00
Paŭlo Ebermann
31f29be2a0 Use deterministic randomness in ExampleGenerator. (#5068)
* Update samples for nodejs + nodejs-google-cloud-functions.

* Fix example generator to use deterministic randomness.

This avoids changing results after each generation, and makes diff reviews easier.

* Update NodeJS samples.

This is the last "randomness" update. From now on the samples should only change if either the generator, the input or parameters change.
2017-03-15 17:15:13 +08:00
Paŭlo Ebermann
e1b1edf958 Merge branch 'merge-2.3.0' into new-sync-master-to-2.3.0 2017-03-14 21:04:47 +01:00
Paul Ebermann
26b618241a Merge branch 'update-samples-for-sync_master_230' into merge-2.3.0 2017-03-14 13:11:24 +01:00
Paul Ebermann
aba5abd15e Update samples again after swagger-parser bump. 2017-03-14 12:54:11 +01:00
Paŭlo Ebermann
9be178b26a Merge branch 'master' into new-sync-master-to-2.3.0 2017-03-13 21:42:41 +01:00
Paŭlo Ebermann
22de105895 Merge remote-tracking branch 'upstream/2.3.0' into merge-2.3.0 2017-03-13 21:26:39 +01:00
Paŭlo Ebermann
3a48ba8bfd Update all the samples.
(except clojure + scalatra, because those are broken, will fixed with later master merge.)
2017-03-13 19:50:10 +01:00
jfiala
39eba39625 [Jaxrs-cxf] add ApiResponse/s to operation #4718 (#4920)
* add ApiResponse/s to operation #4718

* use spaces instead of tabs #4718

* fix alignment issues #4920

* fix alignment issues #4920

* replace tabs with spaces #4920

* updated samples #4920
2017-03-12 16:58:19 +08:00