Expand description
§vld-openapi — vld schemas in OpenAPI tools
One module per integration, each behind its feature (none is on by default). The majors of one dependency are additive: any set of features compiles together.
| module | feature | what it does |
|---|---|---|
utoipa5 / utoipa6 | utoipa-5 / utoipa-6 | impl_to_schema!: utoipa ToSchema / IntoParams from a vld type |
schemars0 / schemars1 | schemars-0 / schemars-1 | impl_json_schema! (vld → schemars::JsonSchema, also for aide) and impl_vld_parse! (schemars type → vld validation) |
validator | always | validate JSON against a JSON Schema, inspect and combine schemas, to_openapi3 |
vld-openapi = { version = "0.8", features = ["utoipa-5"] }let schema = serde_json::json!({"type": "string", "minLength": 2});
assert!(vld_openapi::validator::validate_with_schema(&schema, &"hi".into()).is_ok());
assert!(vld_openapi::validator::validate_with_schema(&schema, &"h".into()).is_err());Guide: https://s00d.github.io/vld/integrations/openapi/utoipa
Re-exports§
pub use vld;
Modules§
- schemars0
schemars-0 - schemars
>=0.9, <1: a two-way bridge betweenvldandschemars. - schemars1
schemars-1 - schemars
>=1, <2: a two-way bridge betweenvldandschemars. - utoipa5
utoipa-5 - utoipa 5:
vldschemas as utoipa OpenAPI types. - utoipa6
utoipa-6 - utoipa 6:
vldschemas as utoipa OpenAPI types. - validator
- Version-independent JSON Schema tools: validate a JSON value against a JSON Schema, inspect and combine schemas, rewrite a 2020-12 schema into the OpenAPI 3.0 dialect. No schemars dependency; the schemars modules re-export every item.