Commit Graph

4938 Commits

Author SHA1 Message Date
Akihito Nakano
2b429ee43b [PHP] [Laravel] Fix syntax errors in models (#721)
* Fix syntax errors in Models

* Update samples

./bin/php-laravel-petstore-server.sh
2018-08-03 10:44:12 +08:00
David van Laatum
a258cf3fc6 #714 prevent throwing another exception if the request fails eg connection reset (#715)
* prevent throwing another exception if the request fails eg connection reset

* prevent throwing another exception if the request fails eg connection reset
2018-08-03 00:02:09 +08:00
William Cheng
f32398a708
add dockerfile for ror, fix template issue (#718) 2018-08-02 22:07:09 +08:00
William Cheng
f0425d77ef
[Ruby] Better handling of operationID starting with a number (#719)
* better handling of operationId starting with numbers in Ruby

* update Rubocop to use Layout
2018-08-02 22:00:50 +08:00
William Cheng
375c26ccb3
add option to select db adapter in ror (#711) 2018-08-02 13:52:34 +08:00
William Cheng
40024ac72a
[Go] Prefix enum number with _ (#703)
* prefix enum number with _ in go

* reformat code, use else if
2018-08-02 10:13:01 +08:00
William Cheng
ab08dd1d26
Better handling of operationID starting with numbers (#691)
* add numeric operationid to test spec

* better handling of operationId in more generators

* fix go toOperationId

* update samples

* update java samples

* update java samples (vertx, webclient)

* update java google api client sample

* fix typo, update OAS3 test spec, update php petstore (oas3)

* defer camelize in operationid

* remove duplicated sanitizeName
2018-08-01 22:31:58 +08:00
William Cheng
21141f682f
Fix Javadoc string error in Java (rest-assured) client (#702)
* fix docstring

* trigger build failure

* Revert "trigger build failure"

This reverts commit 12cd26f0ca981db37d177a55001dac8b6afcd0bf.

* update java samples
2018-08-01 22:13:41 +08:00
Jeremie Bresson
d8ea28e147 Update "phpunit.xml.dist" 2018-08-01 14:43:34 +02:00
Victor Orlovsky
82156b6639 Added constant "httpMethod", "summary" (#697) 2018-08-01 12:02:11 +08:00
Yuriy Belenko
58e0946b1e [Slim] Add Basic authentication middleware (#606)
* [Slim] Add Basic Authentication Middleware

User needs to add own implementation to verifyCredentials method in AuthBasic.php.

* [Slim] Update README template

I'm not sure about `middlewareSrcPath` variable. I'll fix it in following PRs
if path is broken.
Hope that notice in README catches attention and most of users will read it.

* Revert "[Slim] Update README template"

This reverts commit 204ee02fd853feb3cc19db5658348c7fee6ca3f5.

* Revert "[Slim] Add Basic Authentication Middleware"

This reverts commit 6a8e03079a70213797896e660b7e7fa1894da0a6.

* [Slim] Add "tuupola/slim-basic-auth" package

Package "tuupola/slim-basic-auth" 3.1.0 requires PHP 7, that's why I
set it's version to ^3.0.0 in Composer. Minimum version will be
3.0.0-rc.1 which supports PHP 5.5. I've tested build with PHP 7, it
would be nice to check build with PHP 5.5 someday.

* [Slim] Update README template

Not sure about forward slash in path to SlimRouter class. I will fix it
in upcoming PRs if necessary.

* [Slim] Refresh samples
2018-08-01 00:55:30 +08:00
Christoph, René Pardon
f793ac25c7 feat (PHP LARAVEL) 8417: initial PHP-laravel codegen integration (#574)
* feat (PHP LARAVEL) 8417: initial PHP-laravel codegen integration

* feat (PHP LARAVEL) 8417: code review adjustments

* feat (PHP LARAVEL) 8417: fix typos; add missing files; adjust readme for those unfamilar with laravel to get started quickly

* feat (PHP LARAVEL) 8417: add sample petstore server

* feat (PHP LARAVEL) 8417: adjust route service provdider and model generation
2018-08-01 00:34:33 +08:00
René Winkelmeyer
d1fc923b66 Re-implementation of Apex client code gen (#698) 2018-07-31 23:02:25 +08:00
William Cheng
d8ec6b2003
[Apex] migrating to OpenAPI Generator project (#692)
* [apex] migrating to OpenAPITools

* migrate apex to openapi-generator
2018-07-31 15:28:54 +08:00
William Cheng
0c52fcd5ff udpate rust server samples 2018-07-31 11:33:23 +08:00
sunn
926b971497 [qt5 server] Improvement in response handling (#675)
* Remove warnings and add custom request sending

* Remove duplicate code from subclass and add missing setupRoutes

* Removed redundant override

* Add serialization of responses

* Fix CI failure

* Add inline function to duplicate code.

* Make const reference wherever possible

* Add support for Array of Primitive types.

* Add Array of Primitive support for Error response

* Update for multiple path params
2018-07-31 00:16:46 +08:00
Benjamin Gill
a3e5185e39 Ignore additional properties (#671)
* Ignore additionalProperties

rust-server doen't yet support them, and they cause quite a bit of havoc at the moment (ending up as the `HashMap` type).

* Use .equals() rather than `==`
2018-07-30 23:06:05 +08:00
Benjamin Gill
b0909ade6f [rust-server] add support for '|' in path segments (#667)
* Added encoding for vertical bar character in object IDs for client requests

* Updated sample
2018-07-30 18:38:52 +08:00
William Cheng
036fa6918c
fix operation id starting with number for python client (#682) 2018-07-30 15:42:06 +08:00
sunn
b587052de4 cpp-tizen extends AbstractCppCodegen (#676)
* cpp-tizen extends AbstractCppCodegen

* Update javadoc comment
2018-07-30 15:33:00 +08:00
Benjamin Gill
cb9a734ebb [rust-server] add support for multiple samples (#658)
* Add support for multiple rust-server samples

Though we only have the one as yet. This will make it easier to move rust-server back on to the main test spec, whilst preserving the ability to have rust-specific test specs.

* Rust samples need unique names

* Move samples to a dedicated directory

So that there is nothing else in the folder where they live so that the workspace definition in the root Cargo.toml can be simple.
2018-07-30 15:31:55 +08:00
Rubén Martínez
68d80ab67d [Java][Client][RestTemplate] Fixed invalid URL-encoding of query parameters (#646)
Fix for the #644
2018-07-30 08:38:10 +02:00
William Cheng
b33f1f945b
add stop wait to spring pom (#670) 2018-07-27 23:41:31 +08:00
sunn
534b6b5978 [cpp qt5 server] Improve qt5 server naming (#655)
* Adapted according to reviews

* Add changed files

* Update beta tag to the naming
2018-07-27 01:49:26 +08:00
Benjamin Gill
b6fc29050d Implement stack for Swagger Context (#612) 2018-07-27 01:48:43 +08:00
Benjamin Gill
7624a1ff85 Various enhancements to html2 docsgen (#643)
This commit includes the following changes:

- Fix docs not generating parameter descriptions, add rust sample.
- Add example to doc output.
- Add basic scope reporting.
- Stringify the JSON "Example" objects for response schemas.
- Prettify JSON examples in response schemas.
- Parse and present multiline response descriptions.
- Add API error details to docsgen.
- Add read only markers to read only properties.
- Fix up style document indentation.
- Add support for `x-shared-errors`, an extension to define common error types that can be shared across a microservice framework.
2018-07-26 21:57:57 +08:00
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