schemars
schemars copied to clipboard
Generate JSON Schema documents from Rust code
Hello, I'm writing a REST API and using `schemars` with `rocket_okapi` and `okapi` to create the documentation. This is working quite well so far, but I encountered an issue. I'm...
Hey I'm trying to generate typescript types from the generated JSON schema and am running into a bit of a design constraint. Basically the generated type for an enum that...
The `sqlx` package has a wrapper `Json` type that indicates that a structure represented as JSON in an SQL query should be deserialized into the given type. This PR adds...
(cf. Issue #11: Option\ gets required in schema) Type: ``` pub struct MyType { my_prop: Option } ``` gets written into a schema as not required. When generating a TypeScript...
Setting a maximum and minimum value for more numeric types, where that's possible. Would be nice to do this for more types, but while we have nothing better than `f64`...
```rust mod a { use super::*; #[derive(JsonSchema)] pub struct Config { test: String, } } mod b { use super::*; #[derive(JsonSchema)] pub struct Config { test2: String, } } #[derive(JsonSchema)]...
I was curious about the stability guarantees that `schemars` provides, referencing this thread: https://github.com/rustgd/cgmath/pull/516#issuecomment-685284325 Specifically: > Would it work if the struct has fields serialized by different versions of this...
Received via email > Is there a way to get schemars to add serde aliased enum values to the generated schema? E.g. each aliased value shows up in the enum...