#![cfg(feature = "schemars")]
use schemars::Schema;
use serde_json::json;
pub fn integer_schema(_gen: &mut schemars::SchemaGenerator) -> Schema {
let map = json!({
"type": "integer",
"minimum": 0
})
.as_object()
.expect("json! object literal is always a Value::Object")
.clone();
Schema::from(map)
}
pub fn option_integer_schema(_gen: &mut schemars::SchemaGenerator) -> Schema {
let map = json!({
"type": ["integer", "null"],
"minimum": 0
})
.as_object()
.expect("json! object literal is always a Value::Object")
.clone();
Schema::from(map)
}
pub fn option_ast_limit_schema(_gen: &mut schemars::SchemaGenerator) -> Schema {
let map = json!({
"type": ["integer", "null"],
"minimum": 1
})
.as_object()
.expect("json! object literal is always a Value::Object")
.clone();
Schema::from(map)
}
pub fn option_page_size_schema(_gen: &mut schemars::SchemaGenerator) -> Schema {
let map = json!({
"type": ["integer", "null"],
"minimum": 1
})
.as_object()
.expect("json! object literal is always a Value::Object")
.clone();
Schema::from(map)
}