* [REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists
- Update Java code generation to use sets instead of lists when uniqueItems is set to true
- Add import resolution for sets
- Add tests and fix broke tests
resolve#5254
* Update Javascript, Perl, Python and Ruby to preserve current functionality.
* Switch set implementation to LinkedHashSet
* Fix missing import for uniqueItems used on param.
* Fix missing import and return type for responses with uniqueItems
* Fix default values for array of enum
* Update generated samples
* fix merge issue
* Update generated samples
Co-authored-by: William Cheng <wing328hk@gmail.com>
Change helper method '''writeResponseHeaders''' implementation to just set the headers, instead of write them, and also rename the method to '''setSocketResponseHeaders''', to maintain the new semantic.
The implementation of '''QHttpEngine::Socket::write''' or '''QHttpEngine::Socket::writeJson''' implementations will call '''Socket::writeData''' that writes the Headers and Status Code before write the content if they are not already written.
If these methods are not called (e.g.: empty reply), we could set the headers just before close the socket.
* [C++] [Qt5] [Server] [Bug] fixed Incomplete Read JSON
Emit signal requestReceived only after request content is entirely received.
* [C++] [Qt5] [Server] [Bug] fixed Incomplete Read JSON
Emit signal requestReceived only after request content is entirely received.
* fix flake8 folder
* fix flake8 folder in python2
* comment out flake8
* comment out flake8
* comment out flake8
* comment out flake8
* comment out flake8
* Minor changes to 2.1 templates to make them work or improve documentation
* Support for ASP.NET Core 3.0 and 3.1
* Update aspnetcore test scripts and results
* Update generated documentation
* update doc
* Update modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache
Co-Authored-By: Tatsuro Shibamura <me@shibayan.jp>
* Update modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache
Co-Authored-By: Tatsuro Shibamura <me@shibayan.jp>
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Tatsuro Shibamura <me@shibayan.jp>
* Fix return type in model setters.
Previously return type was same, as method arguments. It`s wrong, and cause errors like
"Return value of Foo::setSuccess() must be of the type bool, object returned"
We cant use self and current {{classname}} as return type, because that can break class inheritance. So, better remove type hint on setters, until PHP-devs dont make realization for return static
* Add return self type hint for setters
* Revert "Add return self type hint for setters"
This reverts commit 07dd9715
* Fix problem with clients, that put charset in content type header.
With this fix header "Content-Type: application/json; charset=utf-8" working same as "Content-Type: application/json" for parse input data
* Fix code style, add $consumes length check.
* Add isContentTypeAllowed static method and tests
* Fix old tests
Right now serializer doesn't support anything beside json and xml.
Call tests with application/json instead of form data.
Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
* Try decoding but don't bail on error
* Switch binary and ByteArray to bytes
* Read content type and parse appropriately
* Remove response parsing
* Remove response parsing and just return the data
* Update petshop examples w/ new generator code
* Fix copy/paste error with naming
* Update petstore examples
* Move response decoding to inside _preload_content block
* Update the clients again
* Use a raw string for the regex pattern
* Regenerate petstore clients
* Add bytes to python primitives as it's supported in 2.7 and 3
* Add bytes to the exports from model_utils
* Import bytes from model_utils
* Add conditional typing for regex pattern to match variable type
* Regenerate petstore clients
* Use read() instead of text() for asyncio
* Regenerate petstore clients
* Remove unused six import
* Regenerate petstore clients
* Add newline to kick Circle to re-run
* Remove whitespace from tox.ini
* Update more examples after ensure_updated
* Add sample updates that didn't run with the --batch flag
* Remove extra bracket in regex to remove warning
* Stop printing debug messages
* Add bytes examples to python doc generators
* Update generated FakeApi docs
* Regenerate api_client.py
* Remove print statements from generated clients
* Update bytes example in FakeApi.md. Again. I swear.
* Add yet another seemingly missing doc update
* Catch the error, decode the body, and re-throw
* Remove the updates now that the change is non-breaking
* Regenerate client
* Add bytes deserialization test
* Update exception parsing
* Add exception parsing for python-experimental
* Regenerate client with minor changes
* Revert test changes
* Regenerate model_utils.py
* Update confusing test name
* Remove bytes from mapping and examples
* Add back in the old binary/ByteArray to str mapping
* Update docs and api_client template
* Add experimental api_client changes
* Regenerate samples again
* Add Tornado handling to early return
* Try fixing Tornado python returns
* More documentation changes
* Re-generate the client code
* Remove bytes from test_format_test
* Remove more leftover bytes usages
* Switch bytes validation back to string
* Fix format_test template and regenerate
* Remove unused bytes var
* Remove bytes import from models and regenerate
* Remove bytes import from test_deserialization
* Reduce nested ifs
* Remove byte logic for now
* Regenerate client after latest changes
* Remove another bytes usage
* Regenerate after removing dangling byte string usage
* Reduce the scope of the try/catch in api_client
* Regenerate after try/catch cleanup
* Swap catch for except
* Regenerate Python client after api_client change
* Fix lint error on the generated api_client
* Add binary format test back in w/ string
* Add decoding to python-experimental and regenerate
* Import re into python-experimental api_client
* Ensure file upload json response is utf-8 encoded bytes
* [Rust Server] Fix RustServerCodegen type: object example "Disabled because there's no example" issue.
* [Rust Server] Add test case yaml with "Disabled because there's no example" issue.
* [Rust Server] Fix example-client-main param.example character escaping issue with raw string.
* [Rust Server] Add test case yaml new generated code after fix.
* [Rust Server] Fix issue with multiple tags on an operation generating duplicate methods.
* [Rust Server] Add test case yaml with multiple tags on a single operation.
* [scala-akka-http-server] When expecting an empty response, a response with an empty text/plain content is not produced anymore
* Updated scala-akka-http-server samples
Co-authored-by: Olivier Leonard <oleonard@ankama.com>
* [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.
* [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
* Add date time format annotation on pojo for model query parameters
* Regenetare samples
* update spring samples
Co-authored-by: William Cheng <wing328hk@gmail.com>
* 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.
* 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
* 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
* fix default value generation for kotlin
* add updated pet templates
* Revert "add updated pet templates"
This reverts commit 7e8168ad
* regen pet store projects code
* 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>