Commit Graph

3315 Commits

Author SHA1 Message Date
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
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
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
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
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
wing328
a45579d35e fix issue with pom.xml (spring cloud, boot) 2017-01-27 00:39:25 +08:00
jfiala
8952815b5f [Spring] Add beanvalidation annotations (#4600)
* update generated sample for spring boot #4091

* add beanvalidation annotations to spring #4091

* add tests for spring #4091

* cleanup spring-cloud (client lib) #4091

* update client sample spring-cloud #4091

* replace tabs

* add beanvalidation annotations to spring #4091

* add tests for spring #4091

* cleanup spring-cloud (client lib) #4091

* update client sample spring-cloud #4091

* replace tabs

* update spring-cloud sample
2017-01-26 23:45:36 +08:00
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
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
3be04e8a18 update JS petstore client 2017-01-25 16:08:22 +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
Scott Williams
6e846e7463 Issue 4637 Fix for ci build (#4643) 2017-01-25 12:09:33 +08:00
wing328
9f8a1e27dd Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-01-23 19:00:31 +08:00
wing328
9abaab6bcf update ts angular2 petstore samples 2017-01-23 18:40:59 +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
wing328
e83646064f update js promise petstore sample 2017-01-23 16:00:23 +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
62caf7dac5 rebuilt samples 2017-01-21 16:33:14 -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
9a8ede4189 update php sample 2017-01-19 21:22:20 +08: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
ccecc2aac0 new file for jaxrs jersey1 2017-01-19 15:31:24 +08:00
wing328
1ae60b1f61 Merge branch 'jaxrs_jersey_beanval2' of https://github.com/jfiala/swagger-codegen into jfiala-jaxrs_jersey_beanval2 2017-01-19 15:30:54 +08:00
jfiala
ee7f9fc56c [Jaxrs] Add beanvalidation annotations and fix outer Enums (#4492)
* add beanvalidation to jaxrs and add support for outer Enums #4091

* cleanup Codegen #4091

* cleanup samples #4091

* cleanup tabs

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

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

* add check for hideGenerationTimestamp #4091

* replace tabs

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

See original issue #3608

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

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

* [aspnetcore] ctor defaults + enum support

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

Example:

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

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

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

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

* #4432 Running the Petstore files
2017-01-17 15:26:30 +08:00
Damien Pontifex
55443daebc Extends obj using Object.assign (#4562) 2017-01-17 10:52:33 +08:00
Brian Shamblen
713e6bba24 [html2] Add python and perl examples (#4575)
Fixes #4358
2017-01-17 10:35:55 +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
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
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