byte_unit/bit/schemars_traits.rs
1use alloc::{borrow::Cow, string::String};
2
3use schemars::{JsonSchema, Schema, SchemaGenerator};
4
5use super::Bit;
6
7impl JsonSchema for Bit {
8 #[inline]
9 fn inline_schema() -> bool {
10 true
11 }
12
13 #[inline]
14 fn schema_name() -> Cow<'static, str> {
15 Cow::Borrowed("Bit")
16 }
17
18 #[inline]
19 fn json_schema(generator: &mut SchemaGenerator) -> Schema {
20 generator.subschema_for::<String>()
21 }
22}