Commit Graph

747 Commits

Author SHA1 Message Date
magiepooh
914275fe79 [kotlin] support selection of datelibrary (#7054)
* [kotlin] support selection of datelibrary

* remove additional property from string

* replace string with boolean
2018-01-28 17:16:01 +08:00
jarlesat
88c5112f2e Adds support for returning response in jaxrs-spec interfaces (#7442)
* Issue 7440 Added support for returning response in jaxrs-spec interfaces.

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

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

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

* [ktor] Initial ktor (kotlin-server)

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

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

* [ktor] Initial sample

* [ktor] Adding options for select feature installs

Options available:

* featureAutoHead
* featureConditionalHeaders
* featureHSTS
* featureCORS
* featureCompression

* [ktor] Start of auth functionality

* [ktor] API key auth placeholder

* Add basic support for oauth2 configurations

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

* Added example response objects

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

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

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

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

* Fix some javadoc issues in lambda classes

* Update kotlin-server-petstore.bat

Change `kotlin` to `kotlin-server`

* Fix javadoc error messages in CI
2018-01-27 17:43:46 +08:00
Benjamin Roedell
47111b3241 Issue 4824 fix gson deserialize format byte (#7473)
* Build sample prior to code changes so differences are easier to decipher

* Add byte array type adapter for okhttp-gson (java8 only)

* Unit revealed that Gson (or GsonFire) defaults to escape = (equal sign) out of base64 string.  Add disableHtmlEscaping() to gsonbuilder.

* Update specs and samples to include format=byte and include junit test of byte array serialization and deserialization.

* Implement recommendations by @cbornet including: Use okio.ByteString for base64 conversions instead of java 8 lib since the okhttp-gson client already includes okio. Remove setting to disableHtmlEscaping. Rename LocalByteArrayAdapter to ByteArrayAdapter.

* Update spec and sample for java okhttp-gson library client

* Undo addition of profilePhoto property.  A format byte property is already available under the format_test definition.

* Put previously deleted tests back. Modified testFindPetsByTags() to verify exception since the server now returns a 500 for this request.

* Update test to pass when run against docker containerized server swaggerapi/petstore (heads up, this test fails if calling out to the internet published version of http://petstore.swagger.io)
2018-01-26 09:52:49 +08:00
William Cheng
df10c725ab
Add lua test script, minor fix to Lua API files (#7490)
* add lua test script, minor fix to api files

* fix model import, avoid null header issue

* add space before equal sign
2018-01-25 22:01:04 +08:00
Jörn Ahrens
a5e26a44ff [Dart] - Rework Dart client generator to be flutter-compatible (#7418)
* copy mustache templates from dart generator

* Start with generator by copying the DartClientCodegen for now

* at least we know this is not for a browser..

* First working version for a simple swagger configuration

* remove browserClient parameter, since it doesn't make sense for flutter

* Take care of complex types to support object hierarchies

* add null safety

* add small test for options

* add flutter-petstore scripts

* generate flutter petstore output

* Add new flutter test project

* move generated client to make it usable

* use generated swagger petstore plugin

* add support for lists of objects

* add DateTime support

* fix listFromJson implementation

* fix NPEs in DateTime operations + place order in sample

* Small readme changes

* bugfixes

* Use flutter-compatible implementation as default dart implementation

* fix generated samples

* Make lists serializable, now all dart test cases are working again

* better list implementation

* use StringBuffer

* removed FlutterClientCodegen

* fix browser client

* fix dependencies

* swagger-browser-client for browserClient testcases

* fix scripts

* removed flutter scripts

* add map support and simplify code via using .toJson contract

* remove unneeded devDependencies

* Regenerated samples

* fix call to mapFromJson, it is not a constructor

* remove pointless string serialization

* regenerated dart samples
2018-01-25 18:18:53 +08:00
William Cheng
cf4df630b7
Add Spring Petstore samples (async, java8-localdatetime) to CircleCI (#7468)
* add ci for spring mvc: async, localdatetime

* update artifactId for new spring samples
2018-01-22 21:35:51 +08:00
Tristan Sloughter
c73118524c [erlang-client] Erlang request utils (#7257)
* [erlang-client] fix body param from being included path and base path to remove host

* [erlang-client] move request logic out of api functions to utils module

* [erlang-client] add support for passing http client configuration to requests

* [erlang-client] update auth handling

* [erlang-client] remove underscore2, replacing with original underscore + replaceAll
2018-01-22 13:18:35 +08:00
wing328
73c338be58 Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-13 15:54:41 +08:00
wing328
50b599719d add tests for java vertx petstore 2018-01-11 16:36:23 +08:00
Jean-François Côté
ebf4efe3ea Fix issue #6867 : The apiPackage option was ignored (#7316)
* Fix issue #6867 : The apiPackage option is ignored in the template for Java Play Framework.

* use openjdk7 in travis to ensure it works with jdk7
2018-01-10 13:15:49 +08:00
wing328
0469975632 minor enhancement to scala gatling 2018-01-07 17:38:55 +08:00
ryandavis84
6d2d4298df Gatling generator2 issue #6927 (#6934)
* Initial commit, Generates everything necessary to run a performnace test against a swagger api.  Just have to fill out the CSV feeder files with your data.

* adding samples and gatling-petstore.sh file

* Extending the AbstractScalaCodeGen

* Checking in the CodegenConfig file as it is needed to generate

* removing escaped reserved words

* Changed model to be able to make all variables utilize an underscore while json fields are still just the variable name

* Changing underscore to var as interpolation can not start with a _ in scala

* Fixing path params

* allow you to pass in a system property to define which config to use as a workload profile, use rate and instance multipliers to scale up and down your test, added ramp down after the test is completed, added global assertions.

* Addressing PR feedback

* missed semi-colon

* Bringing everything up to date with the renames that were suggested
2018-01-07 17:18:36 +08:00
manuc66
a050907d1f fix net35 with JsonSubTypes (#7043)
* upgrade JsonSubTypes to 1.2.0

* update samples

* add SwaggerClientNet35

* re-generate

* fix the linux build script
2017-12-22 00:31:44 +08:00
Erik Timmers
d6539ba3c8 Add Elm language - BETA (#6947)
This is the initial Codegen for Elm 0.18.
Please try it out and provide feedback.

Not yet supported:

* path variables;
* additionalProperties;
* authentication;
* recursive types.
2017-12-20 22:26:46 +08:00
Ben Wells
83fb107749 Create abstract go codegen base class (#7197)
Remove tabs
2017-12-19 23:41:02 +08:00
William Cheng
bd19111ff0
[Java][PKMST] Move resource folder (#7213)
* comment out pkmst test for the time being

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

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

* formatted

* replaces tab with blank spaces

* adding documentation folder

* adding documentation folder

* Update readme.mustache

Added feature set offered by pkmst

* updated readme

* Update io.swagger.codegen.CodegenConfig

Arranged pkmstServerCodeGen and SymfonyServerCodegen in aphabatical order

* Update readme.mustache

* renamed according to convention and added typeinfoannotation

* removed tabs

* updated codegen which extends abstractjavacodegen

* Added the script files and rectified the errors

* folder name changed and commons -lang3 version upgraded

* updated readme.mustache

* updated logging filter

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

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

* updated readme.mustache
2017-12-19 16:12:44 +08:00
Ben Wells
2e348b27f7 [Go-server] Fix formatting of go-server generated code (#7162)
* Add missing go-server petstore batch script

* Make go-server confirm to gofmt
2017-12-15 00:04:48 +08:00
Ben Wells
3c8293bbcf Add missing go-server petstore batch script (#7145) 2017-12-11 12:19:25 +08:00
wing328
8c92d3a27e add erlang petstore server batch file 2017-12-10 10:52:07 +08:00
ehyche
d2a2292d20 Update samples using latest codegen and templates (#7071) 2017-11-29 14:49:45 +08:00
Maxim Zinchenko
a8642dbdfc [Java][Spring][Server] Issue #4680 (#6890)
* Issue #4680 correct values for enum with escaped double quotes

* Issue #4680 regenerate samples

* Issue #4680 remove new lines

* Issue #4680 fixed scripts

* Issue #4680 update samples under CentOS
2017-11-27 18:30:39 +08:00
William Cheng
803f337d24
[Scala][Lagom] rename generator from scala-lagom to scala-lagom-server (#7014)
* rename scala-lagom to scala-lagom-server

* add back pom.xml and shell script

* update scala-lagom-server path in circleci pom.xml

* make shell script executable

* rename batch file
2017-11-21 23:24:02 +08:00
William Cheng
573b5518be
[Scala][Lagom] minor enhancements (#7011)
* rename lagom scala, minor enhancements

* add scala lagom to circle ci

* test sala lagom with jdk8 only
2017-11-21 17:34:09 +08:00
gmkumar2005
32abb72769 [LagomScala] Add Scala API generator for lagomframework #6900 (#6901)
* Initial Commit

* Removed unneeded class, Updated names as per naming conventions, Removed licensing info from  generated code

* Moved samples from client folder to server

* Fixed naming issue with scripts in the bin

* improved code format for api

* fixed compile issue and improved formatting

* fixed compile issue and improved formatting
2017-11-21 15:40:04 +08:00
manuc66
b06ccec11e [csharp] Update JsonSubTypes to 1.1.3 and use nuget dependency (#6969)
* the result I want to obtain

* add csharp-petstore-net-40.bat for windows

* just ran bin\windows\csharp-petstore-all.bat

* Removed those directories:
- samples\client\petstore\csharp
- samples\client\petstore\csharp-dotnet2

then ran :
bin\windows\csharp-petstore-all.bat

* - update JsonSubTypes to 1.1.3 by using nuget dependency (the package is compatible with net40)
- allign all version of Newtonsoft.Json to 10.0.3

* the result of bin\windows\csharp-petstore-all.bat

* ran bin\security\windows\csharp-petstore.bat
2017-11-21 11:26:58 +08:00
Jim Schubert
2c9f98ce38 [csharp] clean boolean additional properties 6784 (#6899)
* [csharp] Convert "false" properties to booleans

It appears as though "false" strings in additionalProperties are no
longer treated as false booleans. This may be an issue elsewhere, but a
simple fix is to always explicitly set the boolean value in a generator
class back to the additionalProperties map to convert boolean Strings to
boolean Objects.

* [nancyfx] Clean up async default option handling

* [nancyfx] Include asyncServer=false in sample script

* [csharp] Regenerate samples

* [csharp] Resolve .net 4 generation issues

Some functionality is missing from .NET 4.0, such as IReadonlyDictionary
and Type.GetTypeInfo().

This commit resolves compilation of generated .NET 4.0 code, requiring
no conditional versioning of Newtonsoft.Json.

* [csharp] Regenerate .net 4.0 sample

* [csharp] Resolve .NET 4.0 sample compile

Sample build.sh wasn't accounting for targeting different FCL correctly.
That is, when passing "net40" to the -sdk option, it would use the
default -sdk:4 and -langversion:6. These don't necessarily match with
what is installed on a machine with only .NET 4.0 (which is our targeted
use case here).

To resolve, we need to define another version-specific value for passing
to the mcs -sdk option (see man mcs for details).

This option currently isn't overridable in the client codegen class.
Also, langversion is set specifically to the version of C# available to
the targeted SDK version. If there is need, we may extend this to
something like:

langversion=${MCS_LANG_VERSION:-6}

To allow users to run as:

   env MCS_LANG_VERSION=5 sh build.sh

I haven't done this because I doubt there's much of a use case via this
script. I'm assuming most consumers will build via IDE or MSBuild.

* [csharp] Revert bin/csharp-petstore.sh to 3.5

* [csharp] Regenerate .NET 3.5 sample

* [csharp] Resolve nuget issue with existing files

* [csharp] Update -all.sh, regenerate samples
2017-11-15 22:36:37 +08:00
wing328
f34aca62f6 skip "all" shell script 2017-11-12 22:42:02 +08:00
Tristan Sloughter
b9651e5775 WIP: initial commit for Erlang client generator (#6502)
* WIP: initial commit for Erlang client generator

* add models types and function type specs

* fix type specs when models are the type and support QS lists

* make method lowercase in postprocessoperations

* add model encode function

* add erlang client sample

* add windows client sample script

* proper return type spec and handle return error messages
2017-11-12 22:02:05 +08:00
afrolovsky
9a44512d03 @JsonProperty annotation for jaxrs-spec server model classes (#6911) (#6916) 2017-11-09 21:46:26 +08:00
Charles Capps
c2eb53ab1d [Java] Templates to support google-api-client library (#6838)
* Add support for the google-api-client

* When there's no return type, just return (no parsing the response)

* Update the deserialization to use a Jackson typeref.

* Delete the auth mustache files as we don't need them

* Stop generating unneeded auth files; get SBT/gradle working with the generated module

* Add builder-style methods to the google-api-client ApiClient for getting API instances

* Update the README to reflect the new client library option

* Generated overloaded methods to send query params as a Map<String, Object>

* Add files for Sample codes

* Add type in angle brackets to support Java 6

* Required query params must be added to the Map of params. Update sample code.

* Use explicit types instead of diamonds to support Java6 in one more place.

* Clean up javadoc warnings in generated code / remove pointless return statements

* Clean up extra newlines in generated code
2017-11-03 18:46:07 +08:00
wing328
1c19891db3 make nancyfx-petstore-server-async.sh executable 2017-11-02 14:04:12 +08:00
craffael
8fec429158 [NancyFx] Support Async (#6755)
* add support for async routes/endpoints

you can now set --optional-properties async=true to generate
a nancyfx server stub that uses asynchronous programming.

(cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4)

* add nancyfx-petstore-server-async.sh to generate sample of async nancyfx.

* Rename async => asyncServer

* update bin/nancyfx-petstore-server-async.sh

* rename async => asyncServer in api.mustache + small bugfix

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh

* remove additional new line in api.mustache + add space after if

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh
2017-11-01 22:50:49 +08:00
ehyche
95ef1bf62e Swift3: properly percent-escape path parameters (#6705)
* Add addiitional files from upstream

* Remove mis-added files

* Swift3: Properly percent-escape path parameters

This change fixes the following issue:

https://github.com/swagger-api/swagger-codegen/issues/6400

The problem was that path parameters were not properly percent-escaped before being placed into the URL path. This leads to creation of an invalid URL, which then fails.

So therefore, in the API template where path parameters are handled, we propertly percent escape them, using the characters which are allowed in URL paths.

In addition to this template change, then this PR includes the following changes:

1. Resulting changes in all generated code due to the above template change.
2. I added the objcCompatible run to the swift3-petstore-all.sh so that I could re-generated all of the generated code with a single script.
3. I added a unit test in UserAPITests.swift which verifies that paths are properly escaped.
4. In order to make the unit test work, then I needed access to RequestBuilder<T>.URLString to verify that the path was properly escaped. However, RequestBuilder<T>.URLString had "internal" access control so it was inaccessible from the unit test. So therefore, I made four contants in RequestBuilder<T> to be public. This should not harm anything, since they are constants ("let's") and cannot be changed from the outside of the class after initialization.
5. There were also some stray changes which look like they were caused by having not run bin/swift3-petstore-all.sh in a while.
2017-10-30 15:40:00 +08:00
wing328
cab4fc0fed add support for csharp net40 (#6792) 2017-10-27 22:47:02 +08:00
Keni Steward
f7471add70 Fixed spacing in model.mustache (#6788)
* Added v4/v4.3 to typescript-angular-petsotre-all and renamed from angular2 to angular

* refactored typescript-angular-petstore-all.sh

* changed profile id for typescript-angularjs to properly have angularjs instead of just angular.

* Spacing at end of model template

* Corrected backwards compatible enum typing
2017-10-24 10:42:03 +08:00
naelrashdeen
b034e4446a [PHP][Symfony] Enhancements (#6615)
* Removed commented code

* Input validation is now supported as strict JSON validation

* [PHP][Symfony] Improve the implementation
Closes #6614

* Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer

* Updated shell script because shippable tests were failing
2017-10-23 22:50:56 +08:00
wing328
f0b7daeec6 [Rust] rename rust2 to rust-server (#6747)
* rename rust2 to rust-server

* update rust-server batch file to use petstore test spec
2017-10-19 20:17:08 +08:00
Benjamin Gill
1d89ab6e08 [New Generator] Rust API client/server generator (#6613)
* Rust API client/server generator

* `Future::boxed()` has been deprecated - replace with `Box::new(...)`

* rebasing to rust

* MMMLS211 use empty vec over none

* MMMLS211 rebuild after merge from rust

* MMMLS211 YAML array examples not wrapped in Some()

* MMMLS211 Array parameters bad mustache fix

* MMMLS211 don't parse map containers

* MMMLS211 Tidy container types

* MMMLS-211 rebuild example

* MMMLS211 mvn rebuild

* Percent-decode parameters contained in the path

* Produce warnings when unknown fields are present

We still accept unknown fields and discard them. However, to improve
diagnosability, we now write a warning log and return a `Warning`
header.

Note that this is server-only

* Markup

* MMMLS211: Make optional arrays Options again

* 211 markups

* Temporary attempt at tweaking Cow ownership tweak while merging changes from rust branch

* Remove to_string call while parsing path parameters, which requires definining a temporary var in a block because rust can't tell where a Cow reference gets dropped

* Fix rustfmt to the correct version

* Fix rustfmt to the correct version

* Add more response information to ApiError in client

* Re-add missing brace

* Code review markups

* Allow converting out of wrapper types

* Store arrays in new-types too

* Use a new hyper_client every request

* Add vec-like traits to array types

* Xml support - new branch

* Moved conversion from serde_xml_rs::Error to ApiError from swagger-rs to client code until upstream PR is accepted

* MMSUB-172 Don't set Content-Type when there's no body.

If we don't have a body we've serialized, then don't declare
any content type for the nonexistent body.

This is really important for 204 No Content responses, but it's
also morally important for all other non-bodied responses.

* MMSUB-172 Move to swagger 0.6.

* Manually implement debug for the client

* Allow `Context` to be bound to `Api`, and not passed on every function call

* Support "." in parameter names

* Support generate's "--reserved-words-mappings" option

* Support "." in parameter names

* Support generate's "--reserved-words-mappings" option
2017-10-19 17:37:02 +08:00
wing328
7f9ae63880 add resteasy-all shell script 2017-10-18 10:39:34 +08:00
wing328
c783ec1d41 update all petstore security samples 2017-10-18 10:10:44 +08:00
Taylor Brown
488aa989bf Adding a new Scala client codegen (#6572)
* Adding a Scalaz codegen client

* Fixing imports and removing commented code

* Adding the bash file and updating the Pet store samples for Scalaz.

* Finalizing Scalaz generation so that it works for the Petstore.yaml

* Removing some unnecessary files and comments

* Removing some files that were accidentally generated for the wrong Scala
2017-10-16 22:07:57 +08:00
wing328
619c391be9 update python flask petstore samples 2017-10-16 11:48:13 +08:00
Esteban Marin
dc88ed99ae [angular-typescript] fix using form data (#6574)
* #6457: fix sending form params

* #6457: fix sending form params using files

* #6457: fix sending form params with files for angular 4.3

* #6457: generate samples

* #6457: [typescript-angular] fix form data submission in IE/Edge

* re-apply [typescript-angular] add customized encoder to use '+' char in query parameter #6306 (#6334)

* adapt for HttpClient: [typescript-angular] add customized encoder to use '+' char in query parameter #6306 (#6334)

* generate samples

* #6457: fix url parameter encoder imports for angular <4.3

* #6457: generate samples
2017-10-10 22:55:50 +08:00
Graham Johnson
1bdb104738 Add Serializable import to JaxRS-spec models if serializableModel is set (#6651) 2017-10-10 22:45:47 +08:00
jarlesat
8a7940f199 Issue 5431 Support jaxrs client api interfaces (#6412)
* Adds the ability to create code for an interface-based jaxrs client.

* Adds shell script and sample files for jaxrs-spec-interface

* rebase into adds shell

* Fixes bug in creation of Produces/Consumes in method annotation. Allows for instance "application/json; charset=utf-8"

* Fixes generated pom.xml

* Generate pom.xml by default

* Prettier output from api.mustache

* Fixes bug in mediatype, allowing charset-specification in swagger.yaml.

* Merges generation of interface-based jaxrs client/api into jaxrs-spec.

* Moves jaxrs-spec server interface to match location of jaxrs-spec server

* Makes Generated-annotation in genereated classes slightly prettier.
2017-10-08 15:28:12 +08:00
Stephane Carrez
cdc83ffd16 [Ada] Adding Ada client samples (#6634)
* Add Ada client petstore samples
- Add script to generate Ada client support with swagger-codegen
- Add files to build the Ada sample
- Add main program to use the generated client samples API
  and connect to the server to perform some operations

* Add some description for the samples

* Update the documentation to explain how to build, how to use the generated Ada client code
2017-10-08 12:16:23 +08:00
wing328
bf74e33c52 rename CsharpDotNet2 to csharp-dotnet2 (#6611) 2017-10-04 00:03:35 +08:00
wing328
5175281f32 rename silex-PHP to php-silex (#6612) 2017-10-03 23:46:56 +08:00
Pierre Deman
74e31699da CsharpDotNet2Client - Use clientPackage in additionalProperties (#6581)
* CsharpDotNet2Client - Use clientPackage in additionalProperties if provided

* Give execution rights for csharp-dotnet2-petstore.sh

* Fix generation of C#.net2 apiPackage, modelPackage, clientPackage

* Fix modelPackage property missing when generating models

* Initialize clientPackage in constructor
2017-10-03 16:58:27 +08:00
Jon Schoning
8bd7d3912b [haskell-http-client] fixes for fake-endpoints (#6597)
* fix compile errors / sanitization for petstore-with-fake-endpoints-models-for-testing.yaml
* correct mimetype logic
* add makefile
2017-10-01 18:18:46 +08:00
Adrian Moos
da37f40202 Add optional support for HttpClient (#6295)
* fix compilation error in eclipse

by updating package declarations in moved files
(eclipse validates that package and folder names match)

* permit specifying the full angular version

simplifying the templates by moving trivial case splits to the model

* remove dead code

this method is never called ...

* support HttpClient in addition to Http, clean up generated code

Fixes #6080

* added new sample, and regenerated existing samples

* updated samples

this time with the freshly build generator ...

* improve formatting

* updated samples

* fix compilation error in generated code

the overload for blobs does not have a type parameter

* added the first test for the utils package

* fix extra trainling commas in function argument lists

* regenerated samples
2017-09-30 17:19:39 +08:00
wing328
2c7dcbe3e5 fix elixir model naming 2017-09-28 09:55:53 +08:00
wing328
f5bc5ecc04 [Scala] Decommission "async-scala" generator (#6552)
* remove async-scala generator

* remove async-scala related scripts
2017-09-24 16:43:42 +08:00
Jon Schoning
4fb612c2e8 [haskell-http-client] update documentation; refactoring; add 'strictFields' cli option (#6458)
* update readme; remove unused DeriveAnyClass extension

* refactor request/param utility functions

* add strictFields cli option

* add CONTRIBUTING.md
2017-09-09 17:11:46 +08:00
manuc66
a41e8bed97 [csharp] Support inheritance instead of duplicating parent properties in derived classes (#5922)
* [csharp] Explicitly set supportsInheritance

* [csharp] set supportsInheritance for client

This includes supportsInheritance only for the client codegen at the
moment, because setting in AbstractCSharpCodegen would require the
change to be tested in all derived generators, possibly including
similar template changes to this commit's.

* include nice improvement of https://github.com/jimschubert/swagger-codegen/tree/csharp/3829 and leverage https://github.com/manuc66/JsonSubTypes for subtype deserialization

* remove duplicate base validations

* remove useless tests

* restore documentation for properties coming from parent

* launch bin/security/csharp-petstore.sh

* it's impossible to call an explicitly implemented interface-method on the base class
(https://stackoverflow.com/questions/5976216/how-to-call-an-explicitly-implemented-interface-method-on-the-base-class)

* restore portion of code that was lost

* regenerate more

* fix missing using

* take the multi .net compatible revision

* keep generated model simple when no hierarchy involved

* regenerate with:
- bin/csharp-petstore-all.sh && bin/security/csharp-petstore.sh
- bin/csharp-dotnet2-petstore.sh && bin/csharp-petstore.sh && bin/csharp-petstore-netcore-project.sh && bin/csharp-petstore-net-standard.sh && bin/csharp-property-changed-petstore.sh

* fix sln indentation and the missing windows runner for dotnet2

* fix inheritance GetHashCode and Equals

* override instead of hiding the base method
+ fix the csharp-property-changed-petstore.bat

* By default the value of the discriminator property must be the name of the current schema

* Add test for subtype deserialisation from parent type

* add missing '.bat' and use the 'call' template from javascript-petstore-all.bat

add missing file to trigger it on windows

* fix default value bug

* cleanup copyright information

* formatting after merge

* fix merge

* applying bin/csharp-petstore-all.sh

* applying bin/security/csharp-petstore.sh
2017-09-06 17:22:20 +08:00
Jon Schoning
c7d145a4ba add haskell-http-client-generator (#6429) 2017-09-06 00:33:48 +08:00
wing328
a4c0975aa4 [R] Add new R client generator (#6351)
* add r client codegen

* update r api, model templates

* various fix

* rename Json to JSON

* more enhancements

* fix json handling

* add file upload support, var name to handle hyphen

* use httr::upload_file
2017-09-04 00:21:32 +08:00
Ahmed Charles
60766c6210 Make the Rust codegen compile. (#6411)
* Use the right package name for the Rust crate.

* Change getters on models to return Option for non-required fields.

* Cleanup Rust generation and get example compiling again.

* Use underscore names for functions.
2017-09-02 00:06:55 +08:00
lukoyanov
a2c4f0baf4 [Java] Implemented support for Play! 2.5.x (java8) for retrofit2 client (#6007)
* Implemented support for Play! 2.5.x / java8

* Added petstore sample for play25

* implemented play25 support
implemented version switch via playVersion config option

* fixed compilation failure after merge

* Disabled generation of CustomInstantDeserializer if dateLibrary equals to java8
2017-08-31 23:02:09 +08:00
David Fischer
506c58ec74 [JaxRS] Fix response annotation generation (fixes #2588) (#6373)
* [JaxRS] Fix response annotation generation (fixes #2588)

* [JaxRS] Fix jaxrs jersey1 usetags sample provider

* Revert "[JaxRS] Fix jaxrs jersey1 usetags sample provider"

This reverts commit 73fef2e451e376b23f6c1d43d8781f0b4a0bd1f5.

* [JaxRS] Fix jaxrs jersey1 sample generator

* [JaxRS] Fix samples for jersey1 and jersey2

* [Server: Java] Fix diamond operator defaultValue for Java < 1.7
2017-08-30 00:31:56 +08:00
wing328
d8fcedadbe rename ts angular batch files 2017-08-28 18:45:17 +08:00
wing328
ccfe7f5cbf minor fix to ts angularjs bin script 2017-08-28 18:36:37 +08:00
Damien Pontifex
14f0375bdd Codegen class rename for Angular and AngularJS to reflect naming guidelines (#6109)
* Rrename for angular and angularjs to reflect naming guidelines

see http://angularjs.blogspot.com.au/2017/01/branding-guidelines-for-angular-and.html
- move makes typescript-angular -> typescript-angularjs
- move makes typescript-angular2 -> typescript-angular
Language string with generate was already this so generation shouldnt change
but class naming follows this convention now

* Fixing merge problems
2017-08-28 18:32:50 +08:00
Yusuke Tsutsumi
8bdaf493dd implemented tornado-based client. (#6367) 2017-08-28 15:10:06 +08:00
Isman Usoh
3ecc374682 [Typescript-Fetch] Support additionalproperties, Enum, Auth and more. (#6130)
* Support additionalproperties and more.
- Upgrade to TypeScript 2
- Use type definition from npm instead of typings, typings is deprecation
- Use Enum instead of String Literal Types
- Use typescript es6 lib for target es5
- Support additionalproperties
- Support JSDoc
- Add snapshot and npmRepository option
- Update typescript-fetch run script for linux
- Create typescript-fetch run script for windows

* Update and fix
- Fix circle run script
- Fix duplicate query parameter

* Rename typescript-fetch folder to lowercase

* Fix for review and update new line end of file

* Fix end of file

* rename script to {lang}-petstore-all.sh and fix test

* Fix override query string
https://stackoverflow.com/a/7517673/1077943
2017-08-25 23:26:32 +08:00
lukoyanov
936c586df3 fixed error handling (now retrofit2.HttpException is thrown instead of RuntimeException on API error) (#6302)
value adapter now supports both F.Promise<Model> and F.Promise<Response<Model>> in retrofit interface
switched dataLibrary to java8
2017-08-15 16:03:19 +08:00
Yusuke Tsutsumi
d39b1ff76f [python] asyncio support (#6245)
* trying an approach with providing asyncio as a framework.

* adding example of asyncio.

* removing sample client to help PR look more manageable.

* possibly fixing a unit test

* getting unit test to pass again.

* addressing comments.
2017-08-14 16:16:55 +08:00
wing328
71123e157e [Java][JAX-RS] Add Petstore samples with "useTags" option (#6300)
* add samples for jaxrs (jersey1,2) usetags

* fix duplicated id
2017-08-12 22:05:25 +08:00
wing328
06686d65fa [Lua] Add new Lua client generator (#6252)
* 1st commit of lua generator

* add petstore sample

* various fixes based on feedback

* better return handling

* check status code 1st letter

* add support for query parameters, auth, body param

* more fixes based on daurnimator feedback

* more fixes based on daurnimator feedback

* fix a few more issues found by luac -p

* use lower case for http header key name

* more fixes based on feedback

* update lua sample

* skip auto-generated readme, doc, test files

* use tab instead of 2-space

* fix container return type

* fix cast method call

* fix cast function call
2017-08-11 01:41:29 +08:00
wing328
5d263e1c9c set java-play-framework-petstore-server-fake-endpoints.sh to executable 2017-08-10 01:19:58 +08:00
Jean-François Côté
1e991be5f3 [JavaPlayFramework] Fix for issue #6100 (#6128)
* Fix issue #6100. Tested with all the samples.

* Fix multiple issue with the examples. Removing all of this.
Adding fake endpoint .sh but it is not compiling right now.
2017-08-09 22:00:46 +08:00
wing328
43e53dadda remove old petstore powershell sample 2017-08-07 15:41:30 +08:00
wing328
4cb7f1d613 [Rust] add new Rust client generator (#6105)
* add rust generator (1st release)

* update based on feedback

* fix reserved keyword

* fix string parameter

* Convert String to &str in trait definition

* Only pass pathParams to uri builder

* Fixed the html escaping in return type

* Fixed the hashmap constructor

* Added models into API scope

* removed models subimport, reference from super

* update returntype in method signature

* Fixed the remaining templates inconsistencies

* Fixed issues that floated up in kubernetes swagger file

* add hash support, fix docstring

* fix map parameter, update api.mustache

* use baseName for parameter

* use fully-qualfiied model name

* add rust tests

* fix test cases

* Rust gen slightly more idiomatic (#6247)

* Go -> Rust in README

* Remove leftover go file in rust sample

* rust: Regenerate sample

* rust: Rename *Impl -> *Client

* rust: one-line use line

More in line with common style

* rust: Replace tabs (in java) with 4 spaces

* Added trivial getter implementation (#6249)

* update rust petstore samples
2017-08-06 16:59:08 +08:00
Javier Velilla
e4276853d7 Fixed typo in the Abstract Eiffel class. (#6239)
Fixed typo in shell script
Added support for Outer Enums, inner enums not supported.
Added missing UUID library in ecf template.
Improved Model inheritance.
2017-08-05 00:38:50 +08:00
ehyche
32906ea7ce Add Objective-C compatibility for Optional scalars in swift4 just as we added in swift3. (#6158)
This change adds Objective-C compatibility for Swift Optional scalars in the swift4 language just like we added in swift3 here:

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

It also adds unit tests for the swift4 language. Currently those unit tests are the same as the swift3 unit tests, but will change soon as we iterate on the swift4 language generator.
2017-08-02 21:19:48 +08:00
ehyche
dd46ba9ef6 Add additional cli option and properties to swift3 for Objective-C compatibility. (#6129)
Currently, in the swift3 language, if you have an optional integer, number, or boolean property in a model, then the generated swift3 model class might look like:

class SomeModel {
    var someInt: Int?
    var someFloat: Float?
    var someDouble: Double?
    var someBool: Bool?
}

This works fine if you are accessing this model only from Swift code. However, it is very common for iOS codebases to contain both Swift AND Objective-C. If you need to access this model from Objective-C, then those 4 properties are not accessible, since Optional scalars do not translate to Objective-C.

Therefore, in the swift3 language, we want to add some code for Objective-C compatibility:

1. We add a "objCompatible" boolean command-line option. If objCompatible=true, then this enables some additional code generation to make these types of properties accessible from Objective-C. If objCompatible=false, then the generated code is exactly as it currently is. The default is objcCopmatible=false.

2. If objCompatible=true, then for these types of Objective-C-inaccessible properties (Optional scalars), then we add a "x-swift-optional-scalar=true" vendor extension in the CodegenProperty.

3. Then, in the model.mustache template, if we see x-swift-optional-scalar=true, then we add an additional computed property which returns an optional NSNumber.

So, for example, when objcCompatible=false (the default case), then the generated code for the "declawed" property of the Cat model looks like:

open class Cat: Animal {

    public var declawed: Bool?

    ...

But when objcCompatible=true, then it looks like:

open class Cat: Animal {

    public var declawed: Bool?
    public var declawedNum: NSNumber? {
        get {
            return declawed.map({ return NSNumber(value: $0) })
        }
    }

   ...
2017-08-02 18:20:01 +08:00
lopesmcc
66d48a0c71 [Java-VertX] Java Vertx client (#6204)
* #6165 - Java Vertx client

* #6165 - Java Vertx client (samples)

* #6165 - Java Vertx client (tests generation)

* #6165 - Java Vertx client (fixed test samples)
2017-07-31 20:04:11 +08:00
wing328
64658f0bea update eiffel petstore 2017-07-25 00:03:15 +08:00
Jean-François Côté
bf327519b8 Add support for endpoint examples. Right now it doesn't work because {{{example}}} is always empty (#5775) 2017-07-23 22:45:30 +08:00
wing328
e916a769ca update ts script to use petstore.yaml, add
typescript-aurelia-petstore.bat
2017-07-23 16:02:34 +08:00
wing328
188e998683 add petstore samples for typescript aurelia 2017-07-23 15:52:02 +08:00
wing328
a4d67d9115 minor fix to typescript-jquery batch file 2017-07-23 02:00:53 +08:00
wing328
6c922fdae1 Squashed commit of the following:
commit b33232e52b9642e9edf724429dc99afe39d9df07
Merge: e3a1e30 3e76185
Author: wing328 <wing328hk@gmail.com>
Date:   Sun Jul 23 01:38:09 2017 +0800

    Merge branch 'add-petstore-support-typescript-jquery' of https://github.com/StingrayDigital/swagger-codegen into StingrayDigital-add-petstore-support-typescript-jquery

commit 3e76185d906d8b53cc3e7a198546b9e111a0cca4
Author: Jean-François Côté <jcote@stingray.com>
Date:   Thu Jul 20 13:50:01 2017 -0400

    Add working npm generator.

commit 5c27df7c4822fed10ddb81b8a35f60ca40b60914
Author: Jean-François Côté <jcote@stingray.com>
Date:   Fri Jul 7 14:39:39 2017 -0400

    Fix suggested by @wing328 's review

commit 41da37b3576a82ad6056434d36e9d579ef495492
Author: Jean-François Côté <jcote@stingray.com>
Date:   Wed Jul 5 15:47:40 2017 -0400

    Add petstore integration and updated sample
2017-07-23 01:39:36 +08:00
Javier Velilla
fa73e56c17 Enhancements to the Eiffel generator #6057 (#6138)
Added shell scripts, batch files to generate Eiffel Petstore samples.
Added Setup CI (travis, shippable, etc) to cover the Eiffel Petstore samples.
Refactored part of the code into an Abstract Eiffel base class,
which can be later used in Eiffel server stub generators.
Added Eiffel Style guide to the contribution guidelines so that Eiffel contributors know what to follow in terms of code style
Fixed code generator issues.
Updated mustaches templates.
2017-07-22 16:55:45 +08:00
ehyche
2be2ee080b Fixes for swift4 language (#6116)
* Fix build error in Xcode 9 beta 3, as .compact is no longer defined

* Add test schema for Swift 4 and associated script and config files

* Add test app for swift4Test.json schema

* Make integer, Integer, int, and Int32 types map to Swift Int type instead of Int32 type

* Add CodingKeys to model template, which allows us to serialize/deserialize variable names that are different than property names

* Make updates to Swift 4 test schema

* Fixes for unit test app for swift4Test.json Swift 4 test schema
2017-07-20 15:45:09 +08:00
Jean-François Côté
bca35f6645 Fix for issue #6094 (#6121) 2017-07-20 15:42:56 +08:00
wing328
f999936c1d [JAX-RS][RESTEasy] Add Petstore integration tests for RESTEasy EAP (java8) (#6091)
* add petstore integration tests for resteasy eap java8

* update circle pom.xml
2017-07-17 23:25:38 +08:00
wing328
2502c376a4 add batch files for python flask 2017-07-17 15:28:15 +08:00
wing328
11d9cbd597 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-16 16:10:08 +08:00
wing328
c1825b417c use html-escaped description for C# (client, server), Java server (#6061) 2017-07-14 23:36:24 +08:00
wing328
ddf9db3148 fix window batch scripts after ts angular generator rename 2017-07-14 17:45:56 +08:00
wing328
094dbd00ed Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-13 23:35:22 +08:00
Isman Usoh
fdaf8ea65f [Typescript-Angular2] add @summary JSDoc tag (#6028)
* add @summary JSDoc tag

* updatee sample and create windows script for typescript-angular2

* Fix for Review
2017-07-13 23:33:08 +08:00
wing328
6b07af8d4e [TypeScript] rename Angular, Angular2 generators (#6046)
* rename ts angular, angular2, update scripts

* update angular4 script
2017-07-13 23:24:21 +08:00
wing328
e964702550 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-12 21:54:23 +08:00
mobreza
5d32edd964 Java support for application/xml (#5962)
* WIP: CodegenProperty with XML

* WIP: CodegenModel XML bits

* WIP: Jackson XML

* WIP: Java templating

* WIP: Java client withXml flag

* WIP: resttemplate work

* WIP: withXml only when Jackson is used

* WIP: Tabs to spaces

* WIP: java-petstore-resttemplate-withxml sample

* WIP: language: spring

* WIP: language "spring" using library "spring-boot" should include apiPackage in @ComponentScan to detect the API

* WIP: javax.xml for non-Jackson Java and enabled payload logging for jersey2

* WIP: updated java petstore samples

* WIP: JavaSpring with non-jackson XML

* WIP: bin/spring-all-pestore.sh
2017-07-11 17:01:51 +08:00
wing328
929627722a make java vertx shell scripts executable 2017-07-10 23:52:10 +08:00