249 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
William Cheng
50f7e14a99 update samples 2020-01-14 23:07:37 +08: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
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
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
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
William Cheng
11c7007429
Prepare v4.2.3 (#4663)
* update version

* update doc

* update samples
2019-12-02 15:26:01 +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
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
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
William Cheng
4824bb7711 sync master, update samples 2019-11-04 09:28:19 +08:00
William Cheng
47e2c0d027
update samples (#4334) 2019-10-31 13:31:49 +08:00
wing328
54151891cc Merge branch 'master' into 5.0.x 2019-10-17 11:18:57 +08:00
William Cheng
cf38c56aa6
Fix readonly with isReadOnly (#4102)
* fix readonly

* update samples
2019-10-09 15:16:22 +08:00
William Cheng
5eb67d471b Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-09-22 21:00:38 +08:00
William Cheng
3019b5a5e1 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-09-22 14:18:07 +08:00
Richard Whitehouse
4538db92a2
[Rust Server] Support parameters correctly in response headers (#3669)
[Rust Server] Compile responses with headers

* Add test for response with headers

* Update samples
2019-09-15 15:54:38 +01:00
Richard Whitehouse
9647416032
[Rust Server] Support types with additional properties (#3666)
[Rust Server] Support additional property types

* Add support for types which only contain additional properties

* Update samples
2019-09-15 14:27:40 +01:00
William Cheng
ea029b4029
update doc, samples (#3875) 2019-09-11 21:17:11 +08:00
William Cheng
3ebefccfa9
Prepare v4.1.2 release (#3873)
* update samples

* update date
2019-09-11 18:33:27 +08:00
William Cheng
a8fe5d355c Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-08-29 14:48:00 +08:00
William Cheng
9182784955 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-08-28 14:01:20 +08:00