2070 Commits

Author SHA1 Message Date
Yuriy Belenko
ca4f718748 [Slim4] Add ModelUtils and StringUtils (#4855)
* [Slim4] Add StringUtils and ModelUtils classes

* [Slim4] Refresh samples
2019-12-22 15:04:30 +08:00
Yuriy Belenko
04ac754d3e [Slim4] Add object support to Data Mocker (#4853)
* [Slim4] Add new method to Mocker interface

* [Slim4] Add tests and implement mockObject method

* [Slim4] Accept items as object in mockArray method

* [Slim4] Add test for array of objects

* [Slim4] Refresh samples

* [Slim4] Remove abandoned debug comment

* [Slim4] Improve tests code coverage
2019-12-22 15:03:22 +08:00
Justin Black
3959530465 [Python] Updates python test framework to pytest (#4765)
* Switches python generators to use pytest, useNose CLI option added if to allow nose to be used instead

* Adds ensure-up-to-date changes

* Adds setup.cfg to python clients so we can configure nose when useNose=true

* Adds fix for python-aiohttp testing, adds files missing from ensure-up-to-date
2019-12-22 14:14:04 +08:00
William Cheng
165a9e0508 Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-12-20 20:52:27 +08:00
William Cheng
531dc30917 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-12-20 20:38:49 +08:00
Bruno Coelho
265ad2297b [kotlin] add options sortParamsByRequiredFlag and sortModelPropertiesByRequiredFlag (#4707)
* [kotlin] add option to sortParamsByRequiredFlag

* [kotlin] add option to sortParamsByRequiredFlag

* [kotlin][client] sort parameters in the models

* [kotlin] update docs

* [kotlin][client] simplify sortParamsByRequiredFlag implementation

* [kotlin] experiment with sortnmodel properties by name

* [kotlin] introduce sortModelPropertiesByRequiredFlag

* [kotlin] update docs

* [kotlin] update kotlin

* [kotlin] fix tests

* [kotlin] update docs

* Revert "[kotlin] update docs"

This reverts commit 88ad825de5b4c090fe04398bdfde2e9d3252742f.

* [kotlin] update docs and petstores

* [kotlin] update docs

* [kotlin] update pet projects
2019-12-20 17:42:48 +08:00
Yuriy Belenko
c6ec794293 [Slim4] Add PHP syntax checker (#4831) 2019-12-19 11:07:10 +08:00
Yuriy Belenko
0ae1ea68fb [Slim4] Add array support to Data Mocker (#4801)
* [Slim4] Add new method to Mocker interface

* [Slim4] Add tests and implement mockArray method

* [Slim4] Refresh samples

* [Slim4] Extract OAS properties in separated method
2019-12-18 09:59:35 +08:00
Pelle Stenild Coltau
f6dbd48b9c [Swift4] Expanding CodableHelper with added date and JSON customisations (#3365)
* Expanding CodableHelper with a more customisable dateFormatter and JSON en-/decoder.

* Ran ./bin/swift4-petstore.sh

* Ran ./bin/swift4-petstore-all.sh again after merge from master.

* Ran ./bin/swift4-petstore-all.sh again after building.

* Ran ./bin/swift4-petstore-all.sh again after rebase latest from upstream master.

* sync master, update samples

* Built and ran ./bin/swift4-petstore-all.sh

* Re-adding code which disappeared in rebase from master.

* Fixed test

* [swift] remove old classes
2019-12-16 17:40:53 +08:00
Andrii Hrytsiuk
a9cc96b50f fix template for RequestBody, added 'required' attribute (#3134) (#4756)
* fix template for RequestBody, added 'required' attribute (#3134)

* update Spring samples (#3134)
2019-12-16 17:34:59 +08:00
Yuriy Belenko
7bd378c026 [Slim4] Data mocker for scalar types (#4751)
* [Slim4] Add OpenApiDataMocker interface template

* [Slim4] Implement scalar types in data mocker

* [Slim4] Cleanup, remove unused variables

I've rejected the idea to keep Composer dependencies in Java/codegen
variables at some point of time. It seems that after Git rebase I forgot
to delete them.

* [Slim4] Refresh samples

* [Slim4] Add pattern option to mockString method

[ref] https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.8

* [Slim4] Add enum option to mockString method

[ref] https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.20

* [Slim4] Refactor mockInteger and mockNumber tests

* [Slim4] Refactor mockString tests

* [Slim4] Use null coalescing operator

* [Slim4] Implement enum option in mockString method

* [Slim4] Add tests for enum option of mockString
2019-12-16 17:32:07 +08:00
William Cheng
466a67c9bc Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-12-12 17:27:49 +08:00
William Cheng
3e34903042 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-12-11 15:44:50 +08:00
Justin Black
307f37c7f9 Updates python and python-flask travis CI testing to use python 3.6, 3.7, and 3.8 (#4743) 2019-12-10 11:29:14 +08:00
rbrincke
42f685f59c Fix multi-part binary array form parameters for Spring Boot and Spring Cloud templates (#4616)
* Fix multi-part binary array strings

Multi-part binary array strings as outlined in #3139 resulted in `MultipartFile` rather than `List<MultipartFile>`. This PR attempts to resolve this by adjusting the templates.

Two tests have been added: one for `spring-boot` and one for `spring-cloud`.

Resolve #3139

* Fix multipart file name and description

* Handle array of MultipartFile for delegate

* Update samples due to file description being picked up

* Upload result of bin/spring-stubs
2019-12-09 20:59:05 +08:00
Yuriy Belenko
41bb41c87c [Slim4] Update templates to comply PSR-12 coding style (#4728)
* [Slim4] Bump PHP_CodeSniffer version to 3.5.*

* [Slim4] Update samples

* [Slim4] Update template to meet PSR-12
2019-12-09 11:20:21 +08:00
Christophe Bornet
d405158d3f Add javadoc to spring API, controller and delegate (#4693)
* Add javadoc to spring API, controller and delegate

* Add response description and code in javadoc
2019-12-09 11:15:57 +08:00
Vadim Markovtsev
8d8eea4fe9 Fix typo aiohtpp -> aiohttp (#4709) 2019-12-06 00:02:43 +08:00
William Cheng
e774db05b6
Regenerate hashCode, equals, toString (#4648)
* update hashCode, equals, toString in CodegenParameter

* update equals, hashCode, toString in CodegenProperty

* update toString, hashCode, equals in CodegenOperation

* update toString, hashCode, equals in CodegenResponse

* update toString, hashCode, equals in CodegenSecurity

* update hashCode, toString, equals in CodegenModel

* add hashCode, toString, equals to CodegenServer and more

* update hashCode, equals, toString in CodegenDiscriminator

* update testS

* update samples
2019-12-04 10:07:33 +08:00
William Cheng
11c7007429
Prepare v4.2.3 (#4663)
* update version

* update doc

* update samples
2019-12-02 15:26:01 +08:00
Mateusz Szychowski (Muttley)
e2df6c32e0 [C++][Pistache] Add comparison operators (#4619)
* [C++][Pistache] Add comparison operators

* [C++][Pistache] Update Petstore sample
2019-11-27 22:28:51 +01:00
Thibault Duperron
2dc0220874 Add mutable model option to kotlin generators (#4115)
* Add mutable model option to kotlin generators

fix #3803

* doc

* Change template name to modelMutable

* Samples
2019-11-27 18:04:43 +08:00
Jason Lee
40799937fb add go.mod as supporting files to go-server (#4592) 2019-11-25 15:58:51 +08:00
William Cheng
fffe7c8a83 update samples 2019-11-23 00:24:50 +08:00
William Cheng
ac8b96b972 update samples without batch mode 2019-11-21 17:13:30 +08:00
William Cheng
4ed742b6bc update samples 2019-11-21 15:24:13 +08:00
William Cheng
facabd4472 Merge branch '4.3.x' into 5.0.x 2019-11-21 15:19:31 +08:00
William Cheng
60f4de0f22 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-11-20 18:15:22 +08:00
Fjolnir-Dvorak
23479b30e4 [FIX][Haskell-servant] missing indent on the new feature pull request. (#4490)
* missing indent on the new feature pull request.

* One indentation to much

* Import for application was still missing

* some middleware got in the runServer name
2019-11-20 11:40:19 +08:00
Massimo Siani
964260101b [kotlin-spring] add support for the delegate pattern (#3925)
* #2526 support the delegate pattern for kotlin-spring

* fix the diamond

* update the doc

* fix ci

* use Resource? instead of MultipartFile when dealing with files

* bump after rebase on master
2019-11-19 15:22:29 +08:00
Jim Schubert
8766531c56 [java] Fix java version defaulting (#4520)
* [java] Improve assumptions about artifactVersion

The logic to apply a default artifactVersion was faulty, resulting in
generation without an explicit version specified either on the OpenAPI
Document or at the CLI/plugin level would result in poms generated with

    <version></version>

As an example, in any commit made up to 5 weeks before this commit, run:

    ./bin/java-pkmst-petstore-server.sh

The solution is to ensure that artifactVersion isn't overwritten by an
"in-process" additonalProperties map, and also to ensure that
additionalProperties is synced with the artifactVersion property once it
has been modified.

As a future task, we'll want to move any modification of
additionalProperties outside of preprocessOpenAPI (to processOpts).
We're hiding manipulation of the "Opts" at a point where we should
really only be applying logic on top of the OpenAPI doc.

* [sample] Regenerate java-pkmst sample
2019-11-18 11:32:54 +08:00
Jim Schubert
47ac49ff99 Regenerate samples 2019-11-17 20:20:34 -05:00
William Cheng
bf6db1c2d1 update samples 2019-11-17 14:28:41 +08:00
Jan
5181ddcbb0 fix: prevent ClassCastException when handling options of (issue #4468) (#4495)
* issue 4468 fix: prevent ClassCastException when handling options of type boolean

*  #4468 fix: remove duplicate code
2019-11-17 08:59:25 +08:00
William Cheng
f07b3e0521
Prepare 4.2.2-SNAPSHOT (#4497)
* update to 4.2.2-SNAPSHOT

* update doc

* update samples

* skip ocaml test

* update version

* fix version
2019-11-15 21:34:25 +08:00
Sébastien Masset
99204ecd66 Avoid generating uncompilable response body in Spring's API template (#2903)
* Moved example string to a dedicated variable in Spring's methodBody template

* Created a new exampleString template for JavaSpring

* Added a new mustache lambda to trim whitespace in fragments

* Added a new lambda to split long fragments into compilable strings

* Use newly introduced lambdas in Spring's API template to avoid generating uncompilable example code
2019-11-12 17:49:05 +08:00
William Cheng
db729be7df
[Go][Server] minor enhancement to the template (#4417)
* minor enhancement to the go server template

* update samples
2019-11-09 11:24:12 +08:00
Richard Whitehouse
de162f7f34
[Core, Rust Server, ASP.NET Core] Fix Codegen Operation Scope Consistency (#3495)
Fix Codegen Operation Scope Consistency

- Filter scopes based on operation

- Partially revert #1984 to not rely on custom attributes as to whether scopes exist

- Fix filtering global authentication schemes
2019-11-08 13:30:35 +00:00
Martin Slemr
f0bcaaf45d Ruby client nullable (#4391)
* Ruby Client: implementation of nullable

* Ruby samples with nullable implementation

* [Ruby] openapi_nullable as a Set and skipping attrs fix
2019-11-07 16:15:00 +08:00
sunn
c25a02f77f
update cpp flag for pistache (#4386) 2019-11-06 10:07:59 +01:00
William Cheng
4ca9430474 sync master, update doc 2019-11-04 09:38:22 +08:00
William Cheng
4824bb7711 sync master, update samples 2019-11-04 09:28:19 +08:00
Jason Lee
3f72f8da50 refactor java-vertx-web parameters and bugfix on non primitive parameter (#4353) 2019-11-03 17:24:46 +08:00
lwlee2608
a9ea8636e5 fix cpp-restbed-server json field serialization #4320 (#4323) 2019-11-01 10:56:12 +08:00
William Cheng
47e2c0d027
update samples (#4334) 2019-10-31 13:31:49 +08:00
Fjolnir-Dvorak
d624b28c96 [FEATURE][Haskell] Haskell-Servant serves static files (#4058)
* updated the golden files for haskell to be able to generate against those

* Haskell-servant now serves static files which are in a directory called "static"

* I missed to regenerate the docs directory
2019-10-30 20:47:53 -05:00
Fjolnir-Dvorak
4958ad74e7 [FEATURE][Haskell] Add Middleware support for the haskell servant generator (#4056)
* updated the golden files for haskell to be able to generate against those

* Added support for middlewares in the haskell servant generator.

* Renamed runOpenAPIPetstoreServer to runOpenAPIPetstoreMiddlewareServer and added a backwards compability version runOpenAPIPetstoreServer using requestMiddlewareId as middleware.
2019-10-30 20:47:35 -05:00
William Cheng
5dcde3f855
[Go][Server] better tests (#4295)
* better test for go-api-server

* better test for go gin server

* fix go-api-server test

* fix folder path

* remove red test

* update test files

* update script with gofmt

* update windows batch files

* discard changes before running ensure-up-to-date

* add go-api-server to ensure uptodate script
2019-10-29 15:15:24 +08:00
lwlee2608
0f2272d9a4 Implement Server Stub Code for Vert.x Web #115 (#4286)
* InlineResolver to flatten callback operations

Signed-off-by: lwlee2608 <lwlee2608@gmail.com>

* clone from VertxServerCodegen, to new VertxWebServerCodegen

* fix compilation error in VertxWebCodegn

* Start working on VertxWebServerCodegen, adding support files

* add server api handler

* add server api and fix yaml spec file generation

* link api to apiHandler

* convert vertx parameters into API model

* add support to multipart/form-data upload files

* ability to set http status code from ApiImpl

* replace rootPackage with invokerPackage

* add readme and sample

* fix circleCi error

* override file to FileUpload in typeMapping, no need to override from fromOperation(). Also remove unused annotation import from model

* remove smartBear software copyright

* use {{artifactVersion}} instead of hardcode version in readme

* add -t flag in generation script

* add generated vertx-web server to master pom for testing
2019-10-28 14:08:21 +08:00
Jesse Michael
00c6e0a64b Return Router interface from controller constructor. (#4196)
Update the go server api controller template to return the Router interface instead of the api specific router.
The Router interface type has the Routes function, which is what the generated `NewRouter` function needs. (not the api specific interface).
2019-10-22 15:27:08 +08:00