Comments (1)
This is possible in schemars 1.0.0-alpha.3 using the extend
attribute:
#[derive(JsonSchema)]
#[schemars(extend("allowTrailingCommas" = true))]
pub struct MyStruct {
foo: i32,
}
produces:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "MyStruct",
"type": "object",
"properties": {
"foo": {
"type": "integer",
"format": "int32"
}
},
"allowTrailingCommas": true,
"required": [
"foo"
]
}
from schemars.
Related Issues (20)
- schemars_derive breaks with version serde_derive_internals 0.29.0 HOT 1
- Support for humantime
- Add CI with latest dependencies
- Compatibility with json-schema.org ? HOT 2
- Switch to indexmap 2 for the `preserve_order` feature HOT 1
- 0.8.18 regression - "type annotations needed" on variantless enum HOT 1
- skip_if for conditional skip
- Behavior change in 0.8.19 with `default`, `required`, and `skip_serializing_if` HOT 3
- `Option` no longer has a default of null as of v0.8.18 HOT 2
- Range for standard number types
- Expected schemars description attribute to be a string HOT 2
- expected validate path attribute to be a string: `path = "..."` HOT 1
- gen keyword is reserved in Rust 2024 HOT 2
- Check if Value satisfies RootSchema HOT 1
- Nested internally tagged enums
- bug(schemars_derive/docs): newlines get stripped in example blocks HOT 1
- flatten of `Option<Enum>` generates schema where enum is required HOT 3
- Document macro attributes HOT 4
- Skips documenting the first endpoint defined after `web::scope`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from schemars.