Commit Graph

5023 Commits

Author SHA1 Message Date
wing328
8d0c7128b0 add option to specify c# client path in powershell generator (#5887) 2017-06-21 00:58:29 +08:00
wing328
e53b3a03aa [PowerShell] Add PowerShell API client generator (WIP) (#5789)
* add powershell generator (wip)

* minor fix to api template

* rename model files

* Powershell generator fix (#11)

* Fix typo

pacakge -> package

* Add missing `petstore` subfolder to $ClientPath

* Resolve $ClientPath to absolute path

Start-Process needs WorkingDirectory to be absolute

* Fix spaces in variable name

${ somevar } is a vairable that literally has spaces in name. We need to
temporarily redifine mustache delimiters so we can generate var. names
without spaces.

* Fix typo

Remove stray `r`

* Fix *.ps1 import in module

Directory structure has changed + we should export functions using
manifest.

* Remove erroneous file

* various fixes and enhancements

* remove nullable for string

* change function name based on feedback by beatcracker

* set index to start at 0

* fix file type

* Powershell generator fix 1 (#12)

* Add closing curly brace

* Fix duplicated '['

* Get FunctionsToExport using AST

Discussion: swagger-api/swagger-codegen#5789

* add guid option to powershell generator

* add test files, remove docs

* fix array of items

* clean up powershell comment, update model/api test files
2017-06-20 22:20:05 +08:00
Vlad Frolov
c26b5a1e1b [JavaScript] Fixed *WithHttpInfo methods in 'usePromises' mode to be ES5 compatible (#3654) (#4902) (#5871) 2017-06-20 16:27:07 +08:00
Vlad Frolov
3546361b33 [JavaScript] Added README section for Webpack configuration (howto disable AMD) (#3466) (#5872) 2017-06-20 16:25:06 +08:00
stkrwork
8ab2b84c97 [CPP] [CPPREST] first steps on fixing the template (#5877)
* - Added Restbed Generator

* - Added Json processing functions to model
- Removed unnused code from restbed codegen class
- Added response header processing to api template

* Changed it to respect alphabetical order

* Made the string joining java 7 compatible

* Added samples

* First step in fixing the cpp rest template
regenerated new samples

TODO: Fix the other functions

* Updated samples
2017-06-20 01:29:42 +08:00
sabras75
24c55d1f0e Fix#5856 - Add support for PATCH (#5875)
* Changing QBuffer to use a QByteArray solves the issue for me since there is no real use-case for using a QBuffer.

Documentation of QT5 states:

QBuffer::QBuffer(QByteArray *byteArray, QObject *parent = Q_NULLPTR)

Constructs a QBuffer that uses the QByteArray pointed to by byteArray as its internal buffer, and with the given parent. The caller is responsible for ensuring that byteArray remains valid until the QBuffer is destroyed, or until setBuffer() is called to change the buffer. QBuffer doesn't take ownership of the QByteArray.

Since the variable “request_content” is allocated on the stack, this is clearly wrong and a bug. The construction of QBuffer is designed this way so that whenever you write to the buffer, it is also written to the byte array that it is pointing to

* Add a retro-compatible solution based on QNetworkAccessManager SourceCode

* update samples
2017-06-19 23:08:32 +08:00
stkrwork
981ad60050 [C++] [Restbed] Reworked the model template for restbed to create generic models (#5873)
* - Added Restbed Generator

* - Added Json processing functions to model
- Removed unnused code from restbed codegen class
- Added response header processing to api template

* Changed it to respect alphabetical order

* Made the string joining java 7 compatible

* Added samples

* - Reworked the getter setter generation
2017-06-19 22:56:01 +08:00
wing328
3a32857790 PR to roll back #5569 (#5868) 2017-06-19 11:19:21 +08:00
wing328
84334146f9 better code format for cpprest 2017-06-19 09:59:19 +08:00
wing328
3808d67953 move javascript-es6 templates under subfolder in Javascript 2017-06-19 01:28:39 +08:00
Kevin Murphy
6fef7acf9f [javascript] Fix usages of exports in generated ES6 code (#5835) 2017-06-19 00:28:12 +08:00
Kevin Murphy
aa37b9747f [javascript] Use arrow function with usePromises in ES6 ApiClient.js for superagent callback to preserve this context (#5814) 2017-06-19 00:27:52 +08:00
Ahmet Taha Sakar
3ced146a65 Swift3 configuration (#5725)
* added headers to makeRequest function for swift3 template

* Added configuration file to Swift3 template

* added comments about the value read only once

* added comments about the value read only once

* comments fix

* Added Configuration.swift to Project File

* swift 3 promisekit, rxswift updates
2017-06-17 00:25:03 +08:00
wing328
f27143fc08 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-06-16 23:15:45 +08:00
wing328
0bb610494e Merge branch 'user/shawkins/fix/dont_modify_parameter_names' of https://github.com/shawkinsl/swagger-codegen into shawkinsl-user/shawkins/fix/dont_modify_parameter_names 2017-06-16 23:12:17 +08:00
Paŭlo Ebermann
ec448a6167 [CLI] #5147: make -D work like system properties (#5191)
* Issue #5147: allow empty values for properties.

* Issue #5147: Allow multiple `-D` options.

* Issue #5147: take advantage (and demonstrate) the new usage of -D.

* Issue #5147: also update windows script and security ones.
2017-06-16 17:29:44 +08:00
miguelvaladez
85850b2846 Feature/es6 angular (#5495)
* module code added for es6-angular client code generation

* typescript wiped out the core gitignore file

* added USE_ES6 cli option to javascript-closure-angular, will use the javascript-es6-angular templates instead

* fixed issue with module file

* added annotations to the templates

* moved default output folder declaration

* moved es6 template folder under closure-angular
2017-06-15 16:44:34 +08:00
Elizabeth Thomas
b752c0a030 Adding the generator version template to api mustache file (#5691) 2017-06-15 13:59:42 +08:00
wing328
5c10e24337 use file.separator instead of "/" (#5846) 2017-06-15 00:55:47 +08:00
Moscagus
f2276e5b35 Fix for issue #5777 - java/jersey2 ApiClient.invokeAPI doesn´t close the Response object (#5782)
* Update ApiClient.mustache

Fix for issue #5777

* Update ApiClient.mustache

* Create ApiClient.mustache

* Run java-petstore-jersey2.sh
2017-06-15 00:45:14 +08:00
wing328
77c14bca39 use file.separator, minor code format enhancement (#5844) 2017-06-15 00:10:32 +08:00
wing328
c74fc6e0ee Merge branch 'master' of https://github.com/JuH33/swagger-codegen into JuH33-master 2017-06-14 23:23:24 +08:00
JuH33
e0d7c7dbd5 Html2 speed Up | Raw html using java parser instead of JS parser 2017-06-14 17:06:53 +02:00
Sebastiano Miano
e66eceeaaa [C++] Server Stub Code Generator based on Pistache (#5838)
* Added C++ generator for Pistache

* Revert of CodegenOperation

* Updated template

* Removed isRestful from method declaration

* Updated httpMethod variable

* Changed isRestfulCreate
2017-06-14 22:40:00 +08:00
wing328
d6c717263c [Python] add project name to setup.py in python client (#5836)
* add project name to setup.py in python client

* update python README to use project name

* add cli option project name for python
2017-06-14 00:18:54 +08:00
Alex Chauvin
b61dfefa5b serverPort add from cli (#5821)
in order to change the serverPort from the codegen cli
2017-06-13 15:57:55 +08:00
mmosemmle
62db9a09ee Fix issue 5793 (#5794)
* cast character to string.

* Check if variable name is reversed.

* Guard against reservedWordsMappings.
2017-06-11 22:06:19 +08:00
Cliffano Subagio
dc7c1f8cb9 [JS] Fix JavaScript string return type (#5819)
* [javascript] Fix response body when return type is String.

* [javascript] Regenerate javascript petstores with fixed String return type.

* [javascript-es6] Fix response body when return type is string.
2017-06-11 21:42:36 +08:00
manuc66
c5335081ea fix the mustache file (#5736) 2017-06-11 15:34:09 +08:00
wing328
7cddd17acc [Java] Add JSON-patch support to other Java API clients (#5808)
* add JSON-patch support to other Java API clients

* minor fix to java jersey1 json check
2017-06-09 21:46:40 +08:00
Brendan Burns
53bd931f5c Add JSON-patch as a JSON mime-type (#5764) 2017-06-09 16:47:38 +08:00
Björn Petersen
e9a0d7ea83 Add android dependency to pom if 'parcelableModel' is set (#5801) (#5802)
* Add android dependency to pom if 'parcelableModel' is set

* Update java-okhttp-gson-parcelableModel sample
2017-06-09 16:16:53 +08:00
Mads Hvelplund
8f7e2a1563 Allow overriding the service delegate (#5662)
* Added support for injecting service implementations via web.xml

* Updated samples
2017-06-09 16:09:27 +08:00
Jim Schubert
dabf01c3fa [kotlin] support collection format multi (#5792)
* [kotlin] support collectionFormat:multi

Adds "multi" support to collections.

Also changes generic lists (List<T>) to arrays. Generic lists and nested
lists can be problematic and require customized json factories. The
previous implement appeared to work because the results in the test were
LinkedHashMap with count greather than 0. The functional test has been
updated to force serialization and verify the results.

* [kotlin] Regenerate sample

* [kotlin] Update model test for Array changes
2017-06-09 15:40:18 +08:00
harishchoragudi
2d008be181 Fix for issue#5788 -CPPRest generated models are not using inheritance as specified in contract (#5791)
* fixed map to use value instead of mapentry while doing fromJson.

* cpprest models now use inheritance properly instead of always extending from ModelBase

* cpprest models now use inheritance properly instead of always extending from ModelBase

* removed a sysout used for debugging

* toJson() and fromJson() now leverages parent class's corresponding methods

* virtual is not needed as override essentially does the same thing.

* added docstring for getModelByName

* corrected the javadoc

* fixed @param issue in javadoc

* fixed @param uncapitalized P in param in javadoc
2017-06-09 01:41:20 +08:00
Romain d'Alverny
73f5266596 [Swift3] Set more liberal Swift3 decoder, behind lenientTypeCast option (#5795)
* [Swift3] Add lenientTypeCast option

When set to true, this generates a client JSON decoder
that will accept and cast mistyped values.

Here:
 - String => Bool ("true" instead of true),
 - String => Int ("123" instead of 123),
 - NSNumber => String (123 instead of "123").

The point is to allow the same client code to handle several
server implementations that may (sadly) not be up to spec,
or still be "evolving".

The conversion is not guaranteed if the input

Not a perfect/complete solution, not sure if it should be
activated along other casts, so kept behind an option.

* Update Petstore client code
2017-06-08 09:10:21 +08:00
Ralph Langendam
ec19e8f407 Fixed minor compiler error and warning (#5762)
* 5762 Fixed minor compiler error and warning

* 5762 Regenerated cpprest petstore client
2017-06-07 18:37:45 +08:00
Julien - JuH
9f81aa4bfc StaticHtml2Gen | Speed up appDescription rendering (#5722) 2017-06-07 18:35:17 +08:00
Trent Albright
676e2a04f5 Fix issue with buffered sink handling in OkHttp (#5786)
* Fix issue with buffered sink handling in okhttp

Fixes unexpected end of stream exceptions when using the okhttp-gson library
and making asynchronous calls.

* update petstore samples for okhttp-gson

$ ./bin/java-petstore-okhttp-gson.sh
$ ./bin/security/java-petstore-okhttp-gson.sh

* WIP: trigger ci
2017-06-07 18:15:06 +08:00
Jean-François Côté
ccf2f2ff07 Add basic support for collection. (#5776) 2017-06-07 17:12:30 +08:00
Vlad Frolov
6a986975e4 [javascript] Fixed fs files support for Electron (#5765) 2017-06-07 17:01:47 +08:00
Kevin Murphy
6239ec0807 [javascript] Mark "fs" package as absent in browser in package.mustache (#5768) 2017-06-06 17:09:50 +08:00
Kevin Murphy
9b93d3363f Fix bug in ES6 ApiClient.mustache (#5766)
ES6 static properties cannot self-reference.
2017-06-06 16:19:35 +08:00
Kevin Murphy
151d1b2783 [javascript] Fix documentation for ES6 ApiClient (#5783) 2017-06-06 16:03:36 +08:00
wing328
faf082589d Enable Travis CI tests for Swift, ObjC clients and move some tests to CircleCI (#5687)
* enable travis CI tests for swift, objc, move some tests to circleci

* fix comment in xml file

* use xcode8.3

* use ruby 2.2.5

* fix objc core data pom.xml

* use cocoapods 1.2.1

* use xcpretty for clearer test results

* fix pom with relative path to script

* comment out objc test

* fix xcpretty exit code

* add && exit ${PIPESTATUS[0]} for swift3 xcodebuild script

* use xcode 8.2

* update promisekit version for swift 2x, 3x

* add pod repo update

* remove Pods directory

* update swift dependencies to the latest version

* update podfile.lock

* rollback Alamofire to 4.0 for swift3

* fix swift3 rxswift api cliiet

* fix testDeletePet test in Swift3 rxswift petstore

* update clojure petstore

* comment out clojure test in travis (already covered in circleci)

* run pestore server locally

* use wing328/swagger-samples to run petstore

* run petstore server in the background

* test ruby petstore client

* add /Users/travis/.cocoapods/repos/master to cache

* add back ruby test, use public pestore server

* add back bash client test

* add npm config set registry to avoid time out

* use docker branch in swagger samples

* remove bash test

* show go version, reorder

* debug go petstore client

* reinstall go

* comment out pod repo update

* uncomment pod repo update

* test go in circleci

* remove go from travis test

* brew install sbt
2017-06-05 15:43:20 +08:00
Zack Lemmon
f3da691a72 Fix typo in Ruby examples/mustache files (#5773) 2017-06-05 11:19:29 +08:00
wing328
4fd52d17c5 minor build warning fix for C# client 2017-06-05 01:05:19 +08:00
Jim Schubert
bc8fe0fd03 [csharp] date proper format (#5734)
* [csharp] Honor Swagger/OpenAPI 'date' format

Per spec
(https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types),
DateTime instances defined as 'date' datatype need to be serialized as
defined by full-date - RFC3339, which has the format:

full-date       = date-fullyear "-" date-month "-" date-mday

ref:
https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14

see #5513
see #5531

* [csharp] Regenerate sample

* [csharp] Include date format test
2017-06-05 00:57:00 +08:00
Arne Jørgensen
d5b3cc0534 [PHP] Fix date format serialization (#5754)
* [PHP] Honor Swagger/OpenAPI 'date' format

Per spec
(https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types),
DateTime instances defined as 'date' datatype need to be serialized as
defined by full-date - RFC3339, which has the format:

full-date       = date-fullyear "-" date-month "-" date-mday

ref:
https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14

see #5531
fixes #5607

* [PHP] Add `date` and `date-time` serializer tests

See #5531
See #5607

* [PHP] Improve codestyle of generated code

* [PHP] Regenerate PHP Petstore sample

* [PHP] Regenerate PHP Security sample
2017-06-05 00:47:56 +08:00
davidgri
00f2dc422d Issue5613 (#5616)
* Fixed Issue5162 consumes in GET-Methods

* Fixed Issue5613

* Ran the shell scripts under bin

* Tab removed
2017-06-05 00:38:43 +08:00