2070 Commits

Author SHA1 Message Date
Sem Schilder
c0fcffdfe4
Add return types to getter and fluent setter (#5348)
* Add return types to getter and fluent setter

* Add build example output
2020-02-25 11:46:43 +08:00
Richard Whitehouse
1b3094be87
[Rust Server] Add support for untyped properties and models (#5339)
* [Rust Server] Add support for untyped properties
* [Rust Server] Improve support for untyped data
* Update samples
2020-02-22 20:29:51 +00:00
Richard Whitehouse
71aef72bbd
[Rust Server] Support objects as query parameters (#5338)
- Support objects as query parameters
- Update samples
2020-02-22 18:25:57 +00:00
Richard Whitehouse
71f532072b
[Rust Server] Support header objects (#5337)
[Rust Server] Support header objects

Support operations with objects in the header
2020-02-22 15:55:26 +00:00
William Cheng
118b5e7747
[C++] minor improvements (#5319)
* minor code format, make sure cpp samples updated

* add new files
2020-02-14 10:58:15 +01:00
Keenan Pepper
9126a5636f
Use EXISTING_PROPERTY for JavaSpring as well (#5243)
This fixes issue #3796 for JavaSpring. It's a very straightfoward extension
of #5120 for the JavaSpring generator (that PR was just for the Java generator).
2020-02-08 09:09:46 -05:00
fritzlitester
a0eb149df5
Fix query parameter (#5131)
* fix map as query parameter, use RequestPart instead of RequestParam in
FormParams, add filename for parameters of type file

* fix brace

* fix tests

* run bin/windows bat files

* test if this solves linending problem part 1

* test if this solves linending problem part 2

* test if this solves linending problem part 3

* test if this solves linending problem part 4

* test if this solves linending problem part 5

* test if this solves linending problem part 6

* manually set back version in pom

* update spring samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-02-04 22:08:36 +08:00
William Cheng
100b01844a Merge remote-tracking branch 'origin/master' into 5.0.x 2020-02-04 15:31:10 +08:00
William Cheng
b36b65964f update kotlin samples 2020-02-03 16:32:31 +08:00
William Cheng
03a59046f4 Merge remote-tracking branch 'origin/4.3.x' 2020-01-31 19:00:28 +08:00
Yutaka.Miyamae
8214460ec5
Add deprecated annotation in kotlin-spring (#5090)
* add Deprecated in kotlin dataClass

* add deprecated in CodegenProperty

* format (Column limit: 100)

* set property.deprecated

* add test

* run ./bin/kotlin-springboot-petstore-all.sh

* trim space
2020-01-29 16:30:33 +08:00
Richard Whitehouse
84b6804d8f [Core, Rust Server] Support multipart/related requests (#5015)
* [Core, Rust] Support multipart/related requests

* Treat multipart/related as a type of form data
2020-01-26 20:39:43 -05:00
Richard Whitehouse
52e09e2ffa
[Rust Server] Handle array of objects inside an object correctly (#5044)
Use correct data type for arrays inside objects.

Add test for arrays of objects

Update samples
2020-01-25 18:23:20 +00:00
Richard Whitehouse
2714af4922
[Rust Server] Sanitise enum values (#5042)
[Rust Server] Sanitize enum values
2020-01-25 16:26:05 +00:00
Richard Whitehouse
32222da435
[Rust Server] Add support for primitive arrays (#5041)
[Rust Server] Add support for primitive arrays
2020-01-25 16:25:20 +00:00
Yuriy Belenko
0366e946ba [Slim4] Add string formats support to Data Mocker (#4975)
* [Slim4] Support byte data format

* [Slim4] Support date and date-time data formats

* [Slim4] Support password data format

* [Slim4] Support uuid data format

* [Slim4] Fix test of password format mocking

'00000' is numeric type, because PHPUnit doesn't make strict type
comparison.

* [Slim4] Fix data format key in object mocking

* [Slim4] Support binary data format

* [Slim4] Support email data format

* [Slim4] Base64 encode binary format output

Raw bytes string breaks PHP stdout output, so I've decided to use base64
encoding format for binary format too.

* [Slim4] Refresh samples
2020-01-23 16:18:18 +08:00
Mateusz Szychowski (Muttley)
6af27d52ca [C++][Pistache] Rename value holder to lower chance of collision with parameter name (#4948)
* [C++][Pistache] Rename value holder to lower chance of collision with parameter name

* [C++][Pistache] Update Petstore sample
2020-01-21 00:47:26 +01:00
Jim Schubert
2bc3c196e8
[aspnetcore] Fix duplicate enums (#5059)
* [aspnetcore] Fix duplicate generation of enums

Fixes template issue where enums defined within a class were generated
regardless of whether they were a complexType (externally defined
"model") or an inlined enum.
2020-01-20 16:37:15 -05:00
William Cheng
82e2448bf2 Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2020-01-20 15:46:13 +08:00
William Cheng
04af5e0445 Merge remote-tracking branch 'origin/master' into 4.3.x 2020-01-20 15:04:34 +08:00
Sebastien Rosset
d61dcc17e0 [gradle] consistent use of maven url in gradle files (#5045)
* wrap maven url with uri function

* consistent use of maven url in gradle files
2020-01-19 14:57:38 -05:00
William Cheng
fff759b79c
[Python] fix numeric enum in python flask, aiohttp (#5019)
* minor code format fix

* fix numeric enum in python flask and aiohttp

* add python-server-all.sh to ensure-up-to-date
2020-01-19 15:25:20 +08:00
Jim Schubert
ea55968737
Evaluating https issues in CircleCI (on top of CiscoM31-maven-h… (#5034)
* replace http with https. Replace http://central.maven.org with https://repo1.maven.org

* replace http://www.apache.org/licenses/LICENSE-2.0 with https://www.apache.org/licenses/LICENSE-2.0

* Force HTTPS for mavenCentral gradle DSL

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2020-01-18 18:53:05 -05:00
Yuriy Belenko
420039c9eb [Slim4] Add integer formats support to Data Mocker (#4965)
* [Slim4] Support int32 and int64 data formats

* [Slim4] Fix data format key in object mocking

* [Slim4] Refresh samples
2020-01-18 16:08:13 +08:00
William Cheng
3f074a280a
minor improve to rust server (#5020) 2020-01-17 18:54:31 +08:00
aandyl
67d23fcf7e [Rust Server] fix handling of special characters in path param names (#4897)
* test for hyphen in path parameter name

* fix handling of hyphens in path parameter names
2020-01-17 15:44:23 +08:00
Justin Black
fcdbcb095e Updates maven urls, fix #5011 (#5012)
* Updates maven urls

* Runs ensure up to date'
2020-01-16 17:24:20 +08:00
Sebastien Rosset
fe8775a5a5 fix php ordering issue for CodegenSecurity (#5001) 2020-01-15 07:39:04 +01:00
William Cheng
50f7e14a99 update samples 2020-01-14 23:07:37 +08:00
Justin Black
bf24d646c5 [PHP] fix php-slim4-server CI tests #4994 (#4995)
* Suggested no-api fix

* Adds sample update
2020-01-14 08:29:18 +03:00
Jim Schubert
78bf3adc4a
[core] Initial FeatureSet structures and definitions (#3614)
[core] Initial FeatureSet structures and definitions
Add default feature set to DefaultCodegen
Initial FeatureSet definitions for:

*  ada 
*  android 
*  apache2 
*  asciidoc 
*  aspnetcore 
*  avro 
*  bash 
*  c 
*  clojure 
*  cpp-pistache-server 
*  cpp-qt5-client 
*  cpp-qt5-qhttpengine-server 
*  cpp-restbed-server 
*  cpp-restsdk 
*  cpp-tizen 
*  csharp 
*  csharp-nancyfx 
*  csharp-netcore 
*  cwiki 
*  dart 
*  eiffel 
*  elixir 
*  elm 
*  erlang 
*  flash 
*  fsharp-functions 
*  go  Client/Server
*  graphql-nodejs-express-server 
*  graphql-schema 
*  groovy 
*  haskell 
*  haskell-http-client 
*  java 
*  jmeter 
*  kotlin 
*  kotlin vertx 
*  kotlin-server 
*  kotlin-spring 
*  lua 
*  mysql 
*  nim 
*  nodejs 
*  nodejs-express 
*  objc 
*  ocaml 
*  openapi 
*  openapi-yaml 
*  perl 
*  php 
*  php-laravel 
*  php-lumen 
*  php-silex 
*  php-slim 
*  php-symfony 
*  php-ze-ph 
*  powershell 
*  protobuf 
*  protobuf-schema 
*  python 
*  python-aiohttp 
*  python-blueplanet 
*  python-experimental 
*  r 
*  ror 
*  ruby 
*  ruby 
*  ruby-sinatra 
*  rust 
*  scala-akka 
*  scala-finch 
*  scala-gatling 
*  scala-http-client 
*  scala-lagom 
*  scala-play 
*  scalatra 
*  scalaz 
*  spring 
*  static docs 
*  swift 
*  typescript
2020-01-11 16:20:47 -05:00
William Cheng
20c7400d56 update samples 2020-01-10 21:51:59 +08:00
Yuriy Belenko
6dcdf5c311 [Slim4] Add ref support to Data Mocker (#4932)
* [Slim4] Add new method to Mocker interface

* [Slim4] Add implementation and tests for new method

* [Slim4] Add test fixture to encrease code coverage

* [Slim4] Add ref support to mockArray method

* [Slim4] Add mockFromRef method

* [Slim4] Add ref support to mockObject method

* [Slim4] Add ModelInterface

* [Slim4] Refresh samples

* [Slim4] Add ref support to mockFromSchema method

* [Slim4] Run all test suites by default test command

As it turnes out to generate coverage report for a whole project I need
to run all test suites at once.

* [Slim4] Fix enum option of string mocking
2020-01-10 16:27:43 +08:00
Jim Schubert
ec1e9a4c9b
[csharp] enum suffix changes enumValueNameSuffix to enumValueSuffix (#4927)
* [csharp] Change enum value suffix name

'enumValueNameSuffix' and 'enumNameSuffix' were introduced in a recent
commit. This changes 'enumValueNameSuffix' to 'enumValueSuffix' to
better differentiate between the two options. This also adds a caveat to
the default description which explains that this flexibility may cause
issues when used by client generator.

* [csharp][aspnetcore] Regenerate samples
2020-01-05 16:18:19 -05:00
Richard Whitehouse
e9459125bb
[Rust Server] Hyper 0.12 Support (#4519)
[Rust Server] Hyper 0.12 Support

- Hyper upgraded to Hyper 0.12.
  - NewService becomes MakeService
  - Request on MakeContext is not parameterised - instead, ReqBody, and ResBody are parameterized, and must implement hyper::body::Payload.
  - This means that our existing tuples (i.e. (Body, Context)) don't work - instead we have a type ContextualPayload, which implements Payload, and derefs to an inner payload (the body), and contains a context.
  - This is handled by the work done in Metaswitch/swagger-rs#63 but has some fall out here as well.

- tokio-proto/tokio-core is no longer supported, and hyper instead depends on tokio.

- Hyper depends on mime 0.3, but multipart depends on mime 0.2, so we now import both

- Hyper TLS 0.2 and native-tls 0.1

- Use Swagger Support library 3.x

- Futures are now Send. This forces ApiImpl to be need to Send as a result, and all forces Clients to be Send + Sync.
2020-01-05 14:48:12 +00:00
Richard Whitehouse
79d11d7129
[Rust Server] Fix panic handling headers (#4877)
[Rust Server] Fix panic handling headers

If we have an API which has multiple auth types, we may panic. This is because
in Hyper 0.11, the following code will panic:

```
use hyper::header::{Authorization, Basic, Bearer, Headers};
fn main() {
    let mut headers = Headers::default();
    let basic = Basic { username: "richard".to_string(), password: None };
    headers.set::<Authorization<Basic>>(Authorization(basic));
    println!("Auth: {:?}", headers.get::<Authorization<Bearer>>());
}
```

as it mixes up an `Authorization<Basic>` and `Authorization<Bearer>` as both
have `Authorization:` as the header name.

This is fixed by using `swagger::SafeHeaders` added in
https://github.com/Metaswitch/swagger-rs/pull/90
2020-01-05 14:46:09 +00:00
Jim Schubert
25036e48d5
[scala] Support for Set when array has uniqueItems=true (#4926)
* [scala] Set support for unique arrays

This includes and builds upon community contribution for better Set support in Scala.
It makes property + model work as expected with Set and default values
across all Scala generators. Included tests to account for new changes.

This also reverts the community contribution to remove ListBuffer
imports and change the default for array to ListBuffer. Users should use
the instantiation types map to modify the desired array instantiation
type. Any new default should target a new minor release after community
discussion, as it affects all existing SDKs generated with
openapi-generator.

* [scala] Improve default handling of monadic collection type

* [scala] Regenerate samples

* Update ScalaPlayFrameworkServerCodegen.java

Scala Play defaulted to List and should continue to do so.

Co-authored-by: František Kocun <frantisek.kocun@gmail.com>
2020-01-05 09:20:56 -05:00
William Cheng
965efdd965
remove nodejs server samples, scripts (#4919) 2020-01-05 21:53:22 +08:00
AlexG
1cb99e3497 [cpp-restbed] Added "out-of-the-box" functionality (#4759)
* Added cpp-restbed "out-of-the-box" functionality
* handling class dependencies
* added method override to clean interfaces of ambiguity
* added default values for shared pointers
* fixed _name and name parameters generating the same getters and setters
* updated enum handling
* updated Petstore samples
* updated templates for automated object generation

* fix whitespace

* removed model initialisation

* added model brace initialisation
2020-01-02 20:36:22 +08:00
Bruno Coelho
9d53ee4b69 [kotlin][client] make Request date converter toJson as default (#4884)
* Fix for Issue #2205

Because when we have tags on OpenAPI Specification, there can be more than 1 Feign Beans being generated and the title field is share by all the clients. This makes the code to stop working in runtime.
Here is a PR which uses the classVarName instead, which follows the standards and should be enough to solve this issue.

For more info please refer to: https://github.com/OpenAPITools/openapi-generator/issues/2205

* fix java feign parameter request name (#4883)

* update sprign cloud feign sample

* [JAVA][SPRING][2195] added missing getter for enum value (#2346)

* [2195] added missing getter for enum value

* updated samples

* re-generate spring samples

* Removed @JsonValue from toString and regenerated samples

* re-generate spring samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* update samples

* [kotlin][client] make Request date converter toJson as default

* [kotlin][client] update windows scripts

* [kotlin][client] update docs

* [kotlin][client] update scripts

* [kotlin][client] update scripts

Co-authored-by: Filipe Manuel Couto Pinheiro <filipemcpinheiro@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Lukáš Vasek <bilaak@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-01-02 13:46:49 +08:00
sullis
178a3e24bd upgrade to JUnit 4.13 (#4899) 2020-01-02 13:20:29 +08:00
William Cheng
ac4ead9e78 update samples 2019-12-29 18:13:30 +08:00
Lukáš Vasek
f37d26cc73 [JAVA][SPRING][2195] added missing getter for enum value (#2346)
* [2195] added missing getter for enum value

* updated samples

* re-generate spring samples

* Removed @JsonValue from toString and regenerated samples

* re-generate spring samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2019-12-29 16:21:32 +08:00
William Cheng
b450ce8a5a Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-12-28 12:34:30 +08:00
William Cheng
81e15ed0bf Merge remote-tracking branch 'origin/master' into 4.3.x 2019-12-28 12:00:09 +08:00
Richard Whitehouse
57d248dd3d
[Rust Server] Rust 1.39 compatibility (#4864)
- Fix warnings present in Rust 1.39 resolving missing dyn markers
- Upgrade to lazy_static - fixes #4271
- Update samples
2019-12-27 23:32:21 +00:00
William Cheng
54cfab84b6 run ensure-up-to-date 2019-12-28 01:12:26 +08:00
Jim Schubert
376e419d0b Support models with multi-level hierarchy (via roxspring) (#4503)
* Example of broken multi-level hierarchy

* Support for multiple levels of hierarchy in model objects

* Support for multiple levels of hierarchy in generators

* Regenerated samples

* Temporarily skip scalaz sample verification, which is having issue with Java version in CI container

* Re-enable scalaz in verify samples

Co-authored-by: Rob Oxspring <roxspring@imapmail.org>
2019-12-27 15:42:32 +08:00
Richard Whitehouse
0c92b0c4a4
[Rust Server] Handle multiple response type (#4441)
- Ensure response IDs are unique, even if the first sentence is identical
- Handle responses where different responses produce a different type of data
- Use the correct mime type for plain text and byte streams
- Tidy up whitespace in client-mod.mustache
- Specify locale for String.format
- Add test for multiple response types
- Update samples
2019-12-24 15:09:22 +00:00
Yuriy Belenko
2949b53820 [Slim4] Add integration tests (#4858)
* [Slim4] Add integration tests

* [Slim4] Remove unnecessary syntax check script

Composer package called "phplint" processes the same syntax check and
even faster. It can use cache when files hasn't been changed.

* [Slim4] Exclude composer.lock from codebase

Travis CI fails, it cannot install dependencies from lock file under
different PHP(7.1.33) version.
2019-12-23 11:39:49 +08:00