@@ -164,7 +164,6 @@ impl serde::Serialize for UpdateProduct {
164164/// Every key in `Products` is a product name. Known products (`Gateway`, `Agent`,
165165/// `HubService`) are processed natively; any other name is forwarded as-is to the
166166/// agent so future product types are supported transparently.
167- #[ cfg_attr( feature = "openapi" , derive( utoipa:: ToSchema ) ) ]
168167#[ derive( Debug , Default , Deserialize ) ]
169168#[ serde( rename_all = "PascalCase" ) ]
170169pub ( crate ) struct UpdateRequest {
@@ -173,6 +172,15 @@ pub(crate) struct UpdateRequest {
173172 pub products : HashMap < UpdateProduct , UpdateProductInfo > ,
174173}
175174
175+ /// OpenAPI schema for the update request body.
176+ ///
177+ /// The API accepts a map from product name to update information.
178+ #[ cfg( feature = "openapi" ) ]
179+ #[ derive( Serialize , utoipa:: ToSchema ) ]
180+ #[ schema( as = UpdateRequest ) ]
181+ #[ serde( transparent) ]
182+ pub ( crate ) struct UpdateRequestSchema ( pub HashMap < String , UpdateProductInfo > ) ;
183+
176184/// Response returned by the update endpoint.
177185#[ cfg_attr( feature = "openapi" , derive( utoipa:: ToSchema ) ) ]
178186#[ derive( Serialize ) ]
@@ -270,7 +278,7 @@ fn apply_products(req: UpdateRequest, manifest: &mut UpdateManifestV2, was_v2: b
270278 params(
271279 ( "version" = Option <String >, Query , deprecated, description = "Gateway-only target version; use the request body for multi-product updates" ) ,
272280 ) ,
273- request_body( content = Option <UpdateRequest >, description = "Products and target versions to update" , content_type = "application/json" ) ,
281+ request_body( content = Option <UpdateRequestSchema >, description = "Products and target versions to update" , content_type = "application/json" ) ,
274282 responses(
275283 ( status = 200 , description = "Update request accepted" , body = UpdateResponse ) ,
276284 ( status = 400 , description = "Bad request" ) ,
0 commit comments