2070 Commits

Author SHA1 Message Date
Andy.Yang.cn
c3837ca331
[Rust Server] Fix #5906 (yaml with path parameter error) (#5871)
* [Rust Server] Fix Rust 1.39+ "Box<Future" and "as &Has" compile issue

* [Rust Server] Fix Rust server side pathRegEx and baseName not match issue

* [Rust Server] Add test case yaml with path parameter.
2020-04-15 17:19:00 +01:00
Nicolas Homble
c479e518d4
[Python][aiohttp] create venv as rule (#5913)
* create venv as rule

* create venv as rule II
2020-04-14 14:53:28 +08:00
Richard Whitehouse
95105cef2e
[Rust Server] Support complex query parameters (#5831)
* [Rust Server] Support complex query parameters

* [Rust Server] Remove unused extern crate

* [Rust Server] tokio should be a dev-dependency

* [Rust Server] Add test for complex query params

* Update samples

Co-authored-by: Matt Williams
2020-04-12 19:57:50 +01:00
Artem Shubovych
62c346f8da
[enhancement] [jaxrs-spec] Add builders to models (#4930)
* Update formatting in jaxrs-spec POJOs

* Add generateBuilders option

* Update formatting in jaxrs-spec POJOs

* Disable the builders generation by default

* Ensure samples are up-to-date

* Revert newline change

* Run ensure-up-to-date

* update doc

* fix merge conflicts

Co-authored-by: Artem Shubovych <ashubovych@atlassian.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-12 17:27:34 +08:00
Gonzalo
6a158de431
Add date time format annotation on pojo for model query parameters (#5437)
* Add date time format annotation on pojo for model query parameters

* Regenetare samples

* update spring samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-12 09:39:16 +08:00
sunn
c73f3c5eb2
Updates to allow the setting of the dateTime format string (#5763) 2020-04-09 09:20:35 +02:00
Jacob Floyd
469b21830c
Add pythonSrcRoot option to python servers (aiohttp/flask/blueplanet) to support src/ layout projects [and reenable/fix all python server tests] (#5423)
* python server: Add pythonSrcRoot option

This will allow the python project to be in a subdirectory (as specified
in pythonSrcRoot). That could mean following the src layout with sources
under src/ or lib/. Multi-language projects might use a sub directory
like python/, or whatever makes sense for the project.

By default, the pythonSrcRoot is "", meaning the existing behavior is
the default.

* python server: update template files to support pythonSrcRoot

* python server: update docs to add pythonSrcRoot option

* python server: add pythonSrcRoot sample script

* python server: build sample srclayout project

* [Python] copy test files preserving history

* [Python] Make a conflict to preserve file copy history

* [Python] customize pom.xml for src layout tests

* [Python] add python-aiohttp-srclayout tests

* [Python] Fix server tests by updating requirements

Reverts the PR that disabled python2 server tests:
https://github.com/OpenAPITools/openapi-generator/pull/4949

Reverts commits that disabled python3 server tests:
9adfedbfbb45c7059e64b3d9a285710bded4fb62
17ee990baaa80585242c7a07d64e2be4888fcfd0

Issue about the python 3 tests:
https://github.com/OpenAPITools/openapi-generator/issues/5235

I couldn't find an issue about the python2 tests being disabled.
I'm guessing build errors like the following were the trigger:
https://travis-ci.org/github/OpenAPITools/openapi-generator/builds/634238181

Let's see what breaks!

* [Python] Copy setup.py to python-aiohttp

* [Python] Save history while copying setup.py to python-aiohttp

* [Python] Add aiohttp server setup.py

* [Python] Fix python server tests with src layout

* [Python] bump Flask-Testing version

* [Python] Pin pyyaml for py2.7 flask server

* [Python] simplify flask server requirements

* consolidate server tests

* [Python] rebuild python server samples

* [Python] Fix python server requirements for older pythons

Documented minimum python version for our aiohttp server is 3.5.
Documented minimum python version for our flask server is 3.4.
Connexion 2.3 is the last version to support python 3.4 and 3.5, so fix
the version pinning to correctly select <=2.3 for these EOL python
versions. Newer pythons should get the latest if possible as there many
relevant bug fixes.

Werkzeug also needs to be pinned for these old versions in the aiohttp
server just like for the flask server.

3.4 and 3.5 are EOL. We really should increase the minimum supported
version, but that is for another PR to do.
2020-04-07 23:14:13 -07:00
jburgess
2ff9be6f95
[codegen] Fix 'super.HashCode' for oneOf and allOf Implementations (retry) (#5830)
* Added hasVars after completion of all model post-processing (#5587)

* Post ensure-up-to-date

* Update to check the size of vars and not assume non-null
2020-04-07 16:42:20 +08:00
Richard Whitehouse
cdb500c156
[Rust Server] Fix no features build (#5747)
* Remove test file erroneously checked in

* [Rust Server] Fix no features build

- Need serde_json for no-features build for undefined value structures
- Don't include `IntoHeader` type and implementations if we aren't including the client/server features
- Don't export the `IntoHeader` type at all - it's internal

* Update samples
2020-04-05 19:08:39 +01:00
Alex Buchkovsky
166aae6fec
[BUG] [KOTLIN] Fix default value generation for Kotlin Strings (#5776)
* fix default value generation for kotlin

* add updated pet templates

* Revert "add updated pet templates"

This reverts commit 7e8168ad

* regen pet store projects code
2020-04-06 01:30:03 +08:00
William Cheng
52018c43ba
Minor improvements to scala akka server (#5823)
* minor improvements to scala akka server

* add samples

* update doc
2020-04-05 10:09:31 +08:00
Bouillie
af85fab52b
Scala akka-http server (#5758)
* Scala akka-http server base implementation

* [scala-akka-http-server] petStore samples

* Improved the formatting of generated files

* Updated scala-akka-http server samples

* [scala-akka-http-server] the groupId, artifactId and artifactVersion default value are used as intended.

* Fixed the default operation not being correctly generated on parameterless operations

* Added build.sbt.mustache supporting file

* Updated scala-akka-http server samples

* ScalaAkkaHttpServer: Fixed a String.format call to use Locale.ROOT for locale

* [scala-akka-http-server] Fixed defaultValue being escaped during generation

* Added scala-akka-http.md

* Replaced all "⇒" character with "=>" to retain compatibility with scala 2.13

* [scala-akka-http] Added a config option akkaHttpVersion
It's set in the generated build.sbt.

* Updated scala-akka-http server samples

* [scala-akka-http] More accurate akkaHttpVersion parsing

* Updated scala-akka-http.md

* [scala-akka-http] Changed the akka-http version check to fix the generation of StringDirectives

* Updated scala-akka-http samples

* updated scala-akka-http.md

Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-04 23:16:14 +08:00
William Cheng
de40cfc128
comment out kotlin vertx server test (#5767) 2020-03-31 19:10:41 +08:00
ehansen31
7e22b4b8cf
[Erlang-Server] security definition context changes don't propagate to handler (#5751)
* Map Merge Context & Params

handler requires context and params to be merged before returned to user defined request_handler.

* post build & shell script

* Delete VERSION
2020-03-30 23:20:51 +08:00
Richard Whitehouse
d0d0252fff
[Rust Server] Don't use structs in models (#5557)
* [Rust Server] Don't use structs in models

This avoids namespace clashes between model names and types used.

* [Rust Server] Handle models named after results

* [Rust Server] Add test for result models

* Update samples
2020-03-29 20:04:56 +01:00
William Cheng
a0ca253218
update samples (#5722) 2020-03-27 13:55:55 +08:00
Richard Whitehouse
cfe3b86d70
[Rust Server] Handle text/xml correctly (#5660)
* [Rust Server] Handle text/xml correctly

  Treat application/xml the same as text/xml as per RFC 7303

* [Rust Server] Add test for text/xml

* Update samples
2020-03-26 17:14:13 +00:00
Richard Whitehouse
cff1f1ce80
[Rust Server] Support operation overriding server path on client (#5554)
* [Rust Server] Support operation overriding server on the client

* [Rust Server] Test operation overriding sever

* Update samples
2020-03-24 16:41:11 +00:00
YishTish
9d96ab0983
Nodejs express js packages update (#5675)
* Updated to new nodejs packages, depending heavily on express-openapi-validator. Requires quite a change in code.
Updated the business-logic in the controllers/Controller.js file.
Logger now records also timestamp of events.
Files are uploaded according to definition in config.js file

* Removed commented-out code; Changed openApi document extensions to suit new express-openapi-validator definition; multipart and file uploading is supported now; Automatic response returns the values the were sent in the request

* fixed README documentation, fixed a mistage in package.json/mustache

* added generated files that were created when running the ./bin/test file
2020-03-24 17:37:18 +08:00
Richard Whitehouse
05ace4f43f
[Rust Server] Preserve path provided in base path (#5555)
* Preserve path provided in base path
* Update samples
2020-03-24 09:25:48 +00:00
Thomas Enderle
19862f85e3
[jaxrs-reasteasy-eap] Fix invalid Bean Validation annotations for Longs (#5659)
* fix issue #5658

* update samples
2020-03-24 10:29:07 +08:00
Richard Whitehouse
28ea718004
[Rust Server] Run rustfmt over rust-server output (#5558)
* Run rustfmt over rust-server output

Automatically run rustfmt over rust-server output if --enable-post-process-file is set

* Update samples

* Add note about configuring post processing
2020-03-24 00:09:40 +00:00
Richard Whitehouse
15a2390fe5
[Rust Server] Flag responses as must use (#5559)
* [Rust Server] Flag responses as must use if there is more than a single option
* Update samples
2020-03-23 18:47:12 +00:00
Richard Whitehouse
806562bb05
[Rust Server] Retire mimetypes modules (#5560)
* Retire mimetypes module to prevent collision in mimetype identifiers
* Update samples
2020-03-23 13:04:29 +00:00
Richard Whitehouse
be983b5212
[Rust Server] Build APIs which have no available examples (#5561)
* [Rust Server] Build APIs which have no examples

* [Rust Server] Add test for APIs with no examples

* Update samples
2020-03-22 19:54:48 +00:00
Richard Whitehouse
b0520a346d
[Rust Server] Support multiple identical MIME types (#5562)
* Support multiple identical MIME types in a multipart request
* Add test for multiple identical MIME types
* Update samples
2020-03-22 15:30:37 +00:00
Richard Whitehouse
058d1d2aa0
[Rust Server] Return 405 Method Not Allowed (#5563)
* Return 405 Method Not Allowed if the path matches, but the method doesn't.
* Update samples
2020-03-22 11:57:36 +00:00
Richard Whitehouse
4aefc9ba33
[Rust Sever] Upgrade to openssl 0.10 (#5564)
* [Rust Server] Upgrade to openssl 0.10

Use hyper-openssl/openssl instead of hyper-tls/native-tls/openssl on Linux

* Update samples
2020-03-19 21:05:16 +00:00
sunn
8af3d6d9bf
Port client updates to server (#5634) 2020-03-19 16:34:59 +01:00
Aleksandr Nekrasov
5beccd12b6
[scala][templates] java 8 dates support (#5291)
* [scala][akka-http-client] java8 dates support

* scala-akka readme doc updated

* DateSerializers renamed

* rename serializers

* move date-library option to abstractScala

* generators docs updated

* enum defined for date libraries

* Backport to scala-http-client

* fix scala-akka-client date serializers

* fix typo in docs

* switch scala templates to java8 (jsr-310) date library by default

* update scala samples with java8 date library

* update scala generators docs with java8 default date library

* fix scala-play-server generator cli options as only java8 dateLibrary supported

* fix scalaz DateTimeCodecs template to support java8

* scalaz ci test againt java7 removed as it generate scala 2.11.8 client which is java8 based
2020-03-17 15:54:24 +08:00
Aleksandr Nekrasov
b40257f53a
fix default value for abstract scala and scalatra server impl (#5578) 2020-03-17 15:04:13 +08:00
Antoine Reilles
27175c71df
[jaxrs-cxf-cdi] Support PATCH httpMethod (#5574)
Update the required CXF version to 3.1.2 since PATCH support appeared
with this version.

Add the cxf PATCH annotation to the imports so that the generated code
when defining a PATCH api compiles.
2020-03-17 14:59:35 +08:00
Richard Whitehouse
16646b39c1
[Rust Server] Make parse error Display-able (#5490)
* [Rust Server] Make parse error displayable

  Change error type to be displayable to prevent compile errors

* [Rust Server] Add test for enum in path

* Update samples
2020-03-08 11:12:17 +00:00
Richard Whitehouse
e4be8a107f
[Rust Server] Test allOf objects including base properties (#5457)
* [Rust Server] Add operationIds for rust-server-test

* [Rust Server] Add test for allOf

* Update samples
2020-03-07 20:53:13 +00:00
Richard Whitehouse
b60fc900b2
[Rust Server] Support OpenAPI v3 callbacks (#5405)
* [Rust Server] Support Callbacks

* [Rust Server] Support callbacks in the examples

* [Rust Server] Update features documentation

* [Rust Server] Mark as supporting callbacks

* Update samples

* [Rust Server] Add tests for callbacks

* [Rust Server] Fix README

Don't suggest examples which don't exist
2020-03-07 19:24:42 +00:00
Yuriy Belenko
39aeb4a8ae
[Slim4] Add Data Mocker middleware (#4978)
* [Slim4] Store response schemas

* [Slim4] Add Data Mocker middleware

* [Slim4] Enhance Slim router

* [Slim4] Enhance config

* [Slim4] Fix data format key in object mocking

* [Slim4] Add tests for Data Mocker middleware

* [Slim4] Add Mock feature documentation

* [Slim4] Refresh samples
2020-03-03 23:53:57 +08:00
William Cheng
4ac054f723
Hide timestamp in Scala Play server samples (#5495)
* hide timestamp in scala play server output

* add chameleon82 to scala tech committee
2020-03-02 14:56:07 +08:00
Aleksandr Nekrasov
6dd76d65e7
[scala] [template] scala model property style (#5486)
* Model property naming style generic for scala

* scala templates based on abstractScala regererated

* docs generators updated

* property format tests
2020-03-02 11:48:09 +08:00
Jorge Rodriguez
21e285cea9
[BUG] [JAVA | Spring] Cookie in parameter is not correctly generated (#5393)
* Cookie in parameter is not correctly generated

* gh-5386: Fix cookie parameter in

* gh-5386: Fix cookie parameter in

* gh-5386: Update test file

* gh-5386: Fix cookie parameter in

* gh-5386: Fix cookie parameter in

* gh-5386: Regenerate samples

* gh-5386: Fix test

* Added Spring CookieValue tests

Co-authored-by: Gonzalo <gonzalo.nom.es@gmail.com>
2020-03-01 23:12:20 +08:00
Mateusz Szychowski (Muttley)
4c6648f1a9
[C++] Add an option to allow having lowercase variables in models, Pistache: allow using reservedWords in models (#5434)
* [C++][Pistache] Use reserved words to replace incorrect names

discard old decision to truncate reservedWords

* [C++][Pistache] Update struct model to use name instead of baseName

* [C++][Pistache] Update Petstore sample

* [C++] Add option to have lowercase variables

* [C++] Update generated docs
2020-03-01 12:39:45 +01:00
Yutaka Miyamae
015b404729
[kotlin]Fix ktor doesn't generate nullable types (#5258)
* If not required, need `? = null`

* run  ./bin/kotlin-server-petstore.sh

* Added `?` when value is `required` and `isNullable`

* Rerun ./bin/kotlin-server-petstore.sh. But No differences
2020-03-01 17:58:58 +08:00
Richard Whitehouse
dc0da57f96
[Rust Server] Suffix reserved words with _ (#5455)
* [Rust Server] Suffix reserved words with _

Suffix reserved words with an underscore instead of prefixing them.

This follows convention in the Rust community, as prefixing with an underscore
indicates an unused variable in Rust.

* Update samples
2020-03-01 00:23:00 +00:00
Richard Whitehouse
a196296e57
[Rust Server] Support RFC 7386 (#5454)
* [Rust Server] Support RFC 7386

Support application/merge-patch+json as defined by RFC 7386 -
https://tools.ietf.org/html/rfc7386

Handle exactly the same as application/json.

* [Rust Server] Add test for RFC 7386

* Update samples
2020-02-29 21:54:11 +00:00
Richard Whitehouse
f32b1463bc
[Rust Server] Support numeric operation IDs (#5453)
* [Rust Server] Support operation IDs which begin with a number
* [Rust Server] Add test for a numeric operation ID
* Update samples
2020-02-29 19:23:54 +00:00
Richard Whitehouse
a6e96b4971
[Rust Server] Handle numeric response description (#5452)
* [Rust Server] Handle response descriptions which start with a number.
* [Rust Server] Add test for numeric response descriptions
* Update samples
2020-02-29 14:54:47 +00:00
Richard Whitehouse
f5c5b91f83
[Rust Server] Nullable fixes (#5408)
* [Rust Server] Nullable fixes
* [Rust Server] Add tests for nullable cases
* Update samples
2020-02-29 13:37:12 +00:00
Justin
857a4bf5d9
Use the dataType if the baseType is not set (#5372)
* Use the dataType if the baseType is not set

* add tests for passing enum as parameter

* updated requirements file in samples

* Update spec to explicitly name objects and prevent `inline_object`

* use the correct scripts to generate samples (`bin/openapi3/python-flask*`)
2020-02-28 09:46:57 -08:00
Aleksandr Nekrasov
84250973be
[scala] strip model class name for all scala generators (#5439)
* stripped parameter enabled for all scala based generators

* scala samples updated

* docs generators updated

* fix scalatra. regenerated by openapi3 script.
manually removed enum default value from scalatra example due bug in schema extraction
2020-02-28 20:44:02 +08:00
Richard Whitehouse
ca9376fdbb
[Rust Server] Support RFC 7807 (#5407)
* Support RFC 7807 - Problem Details for HTTP APIs
* Add test for RFC 7807
* Update samples
2020-02-26 18:18:01 +00:00
William Cheng
54c2956461
[Erlang][Server] fix import for multiple API key auth (#5424)
* fix multi api key import in erlang server

* update samples

* better code format for cpp server generator
2020-02-25 16:43:01 +08:00