@@ -34,8 +34,10 @@ pub fn config(cfg: &mut utoipa_actix_web::service_config::ServiceConfig) {
3434#[ derive( Debug , Clone , Serialize , Deserialize , utoipa:: ToSchema ) ]
3535pub struct SearchProjects {
3636 #[ serde( default = "default_limit" ) ]
37+ #[ schema( default = 20 ) ]
3738 pub limit : u64 ,
3839 #[ serde( default ) ]
40+ #[ schema( default = 0 ) ]
3941 pub page : u64 ,
4042 #[ serde( default ) ]
4143 pub filter : SearchProjectsFilter ,
@@ -163,7 +165,10 @@ pub struct FileIssueDetail {
163165}
164166
165167/// Searches all projects which are awaiting technical review.
166- #[ utoipa:: path]
168+ #[ utoipa:: path(
169+ security( ( "bearer_auth" = [ ] ) ) ,
170+ responses( ( status = OK , body = inline( Vec <ProjectReview >) ) )
171+ ) ]
167172#[ post( "/search" ) ]
168173async fn search_projects (
169174 req : HttpRequest ,
@@ -209,7 +214,7 @@ async fn search_projects(
209214
210215 let sort_by = search_req. sort_by . to_string ( ) ;
211216 let limit = search_req. limit . max ( 50 ) ;
212- let offset = limit * search_req. page ;
217+ let offset = limit. saturating_mul ( search_req. page ) ;
213218
214219 let limit =
215220 i64:: try_from ( limit) . wrap_request_err ( "limit cannot fit into `i64`" ) ?;
@@ -435,14 +440,18 @@ async fn search_projects(
435440 Ok ( web:: Json ( projects) )
436441}
437442
438- /// Updates the state of a technical review issue .
443+ /// See [`update_issue`] .
439444#[ derive( Debug , Clone , Serialize , Deserialize , utoipa:: ToSchema ) ]
440445pub struct UpdateIssue {
441446 /// Status to set the issue to.
442447 pub status : DelphiReportIssueStatus ,
443448}
444449
445- #[ utoipa:: path]
450+ /// Updates the state of a technical review issue.
451+ #[ utoipa:: path(
452+ security( ( "bearer_auth" = [ ] ) ) ,
453+ responses( ( status = NO_CONTENT ) )
454+ ) ]
446455#[ post( "/issue/{id}" ) ]
447456async fn update_issue (
448457 req : HttpRequest ,
0 commit comments