Generate schema from any serializable value (#75)
Implement schema_for_value!(...) macro
This commit is contained in:
parent
0957204bc1
commit
f6482fd460
19 changed files with 1179 additions and 5 deletions
5
schemars/tests/ui/schema_for_arg_value.rs
Normal file
5
schemars/tests/ui/schema_for_arg_value.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
use schemars::schema_for;
|
||||
|
||||
fn main() {
|
||||
let _schema = schema_for!(123);
|
||||
}
|
7
schemars/tests/ui/schema_for_arg_value.stderr
Normal file
7
schemars/tests/ui/schema_for_arg_value.stderr
Normal file
|
@ -0,0 +1,7 @@
|
|||
error: This argument to `schema_for!` is not a type - did you mean to use `schema_for_value!` instead?
|
||||
--> $DIR/schema_for_arg_value.rs:4:19
|
||||
|
|
||||
4 | let _schema = schema_for!(123);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
Loading…
Add table
Add a link
Reference in a new issue