Commit Graph

906 Commits

Author SHA1 Message Date
Christophe Bornet
a3aabd3908 Create a default implementation of delegate if none could be autowired (#92) 2018-05-24 07:50:05 -07:00
Jérémie Bresson
00f176ad95 Add 'bin/ensure-up-to-date' script and update Shippable CI (#136)
* Create 'bin/ensure-up-to-date' script

* Update shippable config

* Do no longer copy 'CI/pom.xml.shippable' to 'pom.xml'
* Fix paths in CI/pom.xml.shippable

* shippable: remove write to file

* shippable: move order

* Run 'bin/ruby-petstore.sh' to update 'samples/'

* Add Kotlin scripts to the list
2018-05-24 10:18:35 -04:00
Jérémie Bresson
3f81378d72
[java resteasy] fix string comparison (#134)
* Fix StringUtils.isEmpty(..)
* Update all JaxRS samples
2018-05-23 08:38:18 +02:00
Jim Schubert
27426f7b52 Cli generator name option, replaces 'language' options in CLI and Maven Plugin (#57) 2018-05-23 05:41:19 +02:00
Jérémie Bresson
b73ab0260e jaxrs-cxf-cdi: fix outer enum (#131)
* jaxrs-cxf-cdi: fix model enum

* Fix script 'bin/jaxrs-cxf-cdi-petstore-server.sh'

See https://github.com/OpenAPITools/openapi-generator/pull/124

* Run 'bin/jaxrs-cxf-cdi-petstore-server.sh'
2018-05-22 17:55:19 -04:00
Matthias Baer
d9d6530161 [aspnetcore] Make the use of Swashbuckle optional (#110)
* Respect the sourceFolder option correctly

* Add an option to disable the use of Swashbuckle (useSwashbuckle)
2018-05-20 09:28:24 -04:00
Jérémie Bresson
82ee8656fd
[java] Enum in array of array (#66) 2018-05-18 19:01:11 +02:00
Antoine Reilles
d890d733f8 [JaxRS-Java] issue with implFolder on windows, and required fields generation for containers (#88)
* Fix implFolder issue with jaxrs-cxf-cdi generator

This fix is for the issue:
https://github.com/swagger-api/swagger-codegen/issues/8113

When using jaxrs-cxf-cdi and other JaxRS generators, the implFolder
config is not honored by hte generator on windows.

* jaxrs-cxf-cdi: containers with no default init

Change similar to
https://github.com/swagger-api/swagger-codegen/pull/5363/files for
jax-rs-cdi generator.
When a property that is a contained is not declared as required, it is
initialized to `null`, and not to the empty container.
This makes apio mich more easy to use, since one can differentiate when
an input list in json has been set to the empty array or simply not set.
2018-05-17 19:28:05 +02:00
Jim Schubert
9a8183ab05 [aspnetcore] Fix openapi.json location rename (#56)
Swashbuckle generation was missing the configuration to rename from
default swagger.json to openapi.json (expected by change in SwaggerUI's
configuration for the endpoint).

This generates to the appropriate location and updates the sample to
load the Swagger UI properly on run.
2018-05-16 11:16:55 +08:00
Matthias Baer
de5260a7ce Update the aspnetcore generation (#53)
This change resolves an issue I had with opening the aspnetcore Solution (Visual Studio could not load the project). The *.sln file contained an old GUID for ASP.NET 5.
Also removed the obsolete NuGet.Config file and updated the package references to the newest versions.
2018-05-15 21:41:44 -04:00
Jérémie Bresson
4d7fc046f3
[JaxRS] Add "validation-api" dependency in jetty (#30)
Fix #28 

* Add "javax.validation:validation-api" dependency in jetty
* Update JaxRS and Spring samples
2018-05-13 18:12:01 +02:00
Jim Schubert
52322c47c9 [finch] Allow finch server to compile for CI checks (#7)
Previous error handling implementation had types returning
Either[CommonError, UserType], but implemented with the scala shortcut
??? which throws an exception instead. This causes compilation to fail
with a message that the expected CommonError is of type Any. This is
often fixable with generic upper bounds constraints, but this is
overkill for a placeholder implementation. Returning a temporary 'TODO'
type solves the compile error, and should allow CI to check for valid
compilation on changes.

Included in this is also a fix to support optional query parameter
types. The spec used to generate the finch server has optional query
parameters, but the version of finch in the template doesn't support
options on query parameters. Finch does, however, aggregate everything
(headers, query string, path parameters, etc) under "param" with
"paramOption" for those which are optional types.
2018-05-13 11:07:14 +08:00
Jérémie Bresson
90b7c89443 Implement hideGenerationTimestamp for kotlin-server ktor (#416) 2018-05-11 11:24:56 +08:00
William Cheng
064418ed12
update finch generator's default value (#394) 2018-05-11 09:18:49 +08:00
Jérémie Bresson
a07ab606dc Small fixes in samples (#410) 2018-05-10 13:45:12 +08:00
William Cheng
868ede53f9
Update Scalatra's default value (#403)
* update scalatra default value

* minor rupdate to template
2018-05-10 10:56:11 +08:00
Jérémie Bresson
a00261d3da Change default package name value for kotlin server (#387)
* Update default package

* Regenerate samples/server/petstore/kotlin-server/ktor

* Update git ignore

* Add CI
2018-05-09 16:38:16 +08:00
Akihito Nakano
872dd546f4 Update php related samples (#375)
* Update php client (OAS3)

bin/openapi3/php-petstore.sh

* Update symfony server (OAS2)

bin/php-symfony-petstore.sh

* Lumen: remove 'swagger'

* Update lumen server (OAS2)

* Update php client (security): deleted 'SwaggerClient-php' folder

* Update TEST_DIR

* Update php client tests (OAS3)

bin/openapi3/php-petstore.sh

* Update php client (OAS2)

bin/php-petstore.sh

* Fix

* Fix lumen -> php-lumen

* Update lumen server (security)

* Delete moved files

currently it will generate into under 'lib' folder.

* Fix slim -> php-slim

* Update slim server (security)

bin/security/slim-petstore-server.sh

* Fix

* Update dot files
2018-05-09 10:34:19 +08:00
William Cheng
e2d6f7c88f
update erlang client, server default value (#378) 2018-05-09 10:31:42 +08:00
William Cheng
a9fa4cd0db
Update default value for C++ related generator (#373)
* udpate default value for cpp, remove unused imports

* update cpprest template

* update tizen default value

* update cpp restbed default value

* update qt5cpp samples

* update pistache samples

* regenerate restbed ignore file
2018-05-08 22:10:40 +08:00
William Cheng
0d20f75afc
Update default value, fix example value (#370)
* fix python flask NPE with oas3

* update perl default value, fix example value

* update android sample, fix example value

* restore x-swagger-router-controller for nodejs server generator

* update default value for bash client, fix example value, invalid tag

* update default value for objc

* update objc pestore core data
2018-05-08 19:51:15 +08:00
Jérémie Bresson
059a3efe46 Regenerate samples (#367) 2018-05-08 16:44:51 +08:00
William Cheng
0dbb6dcaa6
Update Go generators' default value (#362)
* udpate go client default value

* update go generators' default value
2018-05-08 10:16:38 +08:00
William Cheng
3758aad225
Update Python flask default value (#361)
* update python flask default value

* update python flask samples
2018-05-08 10:16:25 +08:00
Jérémie Bresson
e2f8976fa7
Remove old metadata files (#357) 2018-05-07 13:31:17 +02:00
William Cheng
d74b4cdf8d
fix map type and collection format for form parameter (array) (#356) 2018-05-07 18:22:30 +08:00
Arthur Mogliev
d30fcbabba Fixes for php-ze-ph generator (#340)
* Fixes for ze-ph:
- fixed gathering of required properties for query data model
- fixed setting of internal vendor extensions for query data model detection
- fixed small typo in generated README

* Updated samples for ze-ph fixes
2018-05-07 10:22:08 +08:00
Jérémie Bresson
4d3110f29d
Rename default packages for 'java-undertow-server' (#336) 2018-05-06 12:34:54 +02:00
Jérémie Bresson
d8fd560d64
Rename default packages for 'jaxrs-spec' (#333) 2018-05-06 12:34:36 +02:00
Jérémie Bresson
2103fadab8
Fix package declaration for play-framework (#332) 2018-05-06 08:08:34 +02:00
Christophe Bornet
90ac9d030c
Merge pull request #262 from cbornet/reactive
[Spring] Add reactive option for Spring Boot (webflux)
2018-05-05 18:01:46 +02:00
cbornet
1619486578 Add reactive option for Spring Boot (webflux) 2018-05-05 17:26:08 +02:00
akihito.nakano
1bd393f4ea Rename 'keywords' for package.json 2018-05-05 01:43:35 +09:00
akihito.nakano
90438b8e71 Tweak indent 2018-05-05 01:38:23 +09:00
akihito.nakano
6c3d7bbc48 Update nodejs samples which skipped overwriting 2018-05-05 01:36:37 +09:00
Akihito Nakano
08e0393def Fix missing examples (#305)
* Fix missing examples

* support ArraySchema

* Refactor: move the logic to generate samples from DefaultCodegen to ExampleGenerator

* Delete unnecessary argument

OpenAPI is passed in constructor

* Delete unnecessary 'import'

* Update samples ( bin/springboot-petstore-server.sh )

* Update samples ( bin/openapi3/nodejs-petstore-server.sh )
2018-05-04 17:25:49 +08:00
Jérémie Bresson
4dc519b4fe
Rename groupId for java-play-framework (#310) 2018-05-04 10:22:42 +02:00
Jérémie Bresson
0ba2a9a250
Update java play framework samples OAS2 (#286)
* Regenerate play framework examples
* Add 'samples.ci' for manual files and update scripts
2018-05-03 08:19:59 +02:00
William Cheng
9cf185912c
Fix Scalatra petstore sample (#300)
* restore scalatra from codegen

* regenerate scalatra oas2 petstore, fix defaut value

* better code format for scalatra

* more format fix for scalatra

* update scalatra parameter template
2018-05-03 13:26:04 +08:00
Jérémie Bresson
1492df6cef
Override server port for Jetty configuration (#246) 2018-05-02 07:11:29 +02:00
William Cheng
42aebe4367
Update Lumen generator petstore with OAS2, OAS3 (#256)
* update php lumen with oas3 petstore

* update lumen with oas3 pestore
2018-04-30 16:12:25 +08:00
William Cheng
7ad92572e4
Update default value for PHP server generators (slim, silex) (#272)
* update php slim samples

* update php silex samples

* update php silex default value
2018-04-30 15:18:13 +08:00
William Cheng
c60010c965
Update default value for Perl, Ruby, ROR generators (#265)
* rename perl genreator default

* update ruby sinatra default

* rename ror default value
2018-04-29 20:37:12 +08:00
William Cheng
2ce721d0b9
Update PHP ZE-PH server samples with OAS2, OAS3 (#259)
* update php ze-ph samples with oas2

* update zeph samples with oas3
2018-04-28 21:48:50 +08:00
William Cheng
490255025e
Update PHP Slim server samples with OAS2, OAS3 (#258)
* update php slim server petstore with oas2

* update php slim petstore with oas3 (no diff)
2018-04-28 21:48:40 +08:00
William Cheng
7621deeb9f
Update PHP Silex server petstore with OAS2, OAS3 (#254)
* update php silex with oas2 petstore

* update php silex with oas3 petstore
2018-04-28 21:48:22 +08:00
William Cheng
69133d3677
Update PHP Symfony server petstore with OAS2, OAS3 (#255)
* update php symfony with oas2 petstore

* update php symfony with oas3 petstore
2018-04-28 14:38:37 +08:00
Jérémie Bresson
3f976afca8
Generate vertx OAS2 (#226) 2018-04-27 10:19:48 +02:00
William Cheng
049eef9c53
Test erlang client, server petstore (#235)
* test erlang client, server petstore

* rename tests, replace tab

* install rebar3 in shippable ci
2018-04-26 18:12:00 +08:00
Jérémie Bresson
19b0d37c38
Generate java-msf4j (#225) 2018-04-26 10:41:17 +02:00
Jérémie Bresson
52391ed9e5 Regenerate all jaxrs examples (#234) 2018-04-26 13:54:41 +08:00
William Cheng
df26bcb40c
Update Erlang server samples with Petstore OAS2 (#150)
* update erlang server samples with petstore oas2

* fix compilation in erlang server
2018-04-26 13:34:02 +08:00
Jérémie Bresson
4924b4951c
Generate java-pkmst (#223) 2018-04-25 07:01:48 +02:00
Jérémie Bresson
6f28209ccc
Generate java inflector OAS2 (#222) 2018-04-25 07:01:32 +02:00
Jérémie Bresson
25ccef818d
Rename default package for spring generator (#221) 2018-04-24 18:20:44 +02:00
Jérémie Bresson
949ef4453a
Generate java spring OAS2 (#216) 2018-04-24 16:26:52 +02:00
William Cheng
2c6380c846
fix inner item (list, map) for play framework (#217) 2018-04-24 19:02:10 +08:00
Jérémie Bresson
5340c35ce1
Rename sagger metadata and more (#208)
* Rename groupId, artifactId, project name, title, ...
* Remove .swagger-codegen/VERSION file
2018-04-24 08:08:53 +02:00
Jérémie Bresson
d5d8c356b7
Rename default packages for jaxrs generators (#209) 2018-04-24 06:26:42 +02:00
Jérémie Bresson
6983dcffa2
Update all jaxrs examples (#144) 2018-04-23 12:17:14 +02:00
Jérémie Bresson
7ecd5f3566
Rename "swagger" to "openapi" (#191)
* Rename ".swagger-codegen-ignore" to ".openapi-generator-ignore"
* Rename setGenerateSwaggerMetadata(Boolean) to setGenerateMetadata(Boolean)
* Rename Metadata Folder to .openapi-generator
2018-04-22 21:28:17 +02:00
Jérémie Bresson
2e50780e1d
Remove "swagger-" prefix from artifactId (#170)
* Remove "swagger-" prefix in the samples artifactId
* Rename some artifactIds to make them unique
2018-04-21 12:31:21 +02:00
William Cheng
93bf3d91ea
Update C++ Pistache samples with oas2, oas3 (#166)
* restore pistache from codegen 2.x

* update pistache samples with oas2

* update pistache with oas3 petstore (no diff)

* restore datatype for array of model

* update pisache server scripts

* Revert "restore datatype for array of model"

This reverts commit 3b949a3873f3fca78311065173eda26e786dedec.

* fix array of models in method signature
2018-04-21 00:40:45 +08:00
Jérémie Bresson
d21e4227a6 Update finch Petstore OAS2 (#126)
* Update finch sample

* Udpate 'finch' samples

* update finch with oas3 petstore (no diff)
2018-04-20 21:52:22 +08:00
William Cheng
8a4f905892
Update C++ Restbed server samples with OAS2, OAS3 (#165)
* restore restbed samples from codegen2x

* update restbed samples with oas2

* update restbed sample with oas3 (no diff)
2018-04-20 19:07:42 +08:00
William Cheng
28a1255c0e
Update Go server petstore sample with OAS3 (#154)
* restore go server from codegen 2x

* update go server petstore with oas3
2018-04-20 12:05:27 +08:00
William Cheng
686ff6a502
Go server petstore update (OAS2, OAS3) (#146)
* restore go server petstore from codegen 2x

* update go server petstore (oas2) - no diff

* update go server samples (oas3)

* add go petstore server script
2018-04-19 21:57:22 +08:00
William Cheng
74ddbf7a16
update scalatra with oas2 spec (#131) 2018-04-19 09:16:52 +08:00
William Cheng
05f5c5798b
Update html, dynamic-html petstore, fix example value for form parameters (#122)
* update dynamic-html samples with oas2

* update dynamic-html oas3 (no change)

* update html petstore (oas2)

* update html petstore with oas3

* fix example value for form parameters

* fix javadoc string
2018-04-18 17:42:38 +08:00
William Cheng
08038ddc30
update haskell servant samples with oas3, oas2 (#116) 2018-04-18 01:48:49 +08:00
William Cheng
ddf10b98dc
Update NodeJS server petstore samples with OAS2, OAS3 (#113)
* update nodejs server oas2

* update nodejs server petstore with oas3

* update nodejs google cloud with oas2 petstore

* update nodejs server google function with oas3
2018-04-17 22:58:13 +08:00
William Cheng
0fc84687ff
update rails petstore (oas3) (#111) 2018-04-17 21:03:00 +08:00
Jeremie Bresson
53597764c3 Add OpenAPI spec 3.0 support (beta)
Co-authored-by: Akihito Nakano <sora.akatsuki@gmail.com>
Co-authored-by: Jeremie Bresson <dev@jmini.fr>
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
Co-authored-by: Martin Delille <martin@phonations.com>
Co-authored-by: Tomasz Prus <tomasz.prus@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2018-04-17 09:19:10 +02:00
William Cheng
e7f4fb3c45
Fix nodejs-server path issue in windows platform (#7808)
* fix nodejs-server path issue in windows platform

* only replace character in apiPackage
2018-03-12 23:21:07 +08:00
Simon Sprünker
f00a1ef52c [JAVA] Fix #7734: Correct consumes/produces attributes for Spring Controllers (#7760)
* fix #7734: Correct consumes/produces attributes for Spring Controllers

* fix #7734: Update petstore
2018-03-08 22:56:43 +08:00
Adam Conway
ff1178ad7e [Java][Spring] fix optional query params missing in generated swagger (#7607)
* Added genericModelSubstitutes if using Optional

As per https://github.com/springfox/springfox/issues/1848  Doesn't seem to fix the problem, but is what springfox recommends so might be aprt of it.

* Added config package to scans

If you have defined apiPackage and basepackage (e.g. as com.example.api) but not defined configPackage then config is still in io.swagger.config and is not included in the component scan.  This means the config is not used when generating the swagger definition from the code.  Fixed by including configPackage also in the scan.

* Ran spring-all-pestore.sh update script

* Converted tabs to spaces

* Ran spring-all-pestore.sh update script
2018-02-23 00:02:38 +08:00
shigeru.nakajima
dcad9ae807 [Rails5] make version of the generated Rails stub server to strict Rails 5.0 (#7700) 2018-02-22 15:57:14 +08:00
William Cheng
854b5012be
fix NPE when host is undefined (#7633) 2018-02-10 17:11:11 +08:00
Jim Schubert
8668175879 [aspnetcore] Fix string enum generation (#7581)
* [aspnetcore] Fix enum strings generation regression

* [aspnetcore] Regenerate sample
2018-02-08 14:43:47 +08:00
wing328
5d92717dc9 update jaxrs to listent at port 10080 2018-01-30 00:23:08 +08:00
wing328
7c20316755 update artifict id for jaxrs datelib j8 2018-01-29 13:51:21 +08:00
wing328
cf21ac0327 update spring petstore samples 2018-01-29 01:38:13 +08:00
wing328
87cdddcf17 add CI test for JAXRS datelibrary java8 2018-01-29 00:35:09 +08:00
jarlesat
88c5112f2e Adds support for returning response in jaxrs-spec interfaces (#7442)
* Issue 7440 Added support for returning response in jaxrs-spec interfaces.

* Issue-7386 Updates samples for jaxrs-spec interfaces introduced in issue 7386.
2018-01-28 15:19:30 +08:00
Jim Schubert
7cad47dd39 [kotlin-server] --library=ktor (barebones implementation) (#7412)
* [tools] Make sed in new.sh more cross-platform

The -r option passed to sed is a GNU sed option for extended regex
evaluation. The -E option evaluates the same option, and is part of the
POSIX standard, meaning this option is available in GNU sed as well as
Apple's BSD variant.

This commit removes the need for users to install gnu-sed on Mac.

* [ktor] Initial ktor (kotlin-server)

This adds a very barebones implementation for a ktor server generator.

This supports metrics and typed locations. All endpoins are stubbed to
return HTTP/1.1 501 Not Implemented.

* [ktor] Initial sample

* [ktor] Adding options for select feature installs

Options available:

* featureAutoHead
* featureConditionalHeaders
* featureHSTS
* featureCORS
* featureCompression

* [ktor] Start of auth functionality

* [ktor] API key auth placeholder

* Add basic support for oauth2 configurations

ktor doesn't seem to explicitly accept oauth flow properties in its
configuration object. This may be a blocker for 'implicit' flow
definitions.

* Added example response objects

* [ktor] Route for apis with bodies, some cleanup

ktor locations are only supported for routes with path/query parameters.
Routes with body or file parameters must be declared with traditional
route api.

This commit also includes lambdas for simplifying processing in
library-based server generator code. As an example, ktor requires
lowercase http methods while spring (a potential future generator)
would require an uppercase such as HttpMethod.GET. It doesn't make sense
to modify these in the operations post-process method because that
format wouldn't be universally desirable.

The lambdas included in the KotlinServerCodegen:
* lowercase: converts all text to lowercase
* uppercase: converts all text to UPPERCASE
* titlecase: converts words (with configurable delim) to Title Case
* indented|indented_8|indented_12|indented_16: these helpers apply the
  same desired indent to all lines of an included fragment's text.

* Fix some javadoc issues in lambda classes

* Update kotlin-server-petstore.bat

Change `kotlin` to `kotlin-server`

* Fix javadoc error messages in CI
2018-01-27 17:43:46 +08:00
William Cheng
2d898511a8
Add Play server samples to CircleCI (#7501)
* add play server samples to circle ci

* add pom.xml for java play framework
2018-01-26 09:48:51 +08:00
Jean-François Côté
e33b350c89 Fix an issue in Play Framework generator where a CSV is empty and transfered to the controllerImp with an empty item. (#7496) 2018-01-25 21:53:20 +08:00
etondoze
d1a296412e Upgraded swagger-parser and swagger-core versions (#7497) 2018-01-25 21:35:11 +08:00
Articus
60e3339aa6 [Feature][PHP] Update for ze-ph generator (#7472)
* update for ze-ph generator stub to support Zend Expressive 2.1 and Path Handler 0.3

* ze-ph: for each operation generator creates special DTO model from its query parameters

* ze-ph: generation of extra TODO's for complex container type and update for samples
2018-01-24 12:36:24 +08:00
wing328
5a3a33b3c8 update java vertx server samples 2018-01-24 12:32:45 +08:00
William Cheng
cf4df630b7
Add Spring Petstore samples (async, java8-localdatetime) to CircleCI (#7468)
* add ci for spring mvc: async, localdatetime

* update artifactId for new spring samples
2018-01-22 21:35:51 +08:00
jarlesat
99fc272465 [JAX-RS][Spec] Removes throws Exception. (#7437)
* Issue-7435 Removes throws Exception.

* Issue-7435 Updates jaxrs-samples.
2018-01-22 13:48:59 +08:00
magnolia
6db63c7a1f deleted unnecessary notes (#7454)
https://github.com/swagger-api/swagger-codegen/issues/7398
2018-01-20 14:31:43 +08:00
ccozzolino
59ff4c198b [Java][library: vertx] Add default value and required parameter support to vertx server temp… (#7410)
* Add default value and required parameter support to vertx server templates. Fix for #7409.

* Added missing serviceId declaration to workaround #allParams section clearing the vendorExtensions map
2018-01-20 14:31:06 +08:00
magnolia
7853308c8e Rebuild Scalatra sample (#7431)
When creating the following PR, sample was generated without reflecting the last change.

https://github.com/swagger-api/swagger-codegen/pull/7393

With this commit, it will be synchronized
2018-01-19 16:20:41 +08:00
magnolia
1ee85de94e Added Intelli J ignore (#7423)
.idea
*.iml
2018-01-19 16:20:12 +08:00
magnolia
7b8e409cf9 Added gitignore generation function (#7402)
Copy gitignore template from client
2018-01-15 21:00:26 +08:00
William Cheng
389344726e
Split CircleCI test into JDK7, JDK8 specified tests (#7405)
* split out circleci pom for jdk7, jdk8

* update circle config to use jdk7 pom
2018-01-15 16:46:33 +08:00
Euan Kemp
027df610b1 [Rust] Handle error response statuses (#6865)
* [Rust] Consider error statuscodes to be errors

* [Rust] Introduce 'ApiError' type for 4xx/5xx resp

This updates the previous commit which added an 'ErrorStatus' variant to
an 'ApiError' variant.

It does not specialize the error to the specific possible error
responses yet, rather returning a 'serde_json::Value' for any case.

This will lose any error messages which cannot be parsed as json and
instead return a json-parse error.

A future change should update the generated signatures such that the
returned future's error type is specialized to the specific errors that
may be returned by that api (and possibly a catchall json::Value still).

* [Rust] Regenerate petstore samples

* [Rust] Add error example to petstore sample
2018-01-15 11:38:11 +08:00
magnolia
d5c355a596 [Scalatra] Updated the version of Scalatra to the latest (2.6.2) (#7393)
* Updated the version of Scalatra to the latest (2.6.2)

 - Updated Scalatra 2.6.2 (latest)
 - Updated Scala 2.12.4
 - Updated sbt 1.1.0
 - Reduced dependent artifacts to a minimum
 - Cleaned up build.sbt
 - Changed the package name from client to server
 - Set log output (logback)
 - Updated web.xml for servlet 3.1

* rename package 'com.wordnik' -> 'io.swagger'

* Added rolling file appender to logback.xml
2018-01-14 18:11:37 +08:00
wing328
97298bdb03 Merge branch '2.4.0' of https://github.com/swagger-api/swagger-codegen into 2.4.0 2018-01-14 17:14:43 +08:00
sneumann
9e06f7063f Fix assignment of new object instance to variable (#7379)
* #7359 Fix - use reflection to instantiate non-generated class (#7360)

* add tests for java vertx petstore

* add swagger example to README.md (#7368)

* Fix assignment of new object instance to variable

Fixes `Error in foobar$fromJSONString(s) : object 'CategoryObject' not found`
Discussion in https://github.com/swagger-api/swagger-codegen/issues/6520#issuecomment-357132746 ,
thanks @wing328 for encouraging.
2018-01-14 17:14:35 +08:00
antihax
72abb20f2e [Go] Fix operation files clobbering model files. [2.4.0] (#7337)
* Prevent operation files clobbering model files.

* Update Tests
2018-01-14 17:00:17 +08:00
wing328
73c338be58 Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-13 15:54:41 +08:00
William Cheng
8aef689d1b
[Java] allow setting boolean getter (is, has, get) in templates (#7344)
* allow setting java boolean getter (is, has, get) in templates

* update msf4j boolean getter

* update jaxrs-spec boolean handler

* update jaxrs boolean getter

* update reasteasy, spring, cxf boolean getter

* update inflector boolean getter

* update java play boolean getter

* update java boolean getter

* update spring samples
2018-01-13 15:19:02 +08:00
wing328
50b599719d add tests for java vertx petstore 2018-01-11 16:36:23 +08:00
ccozzolino
247fbd4435 #7359 Fix - use reflection to instantiate non-generated class (#7360) 2018-01-11 16:31:37 +08:00
Jean-François Côté
ebf4efe3ea Fix issue #6867 : The apiPackage option was ignored (#7316)
* Fix issue #6867 : The apiPackage option is ignored in the template for Java Play Framework.

* use openjdk7 in travis to ensure it works with jdk7
2018-01-10 13:15:49 +08:00
wing328
16e3226c8a Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-08 18:01:20 +08:00
Mehdi Jouan
c7f12d6c2d [Spring][Java] fix support of long values for @Max and @Min annotations (#7227)
* add support of long values for @Max and @Min annotations

* run shell scripts for java and spring

* fix import issue after running shell script
2018-01-08 00:22:06 +08:00
Sunrin SHIMURA
f5adbec1ff [Rust-Server] Use string literal based mime initialization (#7212)
* Use string literal based mime initialization to avoid invalid token error

* canonicalize mimetypes before checking
2018-01-08 00:00:12 +08:00
ccozzolino
d9745962be [Java:vertx] Initialize router in init method and re-use router member to create S… (#7234)
* Initialize router in init method and re-use router member to create SwaggerRouter

* Added generated samples for 7320 fix

* Fixed alignment to 4 spaces for 7320 fix
2018-01-07 23:37:37 +08:00
wing328
007974e3de Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-07 23:13:24 +08:00
craffael
9a284776d8 [Java] Fix serialization of the discriminator field when using GSON (#7075)
* set discriminator on object construction...

* regenerate all java samples

* run bin/java-msf4j-petstore-server.sh

* remove extra newline
2018-01-07 23:10:32 +08:00
Dennis Kieselhorst
ee5709177a [Java] update CXF to latest release (3.2.1) (#7284)
* update CXF to latest release (3.2.1)

* update CXF to latest release (3.2.1) - samples update
2018-01-07 11:43:34 +08:00
Ben Wells
7479fc5361 Generate swagger yaml for go client (#7281) 2018-01-07 11:37:40 +08:00
Jean-François Côté
3465f2918e Fix a regression bug that was introduce in a recent commit. Removed the tabs that were causing error in Play Framework (#7241) 2018-01-07 10:48:49 +08:00
Ben Wells
83fb107749 Create abstract go codegen base class (#7197)
Remove tabs
2017-12-19 23:41:02 +08:00
William Cheng
bd19111ff0
[Java][PKMST] Move resource folder (#7213)
* comment out pkmst test for the time being

* move pkmst resource folder
2017-12-19 22:16:16 +08:00
William Cheng
37cd8b52d0
[Java][PKMST] rename pkmst to java-pkmst, update scripts/batch files (#7209)
* rename pkmst to java-pkmst, update scripts/batch files

* update pkmst batch file
2017-12-19 17:25:48 +08:00
sanshuman
cb59591eff pkmst- Prokarma microservice toolkit for java (#7023)
* Added pkmst-microservice toolkit

* formatted

* replaces tab with blank spaces

* adding documentation folder

* adding documentation folder

* Update readme.mustache

Added feature set offered by pkmst

* updated readme

* Update io.swagger.codegen.CodegenConfig

Arranged pkmstServerCodeGen and SymfonyServerCodegen in aphabatical order

* Update readme.mustache

* renamed according to convention and added typeinfoannotation

* removed tabs

* updated codegen which extends abstractjavacodegen

* Added the script files and rectified the errors

* folder name changed and commons -lang3 version upgraded

* updated readme.mustache

* updated logging filter

* Added petstore to samples and updated the pom for the same

* Added java-pkmst sample to pom.xml.circleci

* updated readme.mustache
2017-12-19 16:12:44 +08:00
Sunrin SHIMURA
7d96f61e5d [Rust-Server] use status codes as the variants of the response enums instead of descriptions (#7125)
* use status codes in the variants of the responses instead of message

* samples

* add missing {{code}}

* use human friendly idents if possible

* generate samples

* salvage an oversight
2017-12-19 14:40:35 +08:00
Ben Wells
6349e79a59 Fix typo in Petstore yaml (#7195) 2017-12-18 12:30:57 +08:00
Ben Wells
d25341d58d Output models for go-server #3851 (#7188)
* Output swagger models.

Fix route verbs and formatting

* Remove backup files

* Make postProcessOperations consistent with go client
2017-12-17 21:55:20 +08:00
Christophe Bornet
79326399ef Fix starting springboot server from IDE (#7184) 2017-12-16 11:19:31 +08:00
elion
20ace869b7 Issue 7151 2.3.0 (#7181)
* Removed redundant version declaration. Upgraded Spring boot dependency version.

* Update samples
2017-12-15 21:04:00 +08:00
wing328
f1c52dc97e Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-12-15 00:31:41 +08:00
Ben Wells
2e348b27f7 [Go-server] Fix formatting of go-server generated code (#7162)
* Add missing go-server petstore batch script

* Make go-server confirm to gofmt
2017-12-15 00:04:48 +08:00
wing328
1d44bb8141 update spring petstore samples 2017-12-15 00:02:43 +08:00
Max K
a96bc3a409 Added support for controller action parameter validation into the ValidateModelStateAttribute (#7156) 2017-12-14 12:26:57 +08:00
Max K
5306372b98 Added Contact NAME to Startup.cs (#7168)
* Ran bin/aspnetcore-petstore-server.sh

* Added contact information to startup.cs

* updated to support NAME as well

* updated samples

* updated NAME default
2017-12-14 01:31:11 +08:00
Max K
5e4d363675 [AspnetCore Server] Added Original swagger (#7170)
* Updated Codegenerator as well as added new swagger-original mustache template

* updated Startup.cs template to provide guidance for original Swagger file

* Updated Sample
2017-12-14 00:57:16 +08:00
Max K
c496ec7269 Added support for VERSION, APPNAME and CONTACT from Swagger file into Startup.cs (#7103)
* Added support for VERSION and APPNAME from Swagger file into Startup.cs for Swashbuckle SwaggerGen

* Ran bin/aspnetcore-petstore-server.sh

* Added contact information

* Added contact information to startup.cs
2017-12-13 12:03:33 +08:00
Max K
1541d96b18 Updated SwaggerResponse Attributes so they use the actual dataType instead of the common returnType (#7096)
* Moved SwaggerResponse Attributes to use the respective dataType instead of the common returnType.

* Updated examples
2017-12-13 11:59:45 +08:00
Benjamin Gill
4dbb44b061 End use of deprecated openssl method (#7154) 2017-12-13 11:31:11 +08:00
Max K
9ca63955c2 Added support for Operation EXAMPLE value in ASP.NET Core Generator. (#7091)
* Added support for Operation EXAMPLE value in ASP.NET Core Generator.

* Updated PetStore samples
2017-12-13 00:13:13 +08:00
Aleksandr Nekrasov
643ef64f04 resteasy support javax injection instead of static delegate factory (#5272)
* resteasy support javax injection instead of static delegate factory

* fixed resteasy joda example
2017-12-12 00:35:51 +08:00
Max K
d881cb39bf Added Base Path support as well as PathParameterValidation (#7120)
* Ran bin/aspnetcore-petstore-server.sh

* Added BasePath filter and Validation filter

* Updated filters and added Attribute generators

* Removed newline

* Updated samples
2017-12-12 00:04:20 +08:00
Ville Skyttä
794bb07cf7 Spelling fixes (#7142) 2017-12-10 10:48:30 +08:00
Dimitar Ivanov
b4f707450a Erlang server: handle broken JSON (#7129) 2017-12-09 17:57:48 +08:00
Benjamin Gill
1a831f73f3 [rust-server] Plaintext support; encode params (#7082)
* MMORCH-428: Export the Authorization struct

This is needed so that code can check that the version of Authorization
in the auto-generated code is the same as the version it is using. If
the versions are not exactly the same then the lookup into the TypeMap
will not work.

* Add Rust as a supported language for client and server.

Clarify that there are two Rust client implementations, and one Rust server implementation.

* Percent-encode path and query parameters in client URLs
Fixes #122

Also don't include a question mark at the end of the path when there are no query paramters.
Fixes #121

* Rust2 client: add --host and --port parameters to example client.

Allows the example command-line client to override the default host and port.

* Extract default host and port from Swagger file.

* Derive 'Eq' and 'Ord' on enums

* Rust2: improve server code structure.

    server.rs (main.rs) - main entry point for binary; starts the web server and points it at the server code within the library.
    server_lib/mod.rs (lib.rs) - root of library; creates the server.
    server_lib/server.rs (server.rs) - actual server code

The old server_lib/mod.rs is now server_lib/server.rs; server_lib/mod.rs is new.

This structure is easy to map onto a server implementation; unfortunately we can't get it exactly right here because of the limitations of cargo's examples/ folder.

* Rust2: Explain fully how to use the example code in your project.

* Added plaintext support

* Linting

* MGJ Markups
2017-12-08 18:42:14 +08:00
Benjamin Gill
a57fb0c7db [rust-server] add license and description to Cargo.toml (#7080)
* Move errant file to 'rust-server'

Rust2 was the old name

* Add license and description to Cargo.toml

For rust-server, getting them from the swagger

* Valid Java doesn't have uninitialised variables...

* Default license to "Unlicense"

* Set license to "Unlicense" for generated crates
2017-12-08 00:28:29 +08:00
Jinkui Shi
01b6330202 [Scala] [ISSUE-7085] Scala template code format refactor (#7086)
* [Scala] [ISSUE-7085] Scala template code format refactor

* upgrade scala version to 2.11.12 and upgrade dependency version
2017-12-08 00:20:19 +08:00
Max K
e75523a684 [AspNetCore SERVER] Added support for ASP.NET Core 2.0 (#7114)
* Updated to .NET Core 2.0

* Fixed issue with IConfiguration vs. IConfigurationRoot

* Ran bin/aspnetcore-petstore-server.sh

* Updated to .NET Core 2.0

* Fixed issue with IConfiguration vs. IConfigurationRoot

* Ran bin/aspnetcore-petstore-server.sh
2017-12-06 11:02:13 +08:00
Max K
645d71ed3b Operation now returns StatusCode Stubs as well (#7098)
* Operation now returns StatusCode Stubs as well

* Updated mustache file to use comments

return StatusCode(..) is now commented out.

* Change default(..) to not escape the type

default(dataType) --> default(&dataType)

* Return IActionResult no matter what..

* Updated formatting

* Ran bin/aspnetcore-petstore-server.sh
2017-12-05 22:14:00 +08:00
William Cheng
ffa0151445
fix msf4j return type annotation (#7110) 2017-12-05 17:23:04 +08:00
Sridhar-1987
a4fbbb5999 Pass optional as null (#7066)
* Pass optional as null

* Addressing review comments

* Addressing review comments-2

* Addressing review comments-3
2017-12-04 22:18:32 +08:00
wing328
55410a3d4a update spring petstore sample 2017-11-27 22:12:46 +08:00
Maxim Zinchenko
a8642dbdfc [Java][Spring][Server] Issue #4680 (#6890)
* Issue #4680 correct values for enum with escaped double quotes

* Issue #4680 regenerate samples

* Issue #4680 remove new lines

* Issue #4680 fixed scripts

* Issue #4680 update samples under CentOS
2017-11-27 18:30:39 +08:00
wing328
088eef5927 update petstore samples 2017-11-27 17:16:44 +08:00