Skip to main content

schema_type

Function schema_type 

Source
pub fn schema_type(schema: &Value) -> Option<String>
Expand description

Get the “type” field from a JSON Schema.

let schema = serde_json::json!({"type": "string"});
assert_eq!(vld_openapi::validator::schema_type(&schema), Some("string".to_string()));