Commit Graph

914 Commits

Author SHA1 Message Date
Yuriy Belenko
99646e6436 [Slim] Update main documentation (#839)
* [Slim] Update main documentation

Kotlin server README has been used as a ref. There are no links to apis and
models docs, because Slim codegen doesn't provide them right now.
Also I'm not sure about white spaces, but we can change it anytime in future.

* [Slim] Refresh samples
2018-08-21 18:25:43 +08:00
OmriHarary
ca0c35aa15 [java-server] Fix improper quoting of default values for query parameters (#708) 2018-08-21 10:17:31 +02:00
Yuriy Belenko
d374e1c160 [Slim] Official htaccess (#838)
* [Slim] Change htaccess to official

Slim docs contains more simple htaccess example.
https://www.slimframework.com/docs/v3/start/web-servers.html#apache-configuration

* [Slim] Refresh samples
2018-08-21 11:59:29 +08:00
Yuriy Belenko
e605882451 [PHP] Add gitignore to AbstractPhpCodegen (#765)
* [PHP] Remove PHP related rules from root gitignore

After conversation with @ackintosh we've agreed that every PHP codegen
should create it's own `.gitignore`. Client libraries(SDKs) should ignore
`composer.lock` file while server stubs better do opposite.

* [PHP] Set .gitignore as default supporting file

* [PHP] Add default gitignore to Client SDK

* [PHP] Add default gitignore to Laravel

* [PHP] Add default gitignore to Lumen

* [PHP] Add default gitignore to Silex

Seems like issue #663 and pull request #681 missed this security script,
I've changed output path in bin/security/silex-petstore-server.sh.

* [PHP] Update Slim

* [PHP] Add default gitignore to Symfony

I've copied few old rules from root gitignore to local one. These rules
should be reviewed by original SymfonyCodegen authors.

* [PHP] Add default gitignore to Zend

* [PHP] Refresh Openapi3 client samples

* [PHP] Add refs to .gitignore templates collection
2018-08-20 12:16:01 +08:00
Matiss
dcc622d374 Improve Symfony 4.1 compatibility (#830) 2018-08-20 12:11:33 +08:00
Michael Kotten
fa52826c24 [JAXRS-spec] Add option useSwaggerAnnotations (#813) 2018-08-15 18:05:47 +02:00
Jérémie Bresson
79b993e6d5
Prepare version 3.2.2-SNAPSHOT (#810) 2018-08-14 13:38:18 +02:00
William Cheng
b64864f47d
Fix float/double default value in C# generator (#791)
* fix float/double default value

* better code format

* better CI for openapi3 batch files (C# client)

* update nancyfx samples

* pipe output to /dev/null to reduce log size

* fix windows batch file

* add C# API client generated by OAS3 spec
2018-08-13 13:28:22 +08:00
Dec12 | Fujigon
d019bbd2c7 [Java][jaxrs-jersey] add sample with jaxrs-jersey + openapi v3 (#778)
* create sample with "jaxrs-jersey" language & openapi v3

* circle ci setting

* fix typo. also add "jaxrs-jersey" to all samples profile

* artifactId conflicts. rename.

* generate samples with "./bin/openapi3/jaxrs-jersey-petstore.sh"
2018-08-10 17:24:24 +08:00
William Cheng
748d1d70cb
update groupId in pom (#779) 2018-08-10 15:48:19 +08:00
stkrwork
0809d8f527
[C++][Restbed/Pistache] Added fix for byte array (#752)
* Added fix for byte array

* Fix spacing

* Adapted default value for ByteArray

* Adapted default value for ByteArray in Pistache Server
2018-08-07 17:07:05 +02:00
Dec12 | Fujigon
629608c573 [jaxrs-spec*] samples should be tested. repair import and dependency. (#755)
* sample server projects "jaxrs-spec", "jaxrs-spec-interface", and "jaxrs-spec-interface-response" should be tested

* update jax-rs api to 2.1, in which @PATCH annotation is available
add jackson annotation dependency

* add joda-time to dependency

* modify mustache template to add @JsonCreate, @JsonValue import

* fix return type of enum value() method

* add InputStream import

* Attachment class is in apache cxf. spec should not depend on it

* re-generate sample jaxrs-spec, jaxrs-spec-interface, and jaxrs-spec-interface-response
2018-08-07 16:45:09 +08:00
William Cheng
90a8b81728
Prepare 3.2.1-SNAPSHOT release (#748)
* prepare 3.2.1 SNAPSHOT release

* update doc to use 3.2.0 stable version
2018-08-07 01:31:37 +08:00
William Cheng
c116c8fb9b
[PHP] Decommission "packagePath", add new option "packageName" (#681)
* remove packagePath from php file location, use -o instead

* fix php symfony top folder

* restore pacakgePath

* update php laraavel samples

* remove packagePath from PHP generator

* add new silex files

* update window batch - php silex

* fix openapi3 silex script
2018-08-06 18:10:34 +08:00
William Cheng
1ab4fe43b5
fix petstore security spec to remove validation errors (#739) 2018-08-06 17:02:02 +08:00
William Cheng
f6146b212f
[PHP] better operationId handling, add CI for PHP slim server (#723)
* better operationId handling, add CI for PHP slim

* use spaces instead of tabs

* replace tab with space

* install php
2018-08-03 10:47:54 +08:00
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
William Cheng
f32398a708
add dockerfile for ror, fix template issue (#718) 2018-08-02 22:07:09 +08:00
William Cheng
375c26ccb3
add option to select db adapter in ror (#711) 2018-08-02 13:52:34 +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
Jeremie Bresson
d8ea28e147 Update "phpunit.xml.dist" 2018-08-01 14:43:34 +02: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
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
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
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
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
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
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
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
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
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