Commit Graph

739 Commits

Author SHA1 Message Date
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
wing328
d9ee34e250 Update travis.yml to cover Java-related server stubs (#4992)
* update travis to cover more test cases

* update artifactid

* update artifactid for msf4j

* update pom for better test naming
2017-03-10 22:22:40 +08:00
pablograna
fb75996527 Make java spring controller constructor public. (#4972)
* Make java spring controller constructor public.

This lets users manually create the controller and inject the delegate in the
spring configuration file, instead of letting spring scan for controllers and
autowire the delegate.

* Ran spring-all-pestore.sh.
2017-03-09 23:11:44 +08:00
jfiala
871b3ceef7 update templates and samples for spring-boot #4719 (#4736) 2017-03-07 23:35:21 +08:00
jfiala
2f43f98cfa update beanvalidation templates and samples jersey2 #4719 (#4732) 2017-03-07 23:35:06 +08:00
jfiala
6a7340378a update beanvalidation templates + samples #4719 (#4733) 2017-03-07 23:34:40 +08:00
jfiala
1e8312782b [Jaxrs-spec] Merge beanValidation/beanValidationParams.mustache (#4731)
* update beanvalidation templates #4719

* update jaxrs-sample #4719
2017-03-07 23:26:30 +08:00
dhuning
6ea3315b3e Implicit headers for SpringCodegen (#4858)
* Add a new option implicitHeaders with default false

* Change JavaSpring templates and codegen to handle implicit headers

* Add script to generate sample for implicitHeader option

* Add generated implicitHeader sample

* Fix alignment
2017-03-07 14:54:15 +08:00
Paŭlo Ebermann
a710149cdd Fix #4898 for jaxrs (#4918)
* fix #4898 for JavaJaxRS (including all libraries).

* Updated samples for jaxrs (after fix for #4898).
2017-03-06 20:04:31 +08:00
Paŭlo Ebermann
6c9b0ce257 Update samples for Scalatra after 2.2.2. (#4910)
* Update samples for Scalatra after 2.2.2.

* [scalatra] Revert changes to build.sbt

Changes were made in conjunction with the new finch generator. This
reverts those changes to Scalatra's previous build.sbt.

* Update scalatra samples again after revert of part of #3905.
2017-03-06 14:23:02 +08:00
Tony Tam
b9d9629a65 Merge pull request #4925 from jfiala/cxf_swagger-core_4924
[Jaxrs-cxf] Fix compile errors after update of swagger-core / add jackson dependencies to pom #4924
2017-03-05 10:31:02 -08:00
Johannes Fiala
f72340fb17 change jackson jaxrs version to 2.8.4 #4924 2017-03-05 19:17:27 +01:00
Paŭlo Ebermann
7b559b4422 Update samples for MSF4J after 2.2.2. (#4915) 2017-03-06 01:12:29 +08:00
Tony Tam
15a0bf5df5 Refactor nodejs generated code structure (#4909)
* read directly from templates

* refactor nodejs structure

* dont inject into global scope

* move to 2 spaces consistently
2017-03-06 01:10:01 +08:00
Paŭlo Ebermann
a91cbbe387 Update samples after 2.2.2 (#4901)
* Update petstore samples for Groovy.

* Update samples for JaxRS.

* Update samples for cpprest.

* Update samples for dart.

* Update samples for flash.

* Update samples for go.

* Update samples for html2.

* Update samples for lumen.

* Update samples for nancxfx.

* Update samples for objc.

* Update samples for sinatra.

* Update samples for tizen.

* Update samples for java-inflector.
2017-03-06 00:33:57 +08:00
Johannes Fiala
165076a427 add jackson dependencies to pom #4924 2017-03-05 17:30:17 +01:00
wing328
061f4d07d8 fix issue with pom dep in jaxrs jersey1 (#4904) 2017-03-03 22:25:59 +08:00
Bart Kummel
30c2b6f262 Improved ExampleGenerator (#4797)
* Improved ExampleGenerator:

- Now takes into account enum and uri/url formats for strings.
- Uses example for referenced objects if available.
- Proper examples get generated for specific numeric formats, because more specific formats now get checked before generic format.
- Honors min and max values for numerical properties, if set.

* Ran script `bin/nodejs-petstore-server.sh`.

* Renamed log to logger to conform to coding standard.
2017-03-03 18:38:19 +08:00
wing328
835c7c0e0c [PHP][Silex] use original path name for path variable naming (#4817)
* use original path name in php silex

* fix path variable naming by camelizing the name
2017-03-03 16:49:00 +08:00
wing328
6c63558acc better python flask readme (#4844) 2017-03-03 16:45:43 +08:00
Paŭlo Ebermann
88c9b6062d Fix for #1219 (#4875)
* Update spring samples with current code.

This is done so I can see my own changes better.

* Regenerate samples after 2.2.2.

* use baseName instead of paramName for spring annotations.

* update spring petstore samples to show the effects.
2017-03-03 16:35:12 +08:00
Paŭlo Ebermann
0dab200f28 Update spring samples with current code. (#4874)
* Update spring samples with current code.

This is done so I can see my own changes better.

* Regenerate samples after 2.2.2.
2017-03-03 16:34:07 +08:00
Tony Tam
b43b3771b1 rebuilt 2017-03-01 14:14:52 -05:00
wing328
9e40700478 update jackson dependency and fix closing xml tag in jaxrs pom 2017-03-02 02:16:13 +08:00
wing328
f15267c717 add missing dependency to jaxrs pom 2017-03-02 01:56:27 +08:00
Tony Tam
655ba95b94 rebuilt 2017-03-01 10:04:39 -05:00
Tony Tam
4499a3c74c rebuilt 2017-03-01 10:02:42 -05:00
Tony Tam
40da4769b0 rebuilt 2017-03-01 10:01:50 -05:00
Tony Tam
89168d5e89 rebuilt 2017-03-01 09:59:27 -05:00
Tony Tam
9aeedca4c3 rebuilt 2017-03-01 09:58:53 -05:00
Tony Tam
c9c9d9a258 rebuilt 2017-03-01 09:58:17 -05:00
Tony Tam
2cec6192a4 rebuilt 2017-03-01 09:57:38 -05:00
Tony Tam
af2749325d rebuilt 2017-03-01 09:56:42 -05:00
jfiala
de727d7d60 [JaxrsResteasy] Improvements for Resteasy for Jboss EAP 4512 (#4712)
* add language for resteasy eap #4512

* first implementation of jaxrs-resteasy-eap #4512

* add support for joda and java8 datetime types #4512

* add new file JacksonConfig and new sample eap-joda #4512

* add dynamic swagger support to jaxrs-resteasy-eap #4512

* adapt readme for eap #4512

* add tests for jaxrs-resteasy-eap #4512

* cleanup tabs #4512

* cleanup tabs #4512

* cleanup tabs #4512

* cleanup tabs / regenerate without joda #4512

* regenerate with updated templates #4512

* fix test (wrong setter invoked) #4512

* fix test #4512

* fix no invocation #4512

* replace tabs with spaces #4512
2017-03-01 00:20:35 +08:00
gcernier
09e2bbe1ee Fix of #3371, to have a correct @ApiResponse's response type.
@ApiResponse's 'response' property now refers to its relative 'baseType', if defined.
2017-02-15 17:18:32 +01:00
clasnake
ee23f8e50c Fix finch package name. (#4755) 2017-02-13 22:33:55 +08:00
wing328
acd10318f7 Merge remote-tracking branch 'origin' into sync_master_230 2017-02-10 23:31:36 +08:00
wing328
beadd6d740 update java server stub samples with new uuid mapping 2017-02-08 16:39:02 +08:00
wing328
bdf6957c08 update jaxrs spec petstore sample (mac) 2017-02-08 01:07:18 +08:00
jfiala
e9823a81a5 [Jaxrs-spec] fix usage of Jersey templates in shellscript (#4722)
* remove jersey templates #4720

* regenerate sample with jaxrs-spec templates #4720
2017-02-08 00:41:36 +08:00
wing328
c0fc66ebec Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-02-06 15:33:11 +08:00
wing328
509a156879 Merge branch 'jaxrs_beanval_final_4091' of https://github.com/jfiala/swagger-codegen into jfiala-jaxrs_beanval_final_4091 2017-02-06 15:13:03 +08:00
Markus
4900427bf5 [JAXRS-CXF] Issue 4569 - Re-added usage of contextPath in api.mustache (basePath) (#4580)
* jaxrs-cxf: Re-added usage of contextPath in api.mustache (basePath)

* jaxrs-cxf: Added useAnnotatedBasePath and generateNonSpringApplication flags

 * useAnnotatedBasePath=true uses the @Path annotation in the generated interface to set the basePath, default is false

 * generateNonSpringApplication=true generates a web.xml with CXFNonSpringJaxrsServlets. If useAnnotatedBasePath=true only one servlet will be created, otherwise one for each API

* jaxrs-cxf generateNonSpringApplication: removed creation of multiple servlets

Multiple servlets were generated if useAnnotatedBasePath was false.
This is not necessary as there is only ONE basePath per contract

* jaxrs-cxf: added sample generation for useAnnotatedBasePath and generateNonSpringApplication
2017-02-06 14:11:41 +08:00
jfiala
38c879683a [Jaxrs-cxf-cdi] Add beanvalidation annotations updated (#4615)
* add check for hideGenerationTimestamp #4091

* update generated sample with no generated timestamps #4091

* add beanvalidation to jaxrs-cxf-cdi #4091

* add beanvalidation to jaxrs-cxf-cdi #4091

* update crlf

* replace tabs

* add check for hideGenerationTimestamp #4091

* update generated sample with no generated timestamps #4091

* add beanvalidation to jaxrs-cxf-cdi #4091

* add beanvalidation to jaxrs-cxf-cdi #4091

* update crlf

* replace tabs

* re-generate samples after rebasing #4091

* fix handling of inner enum templates #4091

* fix InputStream/Multipart imports and fileInputStream variable #4091

* fix paramName for files #4091

* consolidate beanValidationParams #4091

* add paramNameDetail #4615

* fix indentation and regenerate samples #4615

* reset samples jaxrs-spec to master

* update generated samples

* adapt Min/Max/DecimalMin/DecimalMax handling for int/long/else

* add ModelApiResponse
2017-02-06 00:55:30 +08:00
Markus
a83f8d0449 [JAXRS-Spec|Resteasy|CXF] Issue 4315 - Fixed bug generating arrays of enums (#4582)
* jaxrs-cxf: Fixed returning of enum arrays generating non-compiling code

* jaxrs-spec/resteasy: Fixed returning of enum arrays generating non-compiling code

* jaxrs-cxf: Switched to petstore-with-fake-endpoints-models-for-testing.yaml contract for sample generation

 * Fixed escape char issue in ApiOperation summary
 * Fixed code generation for non String-type enums
 * Fixed @PATCH annotation import

* jaxrs-spec: Switched to petstore-with-fake-endpoints-models-for-testing.yaml contract for sample generation
2017-02-05 23:01:18 +08:00
eamon316
23aee52bcd Feature/4606 (#4607)
* Issue #4606 (Spring) SubClass annotations are missing from the base class

* Issue #4606 (Spring) SubClass annotations are missing from the base class
   * Commit updated samples from ./bin/spring-all-pestore.sh
2017-02-03 22:30:32 +08:00
Matan Rubin
8042f5ca3e [JAXRS-CXF] [issue #4386] add builder-style methods to model classes (#4468)
* [JAXRS-CXF] [issue #4386] add builder-style methods to model classes

before this change, model classes had only a default constructor and
setter methods, resulting in code like this:

    myModel = MyModel();
    myModel.setFirstField(firstField);
    myModel.setSecondField(secondField);
    return myModel;

this change adds builder style methods, such that the above code can be
written more compactly:

    return MyModel().firstField(firstField).secondField(secondField);

this is consistent with other JAVA generators in swagger-codegen.

* update jaxrs-cxf sample code
2017-01-31 23:07:12 +08:00
wing328
ae8a123484 [WIP][Scala] Finch generator (#3905)
* Feature/objc tasks 2.3.0 (#3522)

* change api and ApiClient to return cancellable NSURLSessionTasks instead of NSNumber

* define a configuration protocol for custom configurations, which can be passed to api clients instead of a global configuration, provide a default implementation with a singleton option

* integrate a workaround for a current JSONModel concurrency bug

* update to new ISO8601 pod

* add missing call to super

* integrate new templates into codegen

* updates documentation templates

* updates petstore objc generated code

* fixes objc client tests

* [ObjC] Add version define and share default headers of each client

* add finch generator and resource

* update license, add errros

* Fix problem with multitheard api client

* fix some errors for finch

* [finch] Remove license header

* [finch] Remove finatra stuff, fix a few issues

* WIP: Finch server generator

* [finch] WIP: server generator impl

This puts parameters (input/output) in the right format. Currently, this
is done in the generator class using vendorExtensions, but should be
refactored to imported templates to clean up.

Previous commits of the server generator output to appropriate
models/api directories. I've made no changes to this logic, but code
currently generates to the root scala package directory. This will need
to be fixed.

There's also an issue with circe's and Option[Date] in the Order type.
This issue will need to be resolved. As well, there's some unused
imports to clean up.

Initial implementation lacks support for custom imports, type mappings,
etc.

* [finch] Update api/model package and imports

* [finch] Explicit import/type mappings

* [finch] Regenerate example
2017-01-29 12:15:39 +08:00
wing328
a45579d35e fix issue with pom.xml (spring cloud, boot) 2017-01-27 00:39:25 +08:00
jfiala
8952815b5f [Spring] Add beanvalidation annotations (#4600)
* update generated sample for spring boot #4091

* add beanvalidation annotations to spring #4091

* add tests for spring #4091

* cleanup spring-cloud (client lib) #4091

* update client sample spring-cloud #4091

* replace tabs

* add beanvalidation annotations to spring #4091

* add tests for spring #4091

* cleanup spring-cloud (client lib) #4091

* update client sample spring-cloud #4091

* replace tabs

* update spring-cloud sample
2017-01-26 23:45:36 +08:00
wing328
658b650285 Merge branch 'master' of https://github.com/karnik/swagger-codegen into karnik-master 2017-01-26 16:30:51 +08:00
Tony Tam
ecaa8b1ede tests, fix for #4647. Proper escaping project name per npmjs (#4648) 2017-01-25 17:08:54 +08:00
Jonathan Leitschuh
78f38f1a1f Add support for read-only values in spring model (#4629) 2017-01-25 16:34:55 +08:00
Johannes Fiala
c0bea5ead9 move beanvalidation code to AbstractJavaJAXRSServerCodegen.java #4091 2017-01-23 21:18:01 +01:00
Jonathan Leitschuh
36c3fa05e0 Allows for generation of spring controller code using the delegate pattern (#4439)
* Allows for generation of spring conroller code using the decorator pattern

* Change Decorator to Delegate in spring codegen
2017-01-19 17:58:39 +08:00
jfiala
6f4e82dc03 [Jaxrs-Resteasy] Add beanvalidation annotations (#4506)
* add beanvalidation to jaxrs-resteasy #4091

* replace tabs
2017-01-19 17:45:17 +08:00
wing328
157fcbc4aa fix invalid spec, update petstore samples (jaxrs, ruby) 2017-01-19 16:54:16 +08:00
wing328
5f1b11827a Merge branch 'master' into master 2017-01-19 16:03:15 +08:00
wing328
a8afaa8f77 remove /r from templates 2017-01-19 15:53:51 +08:00
wing328
ccecc2aac0 new file for jaxrs jersey1 2017-01-19 15:31:24 +08:00
wing328
1ae60b1f61 Merge branch 'jaxrs_jersey_beanval2' of https://github.com/jfiala/swagger-codegen into jfiala-jaxrs_jersey_beanval2 2017-01-19 15:30:54 +08:00
jfiala
ee7f9fc56c [Jaxrs] Add beanvalidation annotations and fix outer Enums (#4492)
* add beanvalidation to jaxrs and add support for outer Enums #4091

* cleanup Codegen #4091

* cleanup samples #4091

* cleanup tabs

* updated samples to petstore.yaml (before petstore.json)

* add support for DecimalMin/DecimalMax/Min/Max #4091

* add check for hideGenerationTimestamp #4091

* replace tabs

* correct line endings to lf
2017-01-19 15:13:11 +08:00
Jim Schubert
da6b57f3fc [aspnetcore] use default in model constructors, supports enums (#4573)
* [aspnetcore] Use default rather than null in ctor

See original issue #3608

This adds same model constructor logic to aspnetcore as what was added
to csharp generator by PR #4145.

This doesn't include NancyFX because model construction relies more on
object initialization in that generator.

* [aspnetcore] ctor defaults + enum support

This follows up to #4145, and modifies model constructors to use
default(x) instead of initializing to nulls. default(x) works in all
cases using intuitive default values it is intended to support.

Example:

  csharp> public enum Color { RED = -1, BLUE = 0, GREEN }
  csharp> var color = default(Color)
  csharp> color
  BLUE

In the above example, The default of BLUE=0 is expected. For nullable
enums, this would be null as a default.

The aspnetcore generated code is also updated to support enums and
nested enums to account for changed to the petstore.yaml used to
generate the sample.

* [aspnetcore] Regenerate sample
2017-01-18 16:43:12 +08:00
Dan Mikita
0a559f0dd2 Add support for modifier within the Jaxb XMLElement annotation (#4433)
* fixes #4432 Adding support for the  modifier within the Jaxb XMLElement annotation. Updated README with JaxbAnnotations configuration option.

* #4432 Running the Petstore files
2017-01-17 15:26:30 +08:00
Articus
4001503e63 PHP server generator ze-ph (Zend Expressive + Path Handler) (#4559)
* Server generator ze-ph (Zend Expressive + Path Handler)

* Command line scripts for new ze-ph generator
2017-01-16 01:05:04 +08:00
Yuta HIGUCHI
de5ea8a9d6 [JAX-RS/jersey2] Fix for incorrect JSON field name capitalization (#4458)
* Fix for all capital field name

* Cosmetic: remove trailing spaces

* Adding ./bin/jaxrs-petstore-server.sh output.
2017-01-10 23:37:25 +08:00
J. Fiala
6b17b92bb6 add check for isInteger (integer/decimal) 2017-01-06 16:46:59 +01:00
J. Fiala
5b532fd10e update language jaxrs (Jersey2) and samples 2017-01-06 15:16:39 +01:00
J. Fiala
dde24eb9c2 update jaxrs jersey1 templates and sample output #4091 2017-01-06 15:10:40 +01:00
Kevin Locke
df0c54d043 Support the empty string as an enumeration value (#4450)
When a string enumeration has the empty string as one of its available
values, the generated code for many languages is invalid because the
empty string can not be used as an identifier.  As with numbers and
symbols, provide a mapping to an English name which can be used as a
replacement.  In this case, "empty" for the empty string/empty value.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2017-01-06 19:30:47 +08:00
Simon Morris
aa1dc0fdd2 Updated Nancy from 1.4.1 to 1.4.3 (#4482) 2017-01-06 01:09:32 +08:00
William Cheng
ce899e3776 Merge remote-tracking branch 'origin/master' into 2.3.0
Conflicts:
	appveyor.yml
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractTypeScriptClientCodegen.java
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java
	modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache
	modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
	modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache
	modules/swagger-codegen/src/main/resources/go/api.mustache
	modules/swagger-codegen/src/main/resources/objc/api-body.mustache
	modules/swagger-codegen/src/main/resources/objc/api-header.mustache
	modules/swagger-codegen/src/main/resources/typescript-angular2/configuration.mustache
	modules/swagger-codegen/src/main/resources/typescript-angular2/tsconfig.mustache
	modules/swagger-codegen/src/test/java/io/swagger/codegen/swift/SwiftModelTest.java
	modules/swagger-codegen/src/test/java/io/swagger/codegen/swift3/Swift3ModelTest.java
	modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ModelTest.java
	samples/client/petstore-security-test/typescript-angular2/configuration.ts
	samples/client/petstore/go/go-petstore/docs/FakeApi.md
	samples/client/petstore/go/go-petstore/fake_api.go
	samples/client/petstore/go/go-petstore/pet_api.go
	samples/client/petstore/java/feign/pom.xml
	samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
	samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java
	samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/RFC3339DateFormat.java
	samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java
	samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java
	samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java
	samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
	samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java
	samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java
	samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java
	samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java
	samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java
	samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java
	samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h
	samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m
	samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h
	samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m
	samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h
	samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m
	samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h
	samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h
	samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h
	samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m
	samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h
	samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m
	samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h
	samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m
	samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h
	samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h
	samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONResponseSerializer.h
	samples/client/petstore/qt5cpp/client/SWGPetApi.h
	samples/client/petstore/qt5cpp/client/SWGStoreApi.h
	samples/client/petstore/qt5cpp/client/SWGUserApi.h
	samples/client/petstore/typescript-angular2/default/configuration.ts
	samples/client/petstore/typescript-angular2/npm/README.md
	samples/client/petstore/typescript-angular2/npm/configuration.ts
	samples/client/petstore/typescript-angular2/npm/package.json
	samples/client/petstore/typescript-angular2/npm/tsconfig.json
	samples/client/petstore/typescript-fetch/builds/default/api.ts
	samples/client/petstore/typescript-fetch/builds/es6-target/api.ts
	samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts
	samples/client/petstore/typescript-fetch/tests/default/test/PetApiFactory.ts
	samples/client/petstore/typescript-fetch/tests/default/test/StoreApiFactory.ts
	samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java
	samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java
	samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java
	samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java
	samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java
	samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java
	samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java
2017-01-05 17:44:39 +08:00
Johannes Fiala
1a1d0aebc8 add beanvalidation to jersey1 and jersey2 #4091 2017-01-04 17:36:28 +01:00
mkarnik
45002ec1fd [JAX-RS RESTEasy][issue #4447] Updated RESTEasy petstore samples 2016-12-23 10:37:17 +01:00
wing328
aed21bba73 better code format for nodejs server (#4411) 2016-12-23 02:05:10 +08:00
Jun Mukai
27f1b6ee98 Introduce NodeJS codegen for Google Cloud Functions. (#4406)
* Another approach: extending NodeJS server to support GCF.

This does not add a new language, but adding some client options
to support Google Cloud Functions (GCF).

* Add URLs for how to deploy the generated code.

Adds the client options help message and the README.md file.
2016-12-22 23:11:52 +08:00
Johan Nystrom
ff70105484 Fix CSV collection parameter issues for scalatra server (#4426)
* Fix scalatra handling of CSV query parameters

* Ran petstore for scalatra server
2016-12-20 16:02:45 +08:00
Matan Rubin
5867728724 [JaxRS-CXF][bug #4330] support containers in return types (#4339)
* [JaxRS-CXF][bug #4330] support containers in return types

before this commit if a method returned a container (List or Map) of
THING (i.e. List<THING> or Map<String, THING>) the generated return type would
drop the container and only leave THING.
this commit fixes this issue such that the container type is properly
generated.

* regenerate jaxrs-cxf petstore sample
2016-12-14 13:58:56 +08:00
cbornet
bcc7e69fcc [Flask] Add packaging support 2016-11-23 18:40:37 +01:00
wing328
44ca30df63 Merge pull request #4215 from cbornet/flask_param_name
[Flask] fix parameter naming
2016-11-23 15:42:42 +08:00
wing328
474dae08cf update NodeJS readme to remove oudated doc (#4232) 2016-11-22 10:42:15 +08:00
cbornet
9322c8fb0e [Flask] fix parameter naming 2016-11-20 11:21:09 +01:00
Christophe Bornet
df15799839 [Flask] Add generated tests (#4209) 2016-11-19 16:31:31 +08:00
jfiala
b02d505ad9 Refine CXF Add Spring Annotation-Config + Jboss flag for CXF/Resteasy + fix OuterEnum (#4164)
* add json annotations

* add cli flag to check for jaxb annotations

* add CLI-flag for switching Spring-XML or annotation config #4088

* add cli flag for generating jboss depl. descriptor #4088

* add JbossFeature CLI flag to Resteasy #4088

* update/add tests #4088

* cleanup tabs #4088

* improve api formatting #4088

* refine formatting #4088

* refine formatting again #4088

* add separate CLI-flags for controlling junit test features #4088

* add json annotations

* add cli flag to check for jaxb annotations

* add CLI-flag for switching Spring-XML or annotation config #4088

* add cli flag for generating jboss depl. descriptor #4088

* add JbossFeature CLI flag to Resteasy #4088

* update/add tests #4088

* cleanup tabs #4088

* improve api formatting #4088

* refine formatting #4088

* refine formatting again #4088

* add separate CLI-flags for controlling junit test features #4088

* add check for void methods + assertNotNull(response) #4088

* add spaces for @Produces #4088

* allow build with no web.xml config #4088

* comment invocations of tests #4088

* update petstore sample jaxrs-cxf server with gen/java first #4088

* re-generate jaxrs-cxf with src/gen/java #4088

* add client jaxrs-cxf #4088

* add switch to load SwaggerUI automatically #4088

* update to CXF 3.1.8 including supportSwaggerUi flag #4088

* update to cxf 3.1.8 and swagger-core 1.5.10 #4088

* update generated petstore for jaxrs-cxf #4088

* change Spring Boot urls to root #4088

* fix spring xml config #4088

* fix external enum usage for jaxrs-cxf #4160

* cleanup jaxrs-annotations in impl class

* fix handling of multiparts #4088

* fix @Min/@Max comments in beanValidationQueryParams #4088

* add swagger-codegen-ignore file+add src/test/resources #4088

* add cli-flag for produces/consumes json in api #4088

* add test case for outerEnum #4160
2016-11-19 16:09:13 +08:00
wing328
cde24f1113 Merge pull request #4189 from cbornet/spring_cloud_operations
[Spring] Use tag operation grouping for spring-cloud
2016-11-18 16:51:36 +08:00
wing328
359e52b173 Merge pull request #4188 from cbornet/flask_operations
[Flask] Use x-swagger-router-controller in for operation routing
2016-11-18 14:23:45 +08:00
Nick Maynard
b7e9603e63 jaxrs-cxf-cdi :: Add a basic JAX-RS Application and CDI fixes (#4196)
* Add a basic JAX-RS Application and CDI fixes

* jaxrs-cxf-cdi :: Fix samples generation template dir

* jaxrs-cxf-cdi :: Regenerate samples

* jaxrs-cxf-cdi :: Clean up some checkstyle warnings
2016-11-18 14:00:53 +08:00
wing328
3d476debaf Merge pull request #4178 from cbornet/flask
[Flask] Add models support to Flask Connexion codegen
2016-11-18 13:56:59 +08:00
cbornet
1e6cab8a03 [Flask] Use x-swagger-router-controller in swagger.yaml for operation routing
Fix #4106
2016-11-17 19:21:05 +01:00
cbornet
e5daa6855c add models support to flask 2016-11-17 18:30:59 +01:00
wing328
88227e08e3 Remove Apache license from server stub generators (#4200)
* remove php apache license

* remove license in sample code, update nodejs to use unlicnese

* remove license from jaxrs generator

* remove license from server generator

* update pom.xml for jaxrs resteasy joda server
2016-11-17 00:37:21 +08:00
cbornet
4a196a9187 [Spring] Use tag operation grouping for spring-cloud
Instead of basepath based grouping that is used by Spring boot/MVC
2016-11-15 18:46:48 +01:00
wing328
255bc02b83 Merge remote-tracking branch 'origin/master' into 2.3.0 2016-11-09 16:37:11 +08:00
wing328
cce410c463 add vendor extension to handle void response in jaxrs-cxf 2016-11-08 21:06:38 +08:00
wing328
46c4eb3869 update mxf4j sample 2016-11-07 23:54:47 +08:00
wing328
e78ce6fb1e Merge pull request #4059 from markus-wa/issue-4045
[JAXRS-CXF] Issue 4045 - Fixed enum marshalling & fromValue()
2016-11-07 23:42:29 +08:00
wing328
636623d0e9 Merge remote-tracking branch 'origin/master' into 2.3.0 2016-11-04 19:17:35 +08:00
Christophe Bornet
70d93883cf [Java] Threetenbp dates support (#4029)
* [feign] add threetenbp support for feign clients

* [okhttp] add threetenbp support for okhttp clients

* [jersey] add threetenbp support for jersey clients

* [retrofit2] add threetenbp support for retrofit2 clients

* [spring] add threetenbp support for spring generators

* add a workaround in tests for a bug in the petstore

The petstore doesn't manage fractional digits of dates correctly when there are less than 3
2016-11-04 17:55:16 +08:00
Simon Morris
8fb33980dc Nancy fx work (#4107)
* Added switch to config to toggle use of yaml base path as module paths

* NancyFX template updated to return collections as array to allow framework to find views by type name for text/html mime type

* Added some more parser fixes for NancyFX

* Refactored collection parsers in Parameters.cs and changed some to return nullable collections to match the parameter mappings in AbstractCSharpCodegen

* re-ran petstore build
2016-11-02 21:35:01 +08:00
wing328
4eb75f8088 add back setter to spring model (readonly attr) 2016-11-02 15:40:00 +08:00
wing328
07c6fe9d0d Merge remote-tracking branch 'origin/master' into 2.3.0 2016-10-26 15:42:59 +08:00
wing328
983aec6250 add sample for java-msf4 2016-10-26 11:31:43 +08:00
Simon Morris
5855b479aa nancyfx basePath => modulePath toggle (#4053)
* fix NancyFX string parser

parser needs to access the Value parameter to enable the direct cast at line 102 when handling string parameters

* Updated nancyfx sample

* Added switch to config to toggle use of yaml base path as module paths
2016-10-24 23:07:16 +08:00
walthema
1e975637c9 Fixed enum marshalling & fromValue()
Added toString() to enums
2016-10-24 15:07:46 +02:00
wing328
af16601654 Merge remote-tracking branch 'origin/master' into 2.3.0 2016-10-22 23:08:36 +08:00
Simon Morris
27be0ed197 fix NancyFX string parser (#4048)
* fix NancyFX string parser

parser needs to access the Value parameter to enable the direct cast at line 102 when handling string parameters

* Updated nancyfx sample
2016-10-22 22:53:56 +08:00
wing328
91923311e0 update undertow readme 2016-10-19 16:23:18 +08:00
wing328
c7efb7000c Merge remote-tracking branch 'origin/master' into 2.3.0 2016-10-19 15:45:15 +08:00
wing328
702344ed75 better handling of reserved words for sintatra, dart 2016-10-18 17:58:19 +08:00
Jim Schubert
c70a2a7481 [aspnetcore] Deprecating aspnet5 for aspnetcore
This moves previous aspnet5 functionality to aspnetcore, aspnet5 now
derives from the aspnetcore generator and logs a warning that it's
deprecated.

This will help resolve any confusion because ASP.NET 5 is terminology
referring to the project of around a year ago. ASP.NET Core 1.0 is the
new name for the technology, and further enhancements should target .NET
Core 1.0 rather than any old vNext or preview stuff.
2016-10-16 21:22:34 -04:00
wing328
6ac9f0f351 Merge remote-tracking branch 'origin/master' into 2.3.0 2016-10-16 16:04:17 +08:00
cbornet
12a0fd6471 fix issues in spring templates
Wrong indentation and extra lines in api templates
Java8 default methods are used if dateLibrary is java8

Fix #3408
2016-10-14 17:57:20 +02:00