Restore a as a f32 field, add separate unsigned field in test struct

This commit is contained in:
Piotr Siuszko 2025-07-05 09:46:01 +02:00
parent 4b8d0064ef
commit daf03b5b3a

View File

@ -719,7 +719,8 @@ mod tests {
#[reflect(Resource, Default)] #[reflect(Resource, Default)]
struct Foo { struct Foo {
/// Test doc /// Test doc
a: u16, a: f32,
b: u8,
} }
let schema = export_type::<Foo>(); let schema = export_type::<Foo>();
@ -735,22 +736,29 @@ mod tests {
"Default", "Default",
], ],
"default": { "default": {
"a": 0 "a": 0.0,
"b": 0
}, },
"kind": "Struct", "kind": "Struct",
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"a": { "a": {
"maximum": 65535, "type": "number",
"kind": "Value",
"typePath": "f32"
},
"b": {
"minimum": 0, "minimum": 0,
"maximum": 255,
"type": "integer", "type": "integer",
"kind": "Value", "kind": "Value",
"typePath": "u16" "typePath": "u8"
}, }
}, },
"required": [ "required": [
"a" "a",
"b"
] ]
}); });
if cfg!(feature = "documentation") { if cfg!(feature = "documentation") {