Commit Graph

4926 Commits

Author SHA1 Message Date
wing328
bd81dfd08e use base name for parameters in the curl command (#5173) 2017-03-23 14:51:00 +08:00
wing328
264c9d615f use unescaped path in server stub templates (#5157) 2017-03-23 11:59:04 +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
f064d29e82 Use unescaped path in API client templates (#5154)
* use unescaped path in api client templates

* use unescape basePath in API client templates
2017-03-22 20:49:06 +08:00
wing328
a4d4b0f0bd fix pattern in python flask (#5155) 2017-03-22 20:41:12 +08:00
wing328
df2f406849 update csharp generator help text (#5140) 2017-03-22 16:18:59 +08:00
wing328
1ee0f4fbad Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-03-22 16:06:22 +08:00
wing328
1c329483e4 [TypeScript] fix class filename in TS Angular2 template (#5131)
* fix class filename in ts angular2 template

* remove trailing comma in ts angular2 template
2017-03-21 23:48:35 +08:00
wing328
52e42701bd Merge branch 'master' of https://github.com/techlogix/swagger-codegen into techlogix-master 2017-03-21 23:29:08 +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
Yao Yao
d217c5c1fd add json-formatter-js library. (#5125) 2017-03-21 21:44:28 +08:00
Ben Herila
42a7110d90 Fix Bug/4952 by explicitly implementing IValidatableObject (#4954)
* Explicitly implement IValidatableObject interface to avoid conflict with potential ValidationResult classes

* Missed one

* Rebuilt tests
2017-03-21 15:57:56 +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
Paul English
59fe50dd74 Ensure identifiers get sanitized; Ensure model names also have the same formatting (#5098) 2017-03-21 14:35:38 +08:00
Fábio Franco Uechi
7325650f2d solves issue #4752 (#5127) 2017-03-21 14:25:10 +08:00
fumito_ito
c1a9b7313e fix #2159 dataformatter error for iOS Swift (#5008)
* fix #2159 dataformatter error for iOS Swift

When trying to parse 24-hour time to 12-hour time, date formatter throws fatal error.
It's caused by lack of settings locale for date formatter.

* update sample code
2017-03-21 14:22:18 +08:00
eblis
21657f80cf Not using files from template folders with libraries inside them (#4628)
* #4627 - When looking for template files also look in the libraries subfolder of the supplied templateFolder, before checking the embedded locations.

* Reworked the order in which template files are searched for:
 - 1st the code will check if there's a <template folder>/libraries/<library> folder containing the file
 - 2nd it will check for the file in the specified <template folder> folder
 - 3rd it will check if there's an <embedded template>/libraries/<library> folder containing the file
 - 4th and last it will assume the file is in <embedded template> folder.

 Added unit test to test template dir overloading.
2017-03-20 22:12:29 +08:00
Gronsak
580745ef43 [C#] Adding support for generating .NET Standard 1.3 client library (#4955)
* [CsharpNetStandard] Added C# .NET Standard Client Generation

Added language CsharpNetStandard.
Everything copied from csharp Client Generator.
Dependancies switched from Restsharp to Restsharp.Portable.
Changes made where nececary to replicate Restsharp functionallity.
Project type changed to .NET Standard protable library.

* [CsharpNetStandard] Removed client prop validation due to incompability

* [CsharpNetStandard] Minor fixes

Changed leftover RestSharp.Method to Method
Changed to .Net Standard 1.3 for compability reasons
Changed excludeTests to default to true due to tests not being implemented yet

Removed unnecessary targetFramework property
Removed leftover UWP stuff

* [CsharpNetStandard] More fixes

Added correct dependencies to Readme
Added correct supported frameworks to Readme
Added slightly better placeholder for installation instructions in Readme

Removed leftover dependencies from project.json
Removed leftover SupportsAsync stuff
Removed references to build.bat/-.sh since they're not yet being generated

Todo implement test generation

* [CsharpNetStandard] Added forgoten git_push.sh

* [C#-netstandard] Renamed option to csharp-netstandard

Also added .bat file for test generation

* [C# Net Standard] fixed path in .bat file

* [C# NET Standard] fixes to enum generation

Fixed issues with enum generation due to tired programmer

* [C# NET Standard] Generated sample client library

Sample library generated

Fixes:
Class actually works again
.bat - minor inconsistency fixed

* [C# NET Standard] Error corrected in how timeout is set

Configuration Timeout property changed to TimeSpan type and code corrected around that

* [C#] Merged .NET Standard generator into csharp generator

Functionallity of csharp-netstarndard generator has been moved into standard csharp generator under the targetFramework option as "v5.0"
2017-03-20 17:21:44 +08:00
Paŭlo Ebermann
d3f365fd29 Fix (partially) #4898 for elixir (#5021)
* fix (partially) #4898 for Elixir

* Update petstore samples (after fix for elixir for #4898)
2017-03-20 15:24:24 +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
Oliver Teichmann
2d21bfa21c Updated feign library to use latest version of OpenFeign and Jackson. (#5114) 2017-03-19 15:15:06 +08:00
wing328
eee5cc061c fix path with {{{ .. }}} in c# api mustache file (#5112) 2017-03-18 23:02:20 +08:00
jfiala
2048defe7b add jackson dependencies to pom for cxf-client #4924 (#5032) 2017-03-18 22:13:44 +08:00
rcilia
d5cb70f03e Swift3 enum: number variable names fix (#5060)
* Swift3 enum: number variable names fix

Swift3 generator: added 'number' prefix to enum variable names that start with a number

* Fixed Swift3 enum variable names starting with number (prefixed with '_') and added test cases

* Swift3 enum var names: made sure to keep the next word after a number in lower case
2017-03-18 17:29:52 +08:00
Paŭlo Ebermann
1b973d2c43 Update petstore samples for scala client. (#5092)
* Update petstore samples for scala client.

* Fix missing dependency problem.
2017-03-18 16:44:53 +08:00
wing328
98e8e55281 Merge pull request #5065 from ibm-bluemix-mobile-services/issue-4764
[Swift] Fix issue #4764
2017-03-17 21:53:44 +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
Tony Tam
9ddf28ff75 Update wordnik.yaml 2017-03-16 16:04:59 -07:00
Tony Tam
20580f9b1b Update wordnik.yaml 2017-03-16 16:01:34 -07:00
wing328
917306aa10 override escape quotation mark in async scala generator (#5078) 2017-03-16 01:14:43 +08:00
wing328
878b390ab6 Merge pull request #5049 from jostick/fix-scala-listbuffer
Fixes ListBuffer import-mapping for scala clients
2017-03-15 23:33:00 +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
Matt Alleman
b2aa877ce0 Allow for UUID types in akka-scala (#5069)
* allow for UUID types

* update sample libs
2017-03-15 17:02:42 +08:00
Anthony Oliveri
88a755f368 [Swift] Detect file type in Swift codegen 2017-03-14 15:02:34 -05:00
Ben Herila
eea58c55b4 Add support for typescript-jquery (typescript-based API calls using jquery ajax in the browser) (#4953)
* Typescript jquery client wip

* typescript-jquery wip

* Fix typo

* typescript-jquery wip

* Fix formatting

* Petstore sample for typescript-jquery

* Petstore sample for typescript-jquery

* wip
2017-03-15 00:17:04 +08:00
Johannes Stickel
02f2fde65e
Fixes ListBuffer import-mapping for scala 2017-03-13 16:43:47 +01:00
Paŭlo Ebermann
a2d1edc6f5 Fix (partially) #4898 for groovy (#5030)
* Fix (partially) #4898 for groovy.

This also adds some TODOs for the missing path, form and body parameters.

* Update Groovy samples (after partial fix for #4898)
2017-03-13 21:46:28 +08:00
Jeff Haynes
ba380c9dda Issue 4759: Import complex type for body parameters (#4775) 2017-03-13 15:35:21 +08:00
wing328
7733dba002 Merge branch '2-call-visibility' of https://github.com/jdupouy/swagger-codegen into jdupouy-2-call-visibility2 2017-03-13 00:21:22 +08:00
Paŭlo Ebermann
c76f006067 fix (partially) #4898 for dart. (#5019) 2017-03-12 17:08:48 +08: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
Paŭlo Ebermann
16adc7b373 Fix (partially) #4898 for flash (#5022)
* Fix (partially) #4898 for flash.

This fixes path, query and header parameters.

* Update samples for flash (after partial fix for #4898).
2017-03-12 16:53:18 +08:00
ravinikam
c4bd4c9e91 Add missing number type mapping (#5013)
number to float or double type mapping was missing, added number to double to accommodate both.
2017-03-11 23:03:37 +08:00
wing328
3dfa423151 Merge branch 'patch-2' of https://github.com/ravinikam/swagger-codegen into ravinikam-patch-2 2017-03-11 20:36:45 +08:00
wing328
0ce6c7e3a8 do not map UUID as model in java (#5026) 2017-03-11 20:32:46 +08:00
XuXinkun
3c1a8daaf9 fix handleResponse to not leak okhttp connections (#4997) 2017-03-11 17:02:49 +08:00
Tony Tam
0dcd91adbf null out the string null in examples. Rebuilt java clients and made a whole bunch of changes 2017-03-10 11:07:30 -08:00
ravinikam
a29c8c937a Update exception message to use operationId
Update ApiException to use {{operationId}} variable to correct typo
2017-03-10 12:41:15 -06:00
Tony Tam
3ff4c988b8 Merge pull request #4999 from swagger-api/issue-4998
updated parser
2017-03-10 09:46:12 -08:00
Tony Tam
f9835a4b37 matched key to actual value 2017-03-10 09:31:02 -08:00
Tony Tam
db4945fdbf added type check 2017-03-10 09:30:49 -08:00
Julien Dupouy
3da8654336 Change build call visibility 2017-03-10 18:05:27 +01:00
Jean-François Côté
20c8f9a831 Java Play Framework Server Generator (#4943)
* 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
2017-03-10 22:10:49 +08:00
David Biesack
ec3b338988 Improve HTML output for model titles, default responses (#4991)
Render "default" instead of 0 for response code when Swagger uses "default" (#4982)
Add title for models to TOC and each model's section
Render model description only conditionally.
Remove extraneous Up link

Regenerate samples/html/index.html
2017-03-10 21:47:20 +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
Rohit Sood
11856e9712 Update Spring Fox dependency version to 2.6.1. This fixes a defect where Swagger and Feign clients do not conflict when registration occurs with Eureka. 2017-03-09 09:54:49 -05:00
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
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
Adnan Baruni
4b2c4f051b Issue 3914 (#4678)
* issue 3914, removed logic that remove header parameters. update template files to handle header parameters in the same manner as other parameters

* update swift and swift3 samples
2017-02-02 23:17:48 +08:00
Valentin Valchev
cd34885b02 Fixed issue #4664: [go] incorrect code generated, if there are more than 1 array parameters (#4683) 2017-02-02 00:20:12 +08:00
Valentin Valchev
96ed41a29c Fixed issue #4665 [go] required object parameters are marked omitempty. (#4682)
* Fixed issue #4665 [go] required object parameters are marked omitempty.

* Run ./bin/go-petstore.sh as suggested by @wing328.
Please note, that there are quite few changes, that doesn’t come from the diff I’ve applied. Seems the script wasn’t run on the previous commit.
2017-02-01 23:56:22 +08:00
Sreenidhi Sreesha
f62a7e2144 Copy dataformat if property field is an array. (#4661)
If a type's field is an array or map, dataFormat of the innerProperty was not copied
into encapsulating property. This change fixes it.
2017-02-01 23:45:21 +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
ee857d1be3 escape unsafe characters/quotes in elixir generator (#4676) 2017-01-30 21:24:21 +08:00
niku
f77bee8b8a [WIP] Add elixir client (#4675)
* Add elixir client

* Add test for elixir client

* Add shell script for generating sample codes for elixir client

It just copied from bin/bash-petstore.sh

* Make elixir-petstore.sh to generate sample codes for elixir client

* Add sample codes for elixir client
2017-01-30 17:40:55 +08:00
megaboich
d82c2bbae7 Fix Typescript errors with 'strictNullChecks' mode enabled (#4658)
error TS2454: Variable 'contentTypeHeader' is used before being assigned.
error TS2345: Argument of type 'FetchAPI | undefined' is not assignable to parameter of type 'FetchAPI'.
2017-01-29 23:22:48 +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
Vlad Frolov
6890ef9755 [JavaScript] Fixed handling of empty arrays/empty strings/booleans/single numbers as valid API responses (#4653) (#4666) 2017-01-28 16:08:04 +08:00
Frode Danielsen
3236ade09d [Python] Improve model equality implementation (#4663)
* [Python] Improve model equality implementation

The model equality implementation template blindly tried accessing the
`__dict__` attribute of the variable to compare equality against. This
attribute does not exist for a lot of Python built-in types (`None`,
`str` etc.) and the equality check would simply crash.

This adds a simple guard to only continue with equality check if the
variable to compare is an instance of the model being compared against.

* Remove wrong auto-update of Python requirements
2017-01-28 00:42:53 +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
Ainun Nazieb
05eea2436c [PHP] Validate parent's model first, if any (#4659)
* if model has parent, valid() & listInvalidProperties() will check the parents' first

* Run the ./bin/security/php-petstore.sh
2017-01-26 22:49:38 +08:00
wing328
c0fb30d491 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-01-26 17:14:23 +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
Amin Shah Gilani
347d477166 Fixes #4655 (#4656) 2017-01-26 12:03:16 +08:00
jaz-ah
f592fdb23e [Swift] two fixes to latest param mapping code (#4587)
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name

* update samples

* one step closer

* closer implementation
2017-01-26 01:17:58 +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
wing328
d239a4c06e Merge branch 'master' of https://github.com/davidteixeira/swagger-codegen into davidteixeira-master 2017-01-25 13:35:48 +08:00
wing328
128872564c Merge branch 'master' of https://github.com/johnluan/swagger-codegen 2017-01-25 13:01:58 +08:00
Tony Tam
3476e83a36 fix for allowable values, #4645 (#4646)
* fix for allowable values, #4645

* fixed string values

* rebuilt for #4645
2017-01-25 12:11:49 +08:00
David Teixeira
6d5da3f2ef Added single quotes -- fixes bug where generated client throws an 'Uncaught Reference Error'. 2017-01-24 17:24:35 +00:00
Johannes Fiala
3ffc4bfa9d backport support DecimalMin/DecimalMax #4091 2017-01-23 21:26:42 +01:00
Johannes Fiala
c0bea5ead9 move beanvalidation code to AbstractJavaJAXRSServerCodegen.java #4091 2017-01-23 21:18:01 +01:00
Pete Holiday
b5de3a446f Prefix apiPackage and modelPackage with invokerPackage.
Fix #4538: Ensure that generated API and Model classes are available to the
autoloader. Change generator behavior to match documentation for
invokerPackage, which reads "The main namespace to use for all classes."
2017-01-23 15:09:50 -05:00
davidteixeira
0ae61a5d26 Removed pet variable from Javascript api_test Mustache file, which was undefined and is not necessary here. This should fix issue #4608. (#4624) 2017-01-23 21:02:11 +08:00
David Teixeira
117e1ea53e Removed pet variable from Javascript api_test Mustache file, which was undefined and is not necessary here. This should fix issue #4608. 2017-01-23 11:29:49 +00:00
wing328
9f8a1e27dd Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-01-23 19:00:31 +08:00
wing328
921328999c Merge branch 'master' of https://github.com/gigo1980/swagger-codegen into gigo1980-master 2017-01-23 18:38:39 +08:00
keysolutions
933cc1ce9a Enum constructFromObject should return value (#4613)
When constructing an enum through constructFromObject the original value provided by the API response should be returned rather than extracting the value from the enum name. This resolves an issue where the constructed value is undefined when the name and value are not equivalent.
2017-01-23 16:45:38 +08:00
tharders
30315c8570 Fix Issue 4554 - handle 204 server response in javascript (#4604)
* issues 4554: Handle 204 response and handle deserialize exceptions

* issue-4554: generate javascript client updated template

Used petstore-with-fake-endpoints-models-for-testing.yaml

* use petstore-with-fake-endpoints-models-for-testing.yaml like sh script
2017-01-23 15:14:06 +08:00
wing328
8e71dfb512 Fix model prefix/suffix with incorrect camelization (#4621)
* fix camelized name with suffix/prefix in java client

* fix php model name with prefix, suffix

* fix indentation in ts abstrat generator

* replace tab with spaces in ts abstract generator
2017-01-23 01:29:11 +08:00
wing328
2e50a65a1c better handling of reserved words in models, operationId (#4620) 2017-01-22 17:41:35 +08:00
Tony Tam
7936cfc206 Merge pull request #4619 from swagger-api/issue-4618
Fix name mangling for JSON processing with QT5
2017-01-21 20:31:18 -08:00
wing328
5306b11b4a [java] Improve pom.xml to qualify for publishing to Maven central (#4616)
* [java] Attach Javadoc to artifact generation.

* [java] Attach source to artifact generation.

* [java] Add gpg signing to artifact publishing.

* [java] Add artifact URL to pom.xml .

* [java] Add artifact description to pom.xml .

* [java] Add artifact URL and description params to Jax RSS.

* [java] Add developer info to pom.xml .

* [java] Parameterise SCM info in generated pom.xml .

* [java] Move GPG signing to verify phase so that .asc files are uploaded during deploy phase.

* [java] Change GPG signing to be an optional via Maven profile. Can't assume all users will perform a release/deploy from an environment with correct GPG key/pass.

* update java petstore smaples

* camelize tag name, remove invalid file

* add back missing files for okhttp-gson

* fix docstring in java feign client

* fix docstring with various java api clients
2017-01-22 11:40:59 +08:00
Tony Tam
728544cc03 use baseName instead of name to avoid sanitized name in json processing 2017-01-21 16:33:09 -08:00
wing328
4d19fb6b2f hide generation timestamp for perl (#4614) 2017-01-21 19:12:51 +08:00
Damien Pontifex
1f0ecb5180 Updating typescript-angular to export api classes (#4589)
* Updating typescript-angular to export api classes

* Fixing tsconfig for typescript-angular test case
2017-01-21 17:02:11 +08:00
wing328
22688f57c0 add embeddedTemplateDir to some generators (#4603) 2017-01-20 15:07:16 +08:00
eblis
3b3f2d2fd6 Options to allow unicode character in identifier names (#4508)
* Added option to allow unicode identifiers in class names, method names etc.
Added option to allow keeping of underscore characters in class names, methods names, etc.

Unicode identifiers are supported by some languages, like Java, but the codegen will remove all non ASCII letters by default. Users might want to separate different parts of names using extended punctuation connector characters, like "_, ‿, ⁀, ⁔, ・, ︳, ︴, ﹍, ﹎, ﹏, _, ・".
Underscores cannot be used to separate different parts of the name as they're removed by default by the codegen, the second option allows underscore characters if the user so desires.
Both options can be used separately if needed, for example one might allow extended punctuation connector characters, but still disallow underscore.

* Added new command line options to all required unit tests.

* Added KEEP_UNDERSCORES and ALLOW_UNICODE_IDENTIFIERS to Bash tests.

* When KEEP_UNDERSCORES is set don't camelize the names, keep the identifier case as is (you probably don't want camel case + snake case, just snake case when KEEP_UNDERSCORES is set).
Added unit tests to verify how the case is computed for various scenarios.

* Reworked pull request to only include changes related to supporting unicode characters in identifiers (removed references to keep underscores).

* These methods and classes can be static again.
2017-01-20 14:42:08 +08:00
John Luan
81e930a752 change html2 mustache to fix parameter name 2017-01-20 10:38:56 +11:00
wing328
029728d851 [maven-plugin] allow for ignore file override (#4597)
* [maven-plugin] allow for ignore file override

The .swagger-codegen-ignore file is beneficial for existing source
directories to provide pattern-based exclusion rules for existing source
to be ignored by swagger codegen. Until now, there's been no utility
other than skipOverwrite to modify the initial generation of code
(either via CLI or maven plugin).

This commit adds support for an ignoreFileOverride option to both the
CLI and the maven plugin.

Example CLI usage:

```
java -jar swagger-codegen.jar generate \
    -i swagger.json -l csharp \
    -o target --ignore-file-override /path/to/ignore-file
```

Example Maven Plugin configuration:

```
    <build>
        <plugins>
            <plugin>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>2.2.2-SNAPSHOT</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/swagger.yaml</inputSpec>
                            <language>csharp</language>
                            <invokerPackage>io.swagger</invokerPackage>
                            <modelPackage>io.swagger.models</modelPackage>
                            <apiPackage>io.swagger.apis</apiPackage>
                            <ignoreFileOverride>/Users/jim/projects/swagger-codegen/.sample-ignore</ignoreFileOverride>
                            <configOptions>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
```

* [maven-plugin] update new javadocs

* fix bad merge due to missing }
2017-01-19 23:17:25 +08:00
Maik Kulbe
d4c96c97c1 Merge with Upstream 2017-01-19 13:53:06 +01:00
Maik Kulbe
e82f3c53b4 Added support for cURL proxy configuration to PHP client 2017-01-19 11:48:55 +01:00
Albert Morlan
ccb3385081 Set embedded templates directory when generating Javascript code (#4585) 2017-01-19 18:07:58 +08: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
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
Sreenidhi Sreesha
da01b2e71a Add title field to CodegenProperty (#4590)
Earlier CodegenProperty did not have title field.
'title' information of the property was lost while converting from Property to CodegenProperty.
This change fixes it.
2017-01-18 15:27:56 +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
Jim Schubert
4c7d1338dc [csharp] Client nuspec (#4576)
* [csharp] Client nuspec

* [csharp] remove carriage returns from nuspec
2017-01-17 11:59:31 +08:00
Damien Pontifex
55443daebc Extends obj using Object.assign (#4562) 2017-01-17 10:52:33 +08:00
Bartek Kryza
545ee0c338 Moved bash version detection to top and improved logic (#4578) 2017-01-17 10:36:12 +08:00
Brian Shamblen
713e6bba24 [html2] Add python and perl examples (#4575)
Fixes #4358
2017-01-17 10:35:55 +08:00
wing328
3b3ded0290 fix bash test package name (#4566) 2017-01-16 19:09:25 +08:00
Jim Schubert
d97b1da90c [csharp] Support internal access of generated code (#4560)
Allows users to specify 'nonPublicApi' additional property (and C#
client CLI switch) to reduce visibility of classes created by the
generator. This includes API and Models as well as supporting code like
ApiClient and other infrastructure.

The requirement is to support codegen generated code to be embedded
within other applications where the generated code is not intended to be
publicly consumable or publicy exposed. An example would be an SDK which
internally consumes an API via the generated code; we wouldn't want the
internal API implementation exposed as part of that SDK.

Reducing visibility of the classes effectively makes the entire
implementation internal, regardless of the public modifier on methods or
static members. To fully make all members internal it would require
explicit interface implementation, which is not ideal.

see #4401
2017-01-16 01:19:10 +08:00
Jim Schubert
23c5376ed6 [csharp] Fix interfacePrefix sensitivity + default (#4561)
After merging the fix with another C# change, noticed case sensitivity
issue for the true/false checks. Also noticed my original implementation
wasn't setting the default I- prefix as intended. This commit resolves
those three issues.
2017-01-16 01:12:03 +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
Tomek Cejner
f0cddd21fd Swift3 Clener template of client methods (#4552)
* Swift3 template properly uploads files, making mustache template little cleaner

* [swift3] moved URL parameter encoder helper function to APIHelper.swift

* Swift3 - regenerated sample
2017-01-16 01:01:50 +08:00
Jim Schubert
663b471d1a [nancyfx/csharp] Customize interface prefix (#4557)
Per #4486, this allows user to specify the use of a standard or custom
prefix for interfaces. For C# based languages, this follows Microsoft's
Framework Design Guidelines and uses an I- prefix. However, to avoid
breaking changes with existing nancyfx generated code, the default is
unset.

The option supports true, false, or a custom prefix.
2017-01-15 23:35:43 +08:00
eamon316
d7e6a3da6a Add a useTags flag to allow tags to be used to generate interface / controller classnames (#4396) 2017-01-15 23:25:30 +08:00
Gene Chang
95987fc132 Added support for datetime query parameters in cpprest (#4556)
* Added support for datetime query parameters in cpprest

Signed-off-by: Gene Chang <gene.chang@anyconnect.com>

* Update petstore sample app for cpprest using bin/cpprest-petstore.sh

Signed-off-by: Gene Chang <gene.chang@anyconnect.com>
2017-01-14 00:07:06 +08:00
Richard Naeve
2e7e25801d Issue 4531 (#4539)
* ISSUE-4531
Arrays are now serialized according to the different collection formats. All api classes are also exported in a const array to make handling of large api libraries easier.

* Added petstore samples

* Fixed indentations and coding style
2017-01-13 23:41:54 +08:00
Joseph Moore
d40f7a41b6 Add triple-mustache to all instances of vendorExtensions.extraAnnotation. (#4553)
This covers the usages that weren't fixed in #3825

Triple mustache is required because annotations may contain chars like
"=" that would be mistakenly encoded.
2017-01-13 23:01:15 +08:00
eblis
af4319015e When reading mustache template files assume UTF-8 encoding, fixes #4544. (#4545) 2017-01-13 00:11:07 +08:00
Bartek Kryza
0fb154e9a2 [Bash] Bash client script generator (#4541)
* Initial commit

* Remormatted petstore tests

* Added Bash codegen to main README.md

* Added bash to integration tests

* Fixed stdin detection in generated script

* Added back ruby module
2017-01-12 16:48:25 +08:00
Pete Holiday
2e4de0ca1e Remove unnecessary call to setHost() in the constructor (#4525)
* Remove unnecessary call to setHost() in the constructor

The default host will be automatically set on the client by the ApiClient constructor.

* Updated PHP API Classes corresponding to template updates in #4525.

* Additional changes generated by the petstore update unrelated to #4525, but seem to have not been included yet.

* Add test to prevent regressions of #4525
2017-01-12 16:17:17 +08:00
J. Fiala
a6b0518bf0 replace tabs 2017-01-10 18:03:51 +01:00
Krisztian Lachata
c1f854f7da Overriden objectmapper wasn't used in deserialisation (Scala) issue #4532 (#4534)
* Overriden objectmapper wasn't used in deserialisation

Use previously provided apiInvoker instead of creating a instance at deserialision stage

* update scala sample
2017-01-11 00:27:48 +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
wing328
4d4af71446 [CI] Add scripts to detect carriage return and tab (#4526)
* add script to detect carriage return

* add check for generator as well

* add fail fast to travis config

* remove tab

* move scripts under bin/utils

* remove carriage return

* move scripts to bin/utils
2017-01-09 18:29:41 +08:00
Jeff Haynes
380bed15d3 Issue 4244 - Add x-discriminator-value (#4252)
* Fixes for issue 4226. Detects and warns about more than one inline object; sets discriminator on CodegenModel; Adds templates to other Java languages
Changes to be committed:
	modified:   modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
	modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache

* Add vendor extension for x-discriminator-value
Changes to be committed:
	modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache

* Add "visible = true" to @JsonTypeInfo jackson annotations for Java languages
Changes to be committed:
modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
2017-01-09 18:28:27 +08:00
Alex Nolasco
26ead9b58f Issue 4416 (Assist escapeReservedWord with custom mappings) (#4480)
* Preliminary implementation for issue-4416

* Updated README.md with  reserved-words-mappings  parameter.
2017-01-09 18:22:25 +08:00
Sreenidhi Sreesha
81b5b78fc2 Enable support for vendor extensions in CodegenResponse. (#4517) 2017-01-08 17:58:07 +08:00
Tomek Cejner
1e8c7180c5 [swift3] allow POST with both body and query parameters (#4490)
* [swift3] allow POST with both body and query parameters

* Correctly support non-string and optional query parameters.
2017-01-07 22:40:07 +08:00
Kevin Locke
409e1a504c Fix Gson parsing of Joda DateTime without millis (#4473)
* Fix Gson parsing of Joda DateTime without millis

The DateTimeFormatter returned by ISODateTimeFormat.dateTime() only
parses dates with millisecond values, and throws
IllegalArgumentException when milliseconds are not present.  The
date-time construct from RFC 3339 Section 5.6 referenced by the
Swagger/OpenAPI spec allows fractional second values to be omitted.
This results in valid date-time values being rejected by the generated
code.

This commit fixes the problem by using .dateOptionalTimeParser() for
parsing, which correctly handles date-time values without fractional
seconds.  A previous version of this commit used .dateTimeParser(),
which accepted a time without a date and was considered too liberal.
Note that .dateTime() must still be used for printing, which is not
supported by .dateTimeParser().

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* Fix akka-scala date-time parser with Joda

As in the previous commit, which fixed Java generators,
ISOISODateTimeFormat.dateOptionalTimeParser() should be used for
date-time parsing and ISOISODateTimeFormat.dateTime() for printing.
Apply the same change to akka-scala.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2017-01-07 21:56:14 +08:00
J. Fiala
6b17b92bb6 add check for isInteger (integer/decimal) 2017-01-06 16:46:59 +01:00
J. Fiala
24f486164a add test for options #4091 2017-01-06 16:18:14 +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
JasonNorth
5686109cc9 Allow templates to use maxItems and minItems for Arrays (#4309)
Issue 3925
2017-01-06 19:57:28 +08:00
Frédéric Rodrigo
c0f1716fe7 [html2] Open the description field that contains the description and required switch, in place of only show the field type by default (#4489) 2017-01-06 19:40:06 +08: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
Brian Voss
43ab14b200 Adding Curl connect timeout configuration to PHP generation templates (#4500) 2017-01-06 19:14:39 +08:00
Simon Morris
aa1dc0fdd2 Updated Nancy from 1.4.1 to 1.4.3 (#4482) 2017-01-06 01:09:32 +08:00
Brian Shamblen
b224474a43 Fixes #4481 (#4493) 2017-01-06 01:03:18 +08:00
Takuro Wada
6a080d3a0c add safe argument to quote method in python template to avoid unquoted parameter in path parameter (#4457)
Closes #4391
2017-01-06 00:55:55 +08:00
Johannes Fiala
1a1d0aebc8 add beanvalidation to jersey1 and jersey2 #4091 2017-01-04 17:36:28 +01:00
Jim Schubert
cb9a1b3b53 [csharp] Use default rather than null in ctor (#4145) 2017-01-03 18:31:26 +08:00
Jim Schubert
c94e18abd8 [codegen ignore] normalize path separator for Windows, add *.ext tests (#4476)
* [codegen ignore] Fix windows paths for ignore processing

* [codegen ignore] Add missing glob rule tests
2017-01-03 16:56:50 +08:00
Tony Tam
0252d1a534 Update to latest swagger-core, parser versions (#4472)
* updated to release versions

* fixed defaultValue objects to strings

* added top-level jackson version

* added missing dependency, removed from swagger-core
2017-01-03 16:41:16 +08:00
Gayathri Sharma
4452fdbc02 Resteasy changes 2016-12-27 21:33:27 -06:00
mkarnik
ababec69dd [JAX-RS RESTEasy][issue #4447] Added swagger annotations to model and api templates 2016-12-22 22:18:39 +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
Anton Vasin
41701a15b0 Fix typo. Creactor -> Creator (#4443) 2016-12-22 23:08:06 +08:00
Ezekiel Templin
e189388371 [Ruby] Add Rakefile and Gemfile (#4448)
* Add Rakefile, Gemfile, and update client generator

* Update sample
2016-12-22 21:37:12 +08:00
Michael Fulton
d7afb22f1f Fix Integer stub value defaulting to String in nodejs-server if format not specified (#4436)
* check if property is a BaseIntegerProperty. This can occur when format is not specified in Swagger definition

* Change coding style to be more consistent
2016-12-21 15:08:14 +08:00
wing328
204c05442d [ObjC] minor code style enhancement to ObjC API client (#4437)
* minor code style enhancement to objc api client

* update petstore sample

* remove datatype from docstring (objc)
2016-12-20 19:13:03 +08:00
wing328
4870cf4ab1 Merge branch 'Ignore_Javatypes_On_ModelPre_and_Suffixes' of https://github.com/d0x/swagger-codegen into d0x-Ignore_Javatypes_On_ModelPre_and_Suffixes 2016-12-20 17:46:52 +08:00
Vincent Giersch
7f980cd9dd fix(swift3): lowercase enum value before checking reserved words (#4357)
Signed-off-by: Vincent Giersch <vincent@giersch.fr>
2016-12-20 16:35:03 +08:00
Greg Rashkevitch
36b97c22af Fix warning docs return type (#4429)
* Objective C: Fix compilation warnings

If returnType is not provided, set the @return as void

* Run the `./bin/objc-petstore.sh`

* OBJECTIVE C SDK: Remove the return line for methods that return nothing all together

* obj-c sdk: Updated petstore sample
2016-12-20 16:10:47 +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
wing328
4c398a4cba Merge pull request #4434 from chasetec/master
Update DefaultGenerator.java to call close()
2016-12-20 15:52:00 +08:00
wing328
43ff85db76 Merge pull request #4421 from wing328/fix_isfile_boolean
Fix `isPrimitiveType` for file property
2016-12-20 15:48:55 +08:00
Matthieu Chase Heimer
da1e07af21 Update DefaultGenerator.java to call close()
Need to call out.close() after IOUtils.copy(in, out); when writing supporting files.
2016-12-19 13:25:10 -06:00
wing328
7fd895b37d fix isPrimitiveType for file 2016-12-18 19:02:26 +08:00
wing328
8ccf9828e4 [Python] add hasConsumes/hasProduces to Python API template (#4419)
* add hasConsumes/hasProduces to python api template

* remove unused code in python

* fix isFile in the api doc (python)
2016-12-18 17:20:10 +08:00
wing328
6bf721f2e3 add parameter as reserved keyword (#4410) 2016-12-17 00:29:06 +08:00
wing328
2172cfef84 add warning message for null inner type (map/array) (#4408) 2016-12-16 19:41:54 +08:00
Hamed Ramezanian Nik
6af43dc720 [csharp] Escape special characters in the API doc (#4183)
Special characters like <> should be HTML escaped.
2016-12-16 19:07:00 +08:00
Nicholas DiPiazza
c6c8ffe4e0 Do not NPE when array properties items are not specified (#4063) 2016-12-16 19:04:13 +08:00
Brian Shamblen
bd81f3264d [html2] Fix import statements for most languages (#4243)
* [html2] Clean up namespace issues in code samples

* pull c# and php package namespace from --additional-properties arg

phpInvokerPackage arg now sets the PHP namespace and packageName sets
the CSharp namespace. invokerPackage still works for Java and Android
namespace.
2016-12-16 18:06:28 +08:00
Christoph Keller
6ade001663 CodegenResponse.isListContainer is false for array types. (#4400)
CodegenResponse's isListContainer property is always false for "array" types. Don't know where the check for "list" comes from but in CodegenOperation, there's a check for "list" and "array".
No mustache file makes use of isListContainer inside responses yet, so should not change any existing behavior.
2016-12-16 12:08:24 +08:00
Yohana Khoury
91af8066cd boolean values from JSON are treated as strings (#4229)
* Change the value types in additionalProperties and dynamicProperties to Object instead of String.
Change methods that insert values to these maps to use Object as the type of the value instead of String.

* Fix run-all-petstore run: use toString instead of casting
2016-12-16 11:56:38 +08:00
wing328
ffbead3f9d Merge branch 'master' into typescript-angular2-build-to-dist-folder 2016-12-15 21:40:48 +08:00
wing328
131cbeb350 remove generation timestamp 2016-12-15 19:34:15 +08:00
wing328
870c745e6f minor fix to java client options test 2016-12-15 19:30:35 +08:00
Cliffano Subagio
3bc3a40073 [java] Add licenseName and licenseUrl options. 2016-12-15 19:30:35 +08:00
wing328
7fc8b24001 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2016-12-15 00:42:51 +08:00
wing328
7b7e5e25ee Merge branch 'angular2-standalone-enums-support' of https://github.com/SamuelBeliveau/swagger-codegen into SamuelBeliveau-angular2-standalone-enums-support 2016-12-15 00:09:34 +08:00
wing328
a143e9c10c add int/long check for @min/@max in java model (#4395) 2016-12-14 22:21:52 +08:00
lukoyanov
a13dee7167 [Java] Play! Framework 2.4 WS client support + retrofit2 (#4270)
* implemented core integration with play 2.4 ws

* added shell script to test on CI

* added shell script to composite file for all java generators

* added some comments
changed promise param to Response<T> to allow access to http status code and raw response if needed

* removed unnecessary whitespace changes

* added java7 compatibility, play ws deps to pom.xml

* added generated play24 client

* fixed imports
2016-12-14 17:32:49 +08:00
wing328
0df8bd2140 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2016-12-14 16:27:14 +08:00
wing328
3957a1db1a Merge branch 'feature/file-response' of https://github.com/www2k/swagger-codegen into www2k-feature/file-response 2016-12-14 16:26:34 +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
Bruno Santos
90cf1cab53 Date type should not include time (#4385)
Removed time section from Date type in example generators.

Issue #4359
2016-12-14 11:51:14 +08:00
Chris Putnam
4fa3595a41 [typescript-angular2] Fix syntax error (#4383)
* allow function so access token can be derived for each api call

* update tests

* update type for accessToken to be string or function that returns string

* fix syntax error
2016-12-14 11:50:02 +08:00
wing328
dbb66af73d [C#] Add auto-generated doc for c# 2.0 generator (#4354)
* add auto-generated doc for c# 2.0 generator

* update readme for c# 2.0

* update readme

* update namespace in the doc
2016-12-14 11:49:15 +08:00
wing328
a291d3113a [Android] better code format for Android (volley) API client (#4384)
* better code format for android volley

* better code format for apiinvoker, add docstring

* use 2-space indentation for pair class

* use 2 spaces indentation for other classes in android
2016-12-14 00:40:21 +08:00
wing328
b33d4ec30c add enum_outer_doc.mustache for android (#4381) 2016-12-13 17:54:23 +08:00
Dan Wilson
e55664cdc9 Remove invalid code from mustache for arrays. (#4266)
Rewrite ParameterToString to handle other slice types other than just string.
2016-12-13 16:13:06 +08:00
wing328
5818f2c882 [C++] better code format for cpprest templates (#4379)
* replace tab with 4-space in cpprest templates

* remove trailing whitespaces from templates

* fix code indentation in cpprest templates

* remove empty block in cpprest templates
2016-12-13 16:09:56 +08:00
weiyang
beeb02a2dc [html] Add type anchor to body param block (#4368)
* [html] Add type anchor to 'bodyParam' block

Signed-off-by: weiyang <weiyang.ones@gmail.com>

* [html][samples] Add type anchor to 'bodyParam' block

Signed-off-by: weiyang <weiyang.ones@gmail.com>
2016-12-13 15:52:22 +08:00
Scott Richter
da9d64d053 Fix for issue #4370 - Cpprest does not set Content-Type header on POST requests. (#4374)
* Fixed cpprest generator to include Content-Type header in requests.

* Fixing indent to use spaces.
2016-12-13 15:01:47 +08:00
Chris Putnam
0b5a6f25da [typescript-angular2] access token function (#4361)
* allow function so access token can be derived for each api call

* update tests

* update type for accessToken to be string or function that returns string
2016-12-13 00:39:09 +08:00
Paul Vollmer
77b92d7d11 Fix go client auth UserName var issue (#4245) 2016-12-13 00:19:20 +08:00
wing328
62aabfc6c1 Merge branch 'jfiala-beanval_2549' 2016-12-13 00:05:03 +08:00
wing328
d9de3b540d Merge branch 'beanval_2549' of https://github.com/jfiala/swagger-codegen into jfiala-beanval_2549 2016-12-13 00:01:44 +08:00
Dmitry Solovyov
bf50ea1366 fix the value for @Generated java annotation (#4366)
com.my.Generator.class.toString() returns "class com.my.Generator", and this value is then used in the javax.annotation.Generated annotation like that: @Generated(value = "class com.my.Generator").
Should use Generator.class.getName() instead, so we end up with @Generated(value = "com.my.Generator")
2016-12-12 18:38:39 +08:00
Frederick Cai
8e200970d4 [typescript-angular2] build to dist folder 2016-12-11 23:39:18 +13:00
wing328
130161fc43 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2016-12-10 01:02:22 +08:00
Sreenidhi Sreesha
c83c813865 Refactor Boolean properties to boolean. (#4326)
There is no good reason to use Boolean instead of boolean.
Using Boolean will lead to handling "null" state which is confusing.

This change removes changes the type of Boolean properties to boolean.
2016-12-10 00:37:50 +08:00
wing328
b68e4b05d9 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2016-12-09 17:43:56 +08:00
Thomas Hoffmann
7a97c3c375 Still respect super.equals even for models without own vars (#4259) 2016-12-09 17:27:55 +08:00
Vlad Frolov
4d2a13018b [Python] Make the code look Pythonic (#4352) 2016-12-09 17:26:23 +08:00
wing328
2e80d2fb40 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2016-12-09 15:56:06 +08:00
Jens Oberender
c3571b28a5 Some code cleanings of problems reported by SonarQube. (#4324)
* Some code cleanings of problems reported by SonarQube.

* Updated changes to the petshop sample.
2016-12-09 15:55:33 +08:00
wing328
ceb9cb79cd Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2016-12-09 00:34:19 +08:00
wing328
a0f2b235f1 [C#] fix build.sh for PropertyChanged feature in C# API client (#4349)
* fix build.sh for PropertyChange in C#

* add new csharp files

* manual fix to enum ref in c# client
2016-12-09 00:03:38 +08:00
wing328
9051848ffa minor fix to petstore test spec 2016-12-08 23:24:20 +08:00
wing328
af2db27a83 remove trailing space in ts fetech api, add npm test to ci (#4348) 2016-12-08 18:09:20 +08:00
Josh Williams
535b233ff7 Fix for #4344 - update compile.mustache with new dependencies (#4345)
* Fix for #4344 - update compile.mustache with new dependencies

* Fix compile.mustache to use generatePropertyChanged flag for DLLs
2016-12-08 16:14:25 +08:00
Christopher Chiche
a3d3082105 [Typescript/Fetch] Fix tslint issues in generated code (#4313)
* [Typescript/Fetch] Fix tslint issues in generated code

* Add security generated files.

* Use tslint version that doesn't require typescript 2

* Run build scripts
2016-12-08 16:01:50 +08:00
wing328
a0c4b58b53 add guid mapping for c# 2.0 (#4347) 2016-12-08 15:59:06 +08:00
wing328
939a8052f3 [Java] Uncomment @Max @Min syntax in bean validation files (#4340)
* uncomment max min syntax in bean validation files (java)

* remove eol at the end of the file
2016-12-08 15:22:55 +08:00
wing328
162352cb4b Fix maximum, minimum for Integer (#4335)
* fix int/long max, min value (removing decimal)

* fix integer min/max in parameter
2016-12-07 19:29:36 +08:00
Alvin
b7984e55a7 [Swift3][bug#4318] Bug when handling java date (#4332)
* fix bug #4318

* swift3 samples update
2016-12-07 17:58:21 +08:00
wing328
8153f0e89b Fix test spec issue (#4334)
* fix issue with swagger spec (number => integer)

* remove space from spec
2016-12-07 16:46:41 +08:00
Jim Schubert
8e1eeaa737 [csharp] Remove generatePropertyChanged when explicitly false (#4280) 2016-12-07 01:04:13 +08:00
Sebastian Haas
648f8df235 Fix for missing headers (#4328)
* Fix for  #4322

Signed-off-by: Sebastian Haas <sebastian@haas.tech>

* Run typescript-angular2-petstore.sh

Signed-off-by: Sebastian Haas <sebastian@haas.tech>

* Run typescript-angular2-petstore.sh

Signed-off-by: Sebastian Haas <sebastian@haas.tech>
2016-12-06 23:59:59 +08:00
Alec Henninger
2b240a4eb9 Use JavaScript codegen in JavaScript test (instead of Java) (#4316) 2016-12-05 10:56:03 +08:00
Samuel Beliveau
964a9a9696 Support for standalone enums in Typescript-Angular2
Improved typescript primitive detection for tagging type with models namespace
2016-12-02 10:24:32 -05:00
wing328
18420dd7f9 add serialVersionUID to java model (#4311) 2016-12-02 17:59:35 +08:00
wing328
31d31b9466 [Ruby] use hasConsumes, hasProduces in ruby client (#4310)
* use hasConsumes, hasProduces in ruby client

* add new ruby files
2016-12-02 17:22:46 +08:00
wing328
fdb6d3020c Merge pull request #4305 from wing328/android_object_reserved_word
[Android] add Object as reserved keyword in Android generator
2016-12-01 19:29:43 +08:00
wing328
87cb779fd4 [Typscript][Angular2] Remove tab in TS Angular2 template (#4294)
* remove tab in ts angular2 template

* update petstore sample after basing on master
2016-12-01 19:09:22 +08:00
wing328
564e061da6 add Object as reserved keyword in Android 2016-12-01 17:34:38 +08:00
Sreenidhi Sreesha
af0d217c38 Fix basePath set to null when generating API files. (#4304) 2016-12-01 15:46:44 +08:00
jaz-ah
0a97b9c568 make sure to camelize properly before checking for reserved words (#4302) 2016-12-01 11:49:56 +08:00
wing328
c6aea46fa0 fix import in sample code (dart) (#4292) 2016-11-30 18:30:30 +08:00
wing328
a603ccb595 [Dart] add auto-generated documentation (#4291)
* new files for dart client

* update doc for dart

* update api and model doc for dart

* update dart petstore sample

* update dart doc

* update dart petstore sample

* update dart petstore sample

* update dart client installation instruction
2016-11-30 17:41:55 +08:00
Christopher Chiche
b733334eee [Typescript/fetch][Issue4284] Handle query parameters containing colons (#4287)
Put query parameters between quotes and access object keys using square
brackets to make sure special characters are handled in parameter
names.
Closes #4284
2016-11-30 15:22:38 +08:00
wing328
1925928efa Merge pull request #4038 from alechill/4025-typescript-fecth-request-options
[TYPESCRIPT] Support passing custom RequestInit options in typescript-fetch client…
2016-11-29 22:32:03 +08:00
ChrisJamesC
e7397d208e Fix linting issues
Add missing semicolons and remove trailing space in generated code.
2016-11-28 16:48:30 +01:00
wing328
5b90276dae Merge pull request #4202 from gierschv/fix-swift3-inheritance
fix(swift3): multi-level inheritance support
2016-11-28 22:21:32 +08:00
Robert Biehl
1ea9865a44 [PHP] Fix discriminator handling (#4246)
* [PHP] Fix discriminator handling

* [PHP] Fix discriminator handling (Update examples)
2016-11-25 16:12:41 +08:00
Daniel
c15743bfe6 Issue4254 (#4255)
* Issue 4254 - Added mechanism for cache bursting

* Issue 4254 - Updated petstore samples
2016-11-25 00:14:59 +08:00
cbornet
bcc7e69fcc [Flask] Add packaging support 2016-11-23 18:40:37 +01:00
wing328
5f372ef15e Merge pull request #4219 from jordanyaker/master
fix(javascript): add check to see if the parsed response is really empty.
2016-11-23 17:23:52 +08:00
wing328
44ca30df63 Merge pull request #4215 from cbornet/flask_param_name
[Flask] fix parameter naming
2016-11-23 15:42:42 +08:00
Sreenidhi Sreesha
2f80568658 Refactor code to make it more readable. (#4224) 2016-11-23 15:13:15 +08:00
Nick Maynard
4c05d5f098 Allow Java source formatting mvn formatter:format (#4214)
Uses Eclipse formatting tools with a configuration matching Google's style guide (plus our customisations).
2016-11-23 15:07:25 +08:00
plankswert
ba194ba361 Added support for string responses (#4057)
* Added support for string responses

When a method/URL/response is defined to return string:
- If no content types are define, default to 'text/plain' instead of
  'application/json'
- Add response handler, that returns the reponse string as-is if response
  content-type is 'text/plain'

* Removed use of unused tag vendor tag

- The tag was vendorExtensions.x-codegen-response.isPrimitiveType
2016-11-23 14:31:31 +08:00
menchauser
6ebc2fc051 Fix support for 'class' properties in Java codegen (#4237)
* Fix support for 'class' properties in Java codegen

Currently Java codegen works successfully for property named 'class' but
fails on '_class', '__class', etc, because of 'Object.getClass()'
overloading.

This fix is intended to avoid all Object method overloading cases.

* Regenerated samples for Java petstore-security-test
2016-11-23 00:18:40 +08:00
wing328
58b66a0b0a python code style enhancement (#4238) 2016-11-22 23:01:41 +08:00
wing328
474dae08cf update NodeJS readme to remove oudated doc (#4232) 2016-11-22 10:42:15 +08:00
Ewan Mellor
9dc809bdc7 Add two override points inside AlamofireRequestBuilder in the Swift 3 template. (#4170)
* Add two override points inside AlamofireRequestBuilder in the Swift 3 template.

These allow the caller to control the request configuration (e.g.
to override the cache policy) and to control the Content-Type that is
given to an uploaded form part.

* Regenerate with ./bin/swift3-petstore-all.sh to match recent changes.

This includes a few minor changes that weren't made in this branch, so this
apparently wasn't run on master after some other recent changes.
2016-11-22 00:19:17 +08:00
Martin McWhorter
515e723fae Allow TypeScript noImplicitAny: true (#4205)
* Allow TypeScript noImplicitAny: true

* Update typescript-angular2 examples
2016-11-21 19:39:07 +08:00