[pbs-devel] [PATCH proxmox 18/19] api-macro: re-order ObjectSchema fields to be sorted

Shannon Sterz s.sterz at proxmox.com
Thu Mar 6 13:43:48 CET 2025


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 <s.sterz at proxmox.com>
---
 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<TokenStream, Error> {
             &::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<TokenStream, Error> {
                         )
                         .schema(),
                     ),
+                    (
+                        "test-string",
+                        false,
+                        &::proxmox_schema::StringSchema::new("A test string.").schema(),
+                    ),
+
                 ],
             )
             .schema();
-- 
2.39.5





More information about the pbs-devel mailing list