Commit Graph

4912 Commits

Author SHA1 Message Date
Akihito Nakano
c9b934147a [PHP] Escape media type (#615)
* Move escapeMediaType() to AbstractPhpCodegen

* Escape media type

* Update samples

- bin/php-lumen-petstore-server.sh

* Refactoring: remove unused 'import'
2018-07-26 21:26:01 +08:00
sunn
65bad61abb [Qt5 Server] Add Support for Qt5 server using QHttpEngine (#322)
* Initial wiring to get the QHttpEngine Server running for Qt5 server

* Add wiring for build environment

* Add current generated files

* Update README.md

* Solved Build for Docker and Host
Wired up main
TODO : Route API call to handlers

* Wire up routes

* Wiring up routes update

* Convert Path to QHttpEngine format

* Rename some files

* Extract query Parameters and path parameters

* Removed pri file, Qt can read CMakeLists.txt

* Initial support of deserialization

* Adding initial support for response serialization

* Setup simple signal handler to quite the server with Ctrl+C in a container and on the host

* Remove unneeded function

* Add executable permission to script and move from Debian to Alpine for Dockerfile

* Add stringValue of missing types

* Unify toJson'xxx' APIs the same way like setValue

* Rework to remove all pointer usages, pass by const references, simplify model, add emit signals to default handlers
2018-07-26 18:30:13 +08:00
Jérémie Bresson
a8e8acead7
[java] add useNullForUnknownEnumValue option (#633) 2018-07-26 11:00:45 +02:00
Jeremie Bresson
70cdd27e75 Merge remote-tracking branch 'origin/master' into 3.2.x 2018-07-25 16:51:19 +02:00
William Cheng
86d7009f4c
replace tab with spaces, fix empty spaces in new lines (#632) 2018-07-24 17:30:54 +08:00
Daniel Miller
530065137d [cpp-restsdk] Generate mockable APIs (#595)
* Port GMock feature from NativeInstruments

swagger-codegen fork:
https://github.com/NativeInstruments/swagger-codegen/pull/9

* Update petstore for Mockable APIs

* Fix shared_ptr in templates for File params

* Add guards in templates for GMock APIs

* Regenerate samples without GMocks

* Add useful constructors for GMock APIs

* Add constructors to API header interface

* Update samples with explicit monadic constructors

* Add default implementations for destructors
2018-07-24 15:31:21 +08:00
Euan Kemp
2e6bec7345 [Rust] Split out request logic, implement form parameters (#528)
* [Rust] Move request logic into standalone file

This reduces the number of variables which are used in the generated
operations, thus fixing #512.

This also fixed a TODO related to URI parsing errors.
Other than that, it is meant to be functionally identical.

* [Rust] Add support for non-file form params

Up until now, they just weren't there at all

* [Rust] Use more rustic terms in example
2018-07-23 23:10:53 +08:00
William Cheng
667e3130fe Merge remote-tracking branch 'origin/master' into 3.2.x 2018-07-23 23:04:28 +08:00
Benjamin Gill
a9961a062a [rust-server] Drop file support (#547)
* [rust-server] drop 'file' support

In swagger v2, we had 'binary', 'byte', and 'file'. OpenAPI v3 only has
the former two. This commit drops the old 'file' handling. This has the
side-effect of removing a half-complete implementation of form parameter handling.

This removes the ability to send files as streams, so will make life
harder for those wishing to send large files without running out of
memory.

* Remove all remaining uses of `hasFile`
2018-07-23 18:46:35 +08:00
William Cheng
5328f103da
Add C++ Pistache petstore server to Travis CI (#616)
* test cpp pistache petstore in travis

* make build_petstore executable

* add submodule update init

* use addExternalLibs option

* update samples

* update gcc version to 5

* fix addon, env

* restore cargo path

* trigger build failure, add cache

* undo build failure change
2018-07-22 16:41:20 +08:00
sunn
1dee3e227c [cpp-pistache] add the option to fetch dependencies (#495)
* Add the Possibility to fetch dependencies needed by the generated code

* Fix typo

* Make External Libraries default to false

* Add parameter string to the javadoc comment
2018-07-22 10:46:38 +08:00
Rubén Martínez
0da55081c9 [Java][Client][RestTemplate] Do not create new Object for empty body (#605)
#513 Fixed error that causes exception when trying to perform HTTP requests without a body and an empty Object is used as body instead. In these cases an exception is thrown indicating that it is not possible to find a message converter for java.lang.Object and application/json.
2018-07-20 17:49:12 +02:00
Tomasz Prus
8867d2b34c Support for python 3.7 by renaming async to async_req (#519)
* feat: support for python 3.7

* fix: regenerate other sample clients
2018-07-20 22:14:18 +08:00
sunn
97d6b71460 [cpp-pistache] Fix compilation of petstore for Pistache (#497)
* Fix compilation of petstore for Pistache
Add Map support

* Add support for ByteArray

* Add Support for ByteArray in cpprest

* Implement TODOs
2018-07-20 22:04:25 +08:00
William Cheng
71ef6a0a2b update petstore samples 2018-07-19 19:28:31 +08:00
William Cheng
888da52181 Merge remote-tracking branch 'origin/master' into 3.2.x 2018-07-19 18:46:18 +08:00
Benjamin Gill
bd33a333af Ensure rust-server sample is kept up to date (#600) 2018-07-19 18:16:36 +08:00
Georg Rollinger
f7617bc628 [typescript][jQuery] Fix promise resolution (#581)
* typescript-jquery: fix promise resolution

The type annotation that is generated for an API states that the
JQueryPromise<...> will be resolved with a single value.
The implementation, on the other hand resolves with two.

This changes the implementation to resolve the promise in accordance
with the type annotation.
It also adds another type specifying what will be passed if the promise
is rejected.

* Update petstore sample for typescript-jquery
2018-07-19 18:04:43 +08:00
Benjamin Gill
c5e170961f [rust-server] enhance support for middlewares (#552)
* Generate RequestParser trait to allow retrieving operation ID in middlewares

* Update function name

* Fix incomplete comment

* Add comment poitning out auotgenerated duplication

* Final generation of sample scripts

* MMORCH-913 - Allow passing wrapped hyper clients to codegen

* Deprecate old API for back-compatibility rather than removing it

* Actually test Rust-server example integrations
2018-07-19 18:03:02 +08:00
William Cheng
e02e875978
Update gradle dependency for Java RESTEasy API client (#597)
* update resteasy gradle dependency

* remove java8 option when testing resteasy (java)
2018-07-19 17:57:21 +08:00
Marvin
52cd17ecc7 [Java][RESTEasy] Fixed setting of custom headers (#599)
Fixed header generation. Previously the key was used as value parameter.
2018-07-19 11:55:01 +02:00
Dimtiriy Remerov
76160b53c7 [php-symfony] Fixed a bug with access of non-existing property in generated code (#578)
* [php-symfony] Fixed a bug where Controller accessed non-existent property

* [php-symfony] Regenerated petstore sample
2018-07-19 15:32:15 +08:00
Niklas Werner
80cf1324c5 C Generator Sample - Improvements (#558)
* Added a .gitignore to ignore the build folder

* Added a CMakeLists and a basic implementation of a double linked list

* Added the pet model

* changed the behaviour when a list gets freed - the data of each element doesn't get freed anymore

* Added the tool uncrustify in order to make code look better

* Uncrustified code

* added an implementation(constructor and deconstructor) for the category model

* Added a third party JSON library

* The pet struct now uses pointers for its members; the pet struct now has a proper constructor and a basic toJSON method

* The pet model now gets fully serialized into JSON

* Fixed the example url...

* Added third party library libcurl

* Modified category struct and added an unit test

* Added a foreach macro and added two functions

* Added a tag model and an unit test

* the pet struct now uses no double pointer for it's name anymore and no pointer for the enum status anymore; the pet struct can now be fully converted to json and parsed from json

* Added the struct APIClient and an unit test

* Uncrustified the unit test for category

* Added ifdef in pet.h to prevent errors

* Added one API endpoint to get a pet by id

* Added a "== 0" comparison that I forgot

* Added some kind of debug functionality to test-petApi.c

* Removed the DEBUG define

* Moved the c petstore example from samples/client/c to samples/client/petstore/c

* Renamed function getPetById to petApi_getPetById to avoid name collisions

* Removed unecessary method in list.c

* Added POST functionality; added petApi_addPet method and improved unit-test for petApi; cleaned up some code in apiClient

* removed two methods in list.c(string/tag to JSON) and moved their code directly in the pet_convertToJSON method

* Removed old, already commented out, puts artifact in apiClient.c

* Added a convertToJSON method to the category model

* Added a convertToJSON method to the tag model

* changed how the convertToJSON method works in the pet model

* Adjusted the unit-tests on how the convertToJSON method now works(now returns a cJSON* instead of a char*)

* apiClient_t now needs to be given to API methods as a parameter. This means apiClient_t can now be reused in multiple methods.

* Added an untested concept for how authentication could be handled

* Tested basicAuth using wireshark and added untested OAuth2 feature

* Added support for api key authentication using the http-header and tested functionality using wireshark

* Renamed the dataToPost parameter in apiClient_invoke to bodyParameters

* Renamed apiKey_t to keyValuePair_t and implemented GET queries

* Spaces are now being replaced with + in querryParameters

* Renamed assembleHeader to assembleAPIKeyAuthentication and added support to change the request type

* Implemented the option to provide custom httpHeader fields to apiClient_invoke

* Added support for form parameters to the apiClient_invoke method

* update petstore sample
2018-07-19 12:22:38 +08:00
John Wang
0f0d8a01cb [Golang][client] Add option for standard Go generated code comment (#555)
* update go generated code comment

* update samples for go petstore

* update code generation comment

* update samples for go petstore

* Trigger CI due to previous Shippable race condition

* add -DwithGoCodegenComment=true option

* reset samples

* add withGoCodegenComment=true to bin/go-petstore-withxml.sh

* update samples/.../go-petstore-withXml using -DwithGoCodegenComment=true
2018-07-19 12:21:51 +08:00
delenius
995edc0b75 Fix version incompatibility in resteasy client (#594) 2018-07-19 10:50:59 +08:00
Jean-François Côté
5344a02bbc
Multiple enhancements to typescript fetch generator (#145) 2018-07-18 13:38:47 -04:00
Jeremie Bresson
45ed374b62 Merge remote-tracking branch 'origin/master' into 3.2.x 2018-07-18 12:19:41 +02:00
Jérémie Bresson
1e596496a5
Prepare 3.1.2-SNAPSHOT (#589) 2018-07-18 11:44:23 +02:00
Daonomic
0a52f56ba4 Support for discriminator.mapping (#536) 2018-07-18 06:14:42 +02:00
William Cheng
7c9d40016f update petstore samples 2018-07-18 01:52:58 +08:00
Akihito Nakano
6d6ef0f120 [PHP] Refactor php client generator (#504)
* Extends AbstractPhpCodegen instead of DefaultCodegen

* Remove fully duplicated methods with AbstractPhpCodegen

* Remove duplicated properties with AbstractPhpCodegen

* Remove duplicated codes in constructor with AbstractPhpCodegen

* Add typeMapping "date". Moved from PhpClientCodegen

refs: 3c34c0b377 (diff-f1801ef05a7926bf394c90f44ae4ab3dL132)

* Remove duplicated codes in processOpts()

* Remove unnecessary 'implements'

* Remove unnecessary method override

* Use setter

* Merge getTypeDeclaration() into AbstractPhpCodegen

* Merge processOpts() into AbstractPhpCodegen

refs:
* 296e6d3db4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL139)
* 296e6d3db4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL147)
* 296e6d3db4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL153)

* tweak

* Optimize IF statement

* Remove duplicated methods

* Merge setParameterExampleValue() into AbstractPhpCodegen

* Merge toEnumVarName() into AbstractPhpCodegen

* Merge toEnumName() into AbstractPhpCodegen

* Merge escapeUnsafeCharacters() into AbstractPhpCodegen

* Merge postProcessOperationsWithModels() into AbstractPhpCodegen

* tweak

* Recover missing method

refs: 2ad0f6f7d4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL91)

* Tweak test case

refs: 4e7b7afc1a

* Remove unnecessary 'import'

* Update lumen and ze-ph samples

- ./bin/php-lumen-petstore-server.sh > /dev/null 2>&1
- ./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1

* Update slim samples

* Fix script name

* Update silex samples

* Update kotlin-server
2018-07-17 09:27:02 +08:00
Akihito Nakano
afb238814d [Ruby] Abstract Ruby Codegen (#562)
* Add AbstractRubyCodegen

* Refactor constructor

* Move escapeReservedWord() to AbstractRubyCodegen

* Move getTypeDeclaration() to AbstractRubyCodegen

* Move toDefaultValue() to AbstractRubyCodegen

* Move toVarName() to AbstractRubyCodegen

* Move toParamName() to AbstractRubyCodegen

* Move toOperationId() to AbstractRubyCodegen

* Move escapeQuotationMark() to AbstractRubyCodegen

* Move escapeUnsafeCharacters() to AbstractRubyCodegen

* Use super.escapeReservedWord()

* RubyClientCodegen extends AbstractRubyCodegen

* Add the differences with AbstractRubyCodegen to "reservedWords"

* cliOptions.clear() is not a language specific matter

- Rails, Sinatra requires cliOptions.clear()
- Ruby client doesn't requires that

* Remove duplicated statements with AbstractRubyCodegen

* Remove duplicated methods with AbstractRubyCodegen

* Merge toVarName() into AbstractRubyCodegen

* Merge getTypeDeclaration() into AbstractRubyCodegen

* Merge toDefaultValue() into AbstractRubyCodegen

* Update Ruby related samples

- bin/ruby-client-petstore.sh
- bin/ruby-on-rails-server-petstore.sh
- bin/ruby-sinatra-server-petstore.sh

* Remove unnecessary 'import'

* Avoid unnecessary HTML escaping
2018-07-17 09:08:42 +08:00
Matthieu Berthomé
84ef98f067 [Python][Client] pure library client package (#470)
* Python client pure library package

* check onlyPackage CLI option

* run /bin/python-petstore.sh, update the python samples for CI

* onlyPackage local variable instead of classp property

* fix CI: __future__ absolute_import must be first in file

* update samples

* generateSourceCodeOnly

* updated samples
2018-07-16 15:49:08 +08:00
Yuriy Belenko
925ae68167 [Slim] Generation of UnitTest stubs (#566)
* [Slim] Add PHPUnit4 to Composer

* [Slim] Configure PHPUnit

* [Slim] Add Model and Api test templates

* [Slim] Refresh Slim samples
2018-07-16 14:25:48 +09:00
William Cheng
d863c3e5f4
Add travis.yml to test java6 option (#568)
Add travis.yml to test java6 option, update Java (Jersey2) dependencies
2018-07-15 16:00:07 +08:00
Jérémie Bresson
5a0a8f6a87 Java6 support: fix pom and gradle files, avoid diamond notation (#560) 2018-07-14 21:13:23 +08:00
William Cheng
df815344d1
fix NPE in body parameter due to incorrect parameter/consume (#563) 2018-07-14 20:19:10 +08:00
William Cheng
478d6ced4e Merge remote-tracking branch 'origin/master' into 3.2.x 2018-07-14 01:35:54 +08:00
Akihito Nakano
26e70fe642 [Ruby] Rename files/folders (#534)
* Rename templateDir: rails5 -> ruby-on-rails-server

* Rename script: rails5-petstore-server.sh -> ruby-on-rails-server-petstore.sh

* Rename sample folder: rails5 -> ruby-on-rails

* Rename script(openapi3): rails5-petstore-server.sh -> ruby-on-rails-server-petstore.sh

* Update ruby-on-rails-server-petstore.sh

* Rename templateDir: sinatra -> ruby-sinatra-server

* Rename script: sinatra-petstore-server.sh -> ruby-sinatra-server-petstore.sh

* Rename sample folder: sinatra -> ruby-sinatra

* Update script

* Rename templateDir: ruby -> ruby-client

* Rename script: ruby-petstore.sh -> ruby-client-petstore.sh

* Update scripts

* Update samples

- bin/ruby-sinatra-server-petstore.sh
- bin/ruby-on-rails-server-petstore.sh
- bin/ruby-client-petstore.sh
- bin/security/ruby-client-petstore.sh
2018-07-13 22:28:17 +08:00
Jeremie Bresson
0cc60d39d2 Merge remote-tracking branch 'origin/master' into 3.2.x 2018-07-13 07:25:49 +02:00
Benjamin Gill
6c14b4271f Handle headers correctly (#549)
We were previously relying on some incorrect behaviour of the old
swagger-codegen mustache engine.
2018-07-13 01:55:56 +08:00
John Wang
19fd48e33b [Golang][client] fix formData file parameter name use (#506)
* support form-data file MIME `name` parameter

* update test spec and Go client for form-data file name

* update samples for ensure-up-to-date

* update mustache template

* update samples for Go client

* improve assignment location

* update samples
2018-07-13 00:53:38 +08:00
John Wang
93832340a5 add RFC-3339 formatting to parameterToString (#502) 2018-07-13 00:50:21 +08:00
Tomasz Prus
a0936bec02 feat: use local_var_params to avoid collision with api parameters (#521) 2018-07-12 21:30:57 +08:00
William Cheng
0d952b79db
Improve logging in Python client (#480)
* improve logging in python client

* update samples
2018-07-10 22:12:09 +08:00
Dennis Kieselhorst
0a2131d2d3 update CXF and Jackson to latest version (#496) 2018-07-10 18:23:18 +08:00
Tomasz Prus
96e86ac03e update and fix python samples (#489)
* fix: update petstore samples for python, fix broken tests

* chore: entries for python-asyncio/tornado in gitignore
2018-07-08 15:29:55 +08:00
sunn
6d05ea5716 Allow generated code to do cleanup of object by preventing premature loop exit (#270) 2018-07-08 12:55:27 +08:00
Jon Schoning
79fafda012 [haskell-http-client] regen samples (#492) 2018-07-08 12:46:35 +08:00
John Wang
a14e757059 fix cache-expires-ineffassign (#466) 2018-07-08 12:38:04 +08:00