admin api: make all requests and responses (de)serializable

This commit is contained in:
Alex Auvolat
2025-01-28 17:07:34 +01:00
parent ed58f8b0fe
commit f538dc34d3
3 changed files with 79 additions and 60 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ macro_rules! admin_endpoints {
$($endpoint:ident,)*
] => {
paste! {
#[derive(Serialize, Deserialize)]
pub enum AdminApiRequest {
$(
$special_endpoint( [<$special_endpoint Request>] ),
@@ -13,7 +14,7 @@ macro_rules! admin_endpoints {
)*
}
#[derive(Serialize)]
#[derive(Serialize, Deserialize)]
#[serde(untagged)]
pub enum AdminApiResponse {
$(