From ccb34b33e28778ba49d94a3bca84a537d68bac8b Mon Sep 17 00:00:00 2001 From: Shannon Sterz Date: Thu, 6 Mar 2025 13:43:48 +0100 Subject: [PATCH] api-macro: re-order ObjectSchema fields to be sorted this panics when running `cargo test` otherwise, as the api macro requires fields in `ObjectSchema`s to be sorted now. Signed-off-by: Shannon Sterz --- proxmox-api-macro/src/lib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/proxmox-api-macro/src/lib.rs b/proxmox-api-macro/src/lib.rs index bc05c74f..e4a0ea98 100644 --- a/proxmox-api-macro/src/lib.rs +++ b/proxmox-api-macro/src/lib.rs @@ -183,12 +183,7 @@ fn router_do(item: TokenStream) -> Result { &::proxmox_schema::ObjectSchema::new( "An example of a struct with renamed fields.", &[ - ( - "test-string", - false, - &::proxmox_schema::StringSchema::new("A test string.").schema(), - ), - ( + ( "SomeOther", true, &::proxmox_schema::StringSchema::new( @@ -196,6 +191,12 @@ fn router_do(item: TokenStream) -> Result { ) .schema(), ), + ( + "test-string", + false, + &::proxmox_schema::StringSchema::new("A test string.").schema(), + ), + ], ) .schema();