Skip to content

Commit

Permalink
fix: non-conformant OpenAPI spec, now conformant
Browse files Browse the repository at this point in the history
  • Loading branch information
cdbrkfxrpt committed May 10, 2024
1 parent 13b4bdd commit fb9eec5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/rest/runners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::model::Runner;
#[utoipa::path(
post,
path = "/runners",
params(
Runner
request_body(
content = Runner, description = "Runner to update", content_type = "application/json"
),
responses(
(status = StatusCode::CREATED, description = "Created new Runner", body = Runner),
Expand Down Expand Up @@ -64,13 +64,13 @@ pub async fn list(State(pool): State<Pool>) -> Response {
#[utoipa::path(
get,
path = "/runners/{id}",
params(
("id" = i32, Path, description = "Runner ID")
),
responses(
(status = StatusCode::OK, description = "Read all Runners", body = Runner),
(status = StatusCode::NOT_FOUND, description = "Runner not found", body = Error),
(status = StatusCode::INTERNAL_SERVER_ERROR, description = "Internal server error", body = Error)
),
params(
("id" = i32, Path, description = "Runner ID")
)
)]
#[tracing::instrument(skip(pool))]
Expand All @@ -95,16 +95,16 @@ pub async fn read(State(pool): State<Pool>, Path(id): Path<i32>) -> Response {
put,
path = "/runners/{id}",
params(
Runner
("id" = i32, Path, description = "Runner ID")
),
request_body(
content = Runner, description = "Runner to update", content_type = "application/json"
),
responses(
(status = StatusCode::OK, description = "Updated Runner", body = Runner),
(status = StatusCode::NO_CONTENT, description = "Runner already up-to-date"),
(status = StatusCode::NOT_FOUND, description = "Runner not found", body = Error),
(status = StatusCode::INTERNAL_SERVER_ERROR, description = "Internal server error", body = Error)
),
params(
("id" = i32, Path, description = "Runner ID")
)
)]
#[tracing::instrument(skip(pool))]
Expand Down Expand Up @@ -141,13 +141,13 @@ pub async fn update(
#[utoipa::path(
delete,
path = "/runners/{id}",
params(
("id" = i32, Path, description = "Runner ID")
),
responses(
(status = StatusCode::OK, description = "Deleted Runner", body = Runner),
(status = StatusCode::NOT_FOUND, description = "Runner not found", body = Error),
(status = StatusCode::INTERNAL_SERVER_ERROR, description = "Internal server error", body = Error)
),
params(
("id" = i32, Path, description = "Runner ID")
)
)]
#[tracing::instrument(skip(pool))]
Expand Down

0 comments on commit fb9eec5

Please sign in to comment.