mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-05-09 16:10:42 +00:00
start openapi-type codegen
This commit is contained in:
parent
90870e3b6a
commit
d9c7f4135f
9 changed files with 241 additions and 51 deletions
12
openapi_type/tests/fail/not_openapitype.rs
Normal file
12
openapi_type/tests/fail/not_openapitype.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
use openapi_type::OpenapiType;
|
||||
|
||||
#[derive(OpenapiType)]
|
||||
struct Foo {
|
||||
bar: Bar
|
||||
}
|
||||
|
||||
struct Bar;
|
||||
|
||||
fn main() {
|
||||
Foo::schema();
|
||||
}
|
8
openapi_type/tests/fail/not_openapitype.stderr
Normal file
8
openapi_type/tests/fail/not_openapitype.stderr
Normal file
|
@ -0,0 +1,8 @@
|
|||
error[E0277]: the trait bound `Bar: OpenapiType` is not satisfied
|
||||
--> $DIR/not_openapitype.rs:3:10
|
||||
|
|
||||
3 | #[derive(OpenapiType)]
|
||||
| ^^^^^^^^^^^ the trait `OpenapiType` is not implemented for `Bar`
|
||||
|
|
||||
= note: required by `schema`
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
@ -1,5 +1,5 @@
|
|||
error[E0599]: no function or associated item named `schema` found for struct `Foo<Bar>` in the current scope
|
||||
--> $DIR/generics_not_openapitype.rs:11:14
|
||||
--> $DIR/not_openapitype_generics.rs:11:14
|
||||
|
|
||||
4 | struct Foo<T> {
|
||||
| -------------
|
Loading…
Add table
Add a link
Reference in a new issue