Commit Graph

4746 Commits

Author SHA1 Message Date
wing328
bfb4390a1c [TypeScript][Angular2] better code indentation, update Petstore sample (#4990)
* fix query parameter indentation, update ts angular2 sample

* update ts angular2 sample
2017-03-09 22:27:29 +08:00
baartosz
cffaaa027a minor improvements to Configuration php template (#4989) 2017-03-09 17:28:19 +08:00
wing328
4fe79f0078 Remove default format (JSON) from API operations (#4987)
* remove default format (json) and update ruby petstore

* update python petstore sample

* update php petstore sample

* update android petstore sample

* update java petstore sample

* update objc sample

* remove default format (json) from perl
2017-03-09 11:12:01 +08:00
wing328
b6d6356c46 remove default format (json) from c# api (#4980) 2017-03-08 22:43:59 +08:00
baartosz
d21e156071 [PHP] error when deserializing enums #4032 (#4886)
* fixed enum template; added enum handling to ObjectSerializer

* regenerated templates

* improved InvalidArgumentException message

* regenerated sample client

* added value check of OuterEnum during sanitization

* regenerated samples
2017-03-08 19:08:42 +08:00
Michael Kourlas
2bb7626202 [Java] Fix for issue #3365: Support for gzip compression (#4967)
* Fix for issue 3365 for Java

* Added tests

* Convert CRLF to LF

* Convert CRLF to LF in tests
2017-03-08 19:00:50 +08:00
wing328
89ad5e59b8 use convertPropertyToBooleanAndWriteBack in some generators (#4975) 2017-03-08 17:39:22 +08:00
wing328
5dbcf6e8e4 [JavaScript] fix issues with boolean CLI options (#4974)
* remove commented code

* fix issue with boolean clioption in js codegen
2017-03-08 16:57:29 +08:00
delenius
5935e2e6d9 Add support for saving/returning cookies (#4192)
This adds a `saveCookies` boolean flag to ApiClient. If set to true,
the client will save and return cookies to the server.

This is useful for supporting @SessionScoped beans in Java servers.
Works both in Node.js desktop apps, and in the browser.
2017-03-08 15:26:46 +08:00
Kyle Maxwell
3e3d360027 Add proxy support to fix #4639 (#4946)
* Add proxy support to fix #4639

* Update sample app for testing

* Fix indentation and remove leftover code

* Update sample for new rest template
2017-03-08 12:03:45 +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
jfiala
c4475861b0 update beanvalidation templates #4719 (#4734) 2017-03-07 23:26:06 +08:00
jfiala
6383872b5f update beanvalidation templates and sample for jersey2 #4719 (#4735) 2017-03-07 23:25:21 +08:00
Paŭlo Ebermann
404a9999a7 Fix (partially) #4898 for swift3 (#4916)
* fix (partially) #4898 for swift3.

* Update petstore samples for swift3 (after fix for #4898)
2017-03-07 17:28:08 +08:00
Paŭlo Ebermann
0f88e4a721 fix (partially) #4898 for MSF4J. (#4917) 2017-03-07 17:26:57 +08:00
wing328
913d05c17c [Python][Flask] Fix inconsistency between model name and file name (#4958)
* fix inconsistence between model name and file name in python flask

* add object as primitype type in python flask
2017-03-07 15:32:41 +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
Jacobo de Vera
7de1eeb987 [python] Triple quote strings with new lines in default values (#4941)
* Triple quote python strings in defaults

When the model contains a string with a default value with new lines in
it, simply quoting generates invalid python code. Using triple quotes
for all string defaults makes sure the generated code will be a valid
python string.

Fixes #4862

* Wrap default string in triple quotes when it contains new lines

* Add newly generated python sample files
2017-03-07 14:46:38 +08:00
Val Polouchkine
122194c30e Fix typo (#4956)
Authorizatoin should be Authorization
2017-03-07 13:49:42 +08:00
Egor Masalitin
722b96bcec In case if basePath equals to / we should not append it to url, behaviour was changed to fit this requirements (#4942) 2017-03-06 23:48:20 +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
wing328
f12554fd83 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-03-06 17:24:04 +08:00
wing328
0838c1a448 Merge branch 'topic/swagger_fix' of https://github.com/Daxten/swagger-codegen into Daxten-topic/swagger_fix 2017-03-06 17:20:42 +08:00
wing328
7782c32140 Merge branch 'fixqt5cppstaticlib' of https://github.com/fortiumant/swagger-codegen into fortiumant-fixqt5cppstaticlib 2017-03-06 15:44:24 +08:00
Zhanwei Wang
10950db2dd [JavaScript] Do not parse null and undefined as type. (#4933)
* [JavaScript] Do not parse null and undefined as type.

* update pet store example for #4932
2017-03-06 15:01:19 +08:00
Paul English
5d327e66a1 Port the optional/enum template logic from async-scala to the regular scala client (#4849)
* Port the optional/enum template logic from async-scala to the regular scala client

* oops, accidently pulled template from akka-scala which has custom logic for enum

Just going to avoid enum for now, considering I'm not sure what scala client
will be official

* Update tests to use option
2017-03-06 14:50:21 +08:00
Paŭlo Ebermann
e477ac9472 Fix #4898 for spring-cloud. (#4919)
Somehow I omitted this in #4875.
2017-03-06 14:47:52 +08:00
Matan Rubin
899ef8f1ef [JAXRS-CXF] [bug #4422] use java.util.Date when selecting dateLibrary=legacy (#4724)
according to the help message setting dateLibrary to 'legacy' should
make the code generator use java.util.Date.
before this change, when setting dateLibrary to 'legacy' made the
generator use javax.xml.datatype.XMLGregorianCalendar.
now, the generator uses java.util.Date such that the documentation and
behavior are consistent.
2017-03-06 14:25:15 +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
jsone-studios
7800641db2 Fixes #4913 (#4914) 2017-03-06 01:15:56 +08:00
Viktor Chukhantsev
35d3fb82ce [Ruby] Can only use content-type application/json with ruby-client #4867 (#4893)
* Fix ruby-client work with modern content types, like application/api.vnd+json

* Add specs.

* Fix regexp.

* Regenerate petstore client.
2017-03-06 00:44:15 +08:00
Johannes Fiala
165076a427 add jackson dependencies to pom #4924 2017-03-05 17:30:17 +01:00
Jonathan Leitschuh
66a510c9d3 Make the CodegenConfigurator serializable (#4890)
Closes #4887
2017-03-03 22:57:57 +08: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
Vlad Frolov
9516c81ebb [JavaScript] Added *WithHttpInfo methods in 'usePromises' mode to provide a way to get access to HTTP response object (e.g. headers or status code) (#3654) (#4902) 2017-03-03 18:20:52 +08:00
patulacci
e23a24c138 replaced SWG by classPrefix and ran tests (#4871) 2017-03-03 17:29:16 +08:00
Gábor Berényi
39a42d014b Feature/issue 4698 rxjava2 support (#4743)
* rx2 support

* NO_NOT_USE_RX is for internal use only; plus sanity check if both v1 and v2 are specified

* minor fixes

* one more small fix
2017-03-03 17:00:20 +08:00
wing328
dbe99c3af9 fix path variable in ts angular2 (#4756) 2017-03-03 16:59:23 +08:00
gigo1980
fa803d5cf5 Adjust Date ISO Dateformat for Query Parameters: ISSUE 4745 (#4812)
* Adjust Date ISO Dateformat for Query Parameters: ISSUE 4745

* Run Sample Model
2017-03-03 16:58:24 +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
Hamed Ramezanian Nik
b894dc3827 Encode form paramerers properly\n (#4836)
Superagent doesn't encode form parameters properly. For example it doesn't encode objects which contain array. The following is a failed test case:
var my_opts = {
  'storyId': 65441,
  'id': [56, 352]
};
2017-03-03 16:48:11 +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
Alexej Haak
195ff25f43 fixes progress for file upload with alamofire / swift3 2017-03-02 17:16:10 +01:00
Oliver Trosien
55b64fcbfd Remove maven-api dependencies on swagger-codegen module (#4840)
* Remove maven-api dependencies

* Use org.apache.commons.lang3.StringUtils
2017-03-02 18:05:21 +08:00
Bartek Kryza
1b1767e489 [Bash] Bugfix default curl options fix (#4832)
* Fixed default cURL parameter handling

* Fixed iterator increments in JSON body Bash generator

* Added tests for content type and default cURL params

* Fixed generated Dockerfile Bash script access rights

* Generated test sample client

* Updated Bash generator README
2017-03-02 17:48:30 +08:00
wing328
775f108d4e update version to 2.2.3-SNAPSHOT (#4894) 2017-03-02 16:54:37 +08:00
baartosz
26257daec3 fixed ApiException's methods return types (#4845) 2017-03-02 16:45:42 +08:00
Tony Tam
8504c12ce0 update to release versions 2017-03-01 14:22:34 -05:00
Tony Tam
b941fcfdb6 remove timestamp 2017-03-01 14:14:30 -05:00
Tony Tam
a27a76adf4 fixed missing dep 2017-03-01 13:21:14 -05:00
wing328
f15267c717 add missing dependency to jaxrs pom 2017-03-02 01:56:27 +08:00
Tony Tam
894f272f89 updated core versions 2017-03-01 08:51:18 -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
Antoine Kurukchi
471598359a Added include to qt5cpp to fix library compile
While creating a static library from the generated files, compilation issues arose due to QDateTime only being forward declared. Adding the include resolves the issue.
2017-02-22 09:53:43 +00:00
wing328
d11d0f88bb fix warning in swagger json/yaml generator (#4827) 2017-02-20 16:51:31 +08:00
jsone-studios
6746632834 Fix for #1940 - Show response headers (#4825) 2017-02-20 16:18:09 +08:00
Tristan Sokol
23d114e1eb Fix minor spelling mistake in readme (#4818) 2017-02-20 15:13:06 +08:00
wing328
bb81fc130a remove unused files for nodejs gcf (#4808) 2017-02-16 17:39:06 +08:00
Paul English
accd176382 Ensure that ApiInvoker.scala can support UUID types (#4807) 2017-02-16 17:00:26 +08:00
Adnan Baruni
24474126e1 Issue 4742 (#4763)
* add boolean datatype flags to CodegenResponse and logic to set them in DefaultCodegen

* use Boolean.TRUE.equals to check for isResponseBinary or isResponseFile
2017-02-14 14:20:13 +08:00
clasnake
ee23f8e50c Fix finch package name. (#4755) 2017-02-13 22:33:55 +08:00
Igor Khomenko
7df1f8e200 Update DefaultGenerator.java (#4760) 2017-02-13 20:59:36 +08:00
Sreenidhi Sreesha
9cf147f215 [Java] Change Boolean fields of CodegenParameter and CodegenResponse to boolean. (#4747)
CodegenOperation and CodegenProperty classes have boolean fields instead of Boolean.
This fix changes Boolean fields of CodegenParameter and CodegenResponse to boolean as well.

Boolean fields are not necessary. Other classes interacting with them have to check for null
before interacting with them which is unnecessary and leads to ugly code.
2017-02-13 19:45:42 +08:00
wing328
8f2e9bce6d remove trailing whitespaces in java api client (#4784) 2017-02-13 18:53:34 +08:00
Clem
74da89c6ac Fix issue when the swagger model contains an 'Object' class (#4695)
If the swagger model contains a class named 'Object' some mustache templates
will generate non compiling **Java** code.
2017-02-13 18:07:00 +08:00
BastiOfBerlin
a956966ff2 Update gitignore (#4767)
ignore dist folder
2017-02-13 18:03:48 +08:00
Tony Tam
8fa2ef8ec2 merged 2017-02-09 13:17:22 -05:00
wing328
ef31efe8d9 remove default temp folder during initalization (#4749) 2017-02-09 12:22:13 +08:00
Jan
0d14496bd6 [Java-retrofit] Fix for #4750 String comparison with equals (#4751)
* [Java-Feign] Fixed String comparison using equals instead of == operator

* [Java-Feign] Updated ApiClient with ./bin/java-petstore-feign.sh

* [Java-retrofit] Fix for #4750 String comparison with equals
2017-02-08 21:54:56 +08:00
wing328
d91135ec8f Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-02-08 17:00:01 +08:00
wing328
7998a30b92 Merge branch 'uuid-type' of https://github.com/MatanRubin/swagger-codegen into MatanRubin-uuid-type 2017-02-08 16:02:27 +08:00
Jan
2179b44413 [Java-Feign] Fixed String comparison using equals instead of == operator (#4740)
* [Java-Feign] Fixed String comparison using equals instead of == operator

* [Java-Feign] Updated ApiClient with ./bin/java-petstore-feign.sh
2017-02-08 15:56:40 +08:00
Bartek Kryza
73395bce44 [Bash] Bash generator improvements (#4730)
* Removed trailing spaces

* Fixed autocomplete support for bash-completion < 1.4

* Added mime type autocomplete for Zsh

* Fixed Bash url autocompletion

* Fixed Zsh space after operation arguments and added trim to descriptions

* Added generation of Dockerfile for packaging Bash rest clients

* updated test samples for Bash client generator
2017-02-07 23:15:05 +08:00
Matan Rubin
1339222bbc [Java][Issue #1806] generate using java.util.UUID for UUIDs
Before this change if a model had a property of type=string and
format=uuid, it would be generated as a Java String.
Now, it generates the property as java.util.UUID.
2017-02-07 13:38:20 +02:00
wing328
a123dd7ef1 Revert "rx2 support" (#4737) 2017-02-07 17:52:47 +08:00
Gábor Berényi
d12f428f42 rx2 support (#4708)
* rx2 support

* NO_NOT_USE_RX is for internal use only; plus sanity check if both v1 and v2 are specified
2017-02-07 17:44:22 +08:00
Jim Schubert
96b0d155b5 [csharp] Fix enum default value (#4681)
* [csharp] Prevent enum assign to string

see swagger-api/swagger-codegen#4670

* [csharp] Regenerate client sample
2017-02-06 17:33:10 +08:00
Joshua Helm
b891a4a4cf fix issue #4672 - XmlExampleGenerator does not properly handle properties of several numeric types (#4673)
* fix issue #4672 and bring XML default example values in-line with ExampleGenerator

* converted tabs to spaces
2017-02-06 17:30:29 +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
a52a84a7d7 [Jaxrs-cxf-cdi] merge beanvalidation templates to single one #4719 (#4723)
* merge beanvalidation templates to single one #4719

* add beanValidationCore #4723
2017-02-06 14:03:26 +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
Johannes Herrnegger
95a8192c25 [Typescript-Angular2] Fixes #4703 (#4704)
* fix issue #4703

* run petstore
2017-02-04 13:00:26 +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
asgerjensen
4ba0ea9dc5 fix(jax-rs): fix package name in generated StringUtil.java to match where file is generated (#4677) 2017-02-03 21:46:29 +08:00
wing328
5282987851 [Python] update python requirement.txt and use single quote for safe characters (#4702)
* update python requirement

* update petstore sample
2017-02-03 21:35:40 +08:00
Jon Hartlaub
c366f139e2 ISSUE#4391 - https://github.com/swagger-api/swagger-codegen/issues/4391 (#4392)
This change removes '/' from the set of "safe" characters for the python urllib quote function.

When using PathParams containing a '/' character, the Python client does not encode the '/'. As a result, the / is interpreted as a path separator rather than a parameter value. PathSegments must encode the / character for proper transfer of information. e.g. 'my/string' should be encoded to 'my%2Fstring' for correct transmission of a PathParam argument. Path separators must only be used between path segments.
2017-02-03 19:24:15 +08:00
wing328
695417699c Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-02-03 18:59:25 +08:00
wing328
db2d9df5ea Merge branch 'php-client-invokerpkg-fix' of https://github.com/toomuchpete/swagger-codegen into toomuchpete-php-client-invokerpkg-fix 2017-02-03 18:44:05 +08:00
David Biesack
d1766e3fdf Fix Issue #4611 by using {{unescapedDescription}} (#4641)
* Use {{unescapedDescription}} in html, html2

This addresses https://github.com/swagger-api/swagger-codegen/issues/4611
Replace {{description}} with {{unescapedDescription}}

This is an improvement but because of issue #1203 and/or #3436 (fix not
yet impleented), Markdown is not being processed and converted to HTML.

* Add generated petstore samples index.html

* Copy unescapedDescription
2017-02-03 17:46:11 +08:00
Jim Schubert
9032b8c1f8 [aspnetcore] resolve source/packageName issues (#4699)
Outputs warnings about ASP.NET Core's src/ requirement, and adjusts
sourceFolder if the input doesn't start with src/.

As a consequence of this change, apiFileFolder and modelFileFolder may
possibly return different values if users are setting both sourceFolder
and packageName. This could be considered a breaking change in those
sceanrios.
2017-02-03 16:25:56 +08:00