admin api: specify date-time format in openapi spec
All checks were successful
ci/woodpecker/push/debug Pipeline was successful
ci/woodpecker/pr/debug Pipeline was successful

This commit is contained in:
Alex 2025-03-11 18:21:00 +01:00
parent 1bd7689301
commit ae9a9727f1
2 changed files with 4 additions and 2 deletions

View file

@ -2053,6 +2053,7 @@
"string",
"null"
],
"format": "date-time",
"description": "Expiration time and date, formatted according to RFC 3339"
},
"expired": {
@ -3639,6 +3640,7 @@
"string",
"null"
],
"format": "date-time",
"description": "Expiration time and date, formatted according to RFC 3339"
},
"name": {

View file

@ -317,7 +317,7 @@ pub struct GetAdminTokenInfoResponse {
/// Name of the admin API token
pub name: String,
/// Expiration time and date, formatted according to RFC 3339
#[schema(value_type = Option<String>)]
#[schema(value_type = Option<String>, format = DateTime)]
pub expiration: Option<chrono::DateTime<chrono::Utc>>,
/// Whether this admin token is expired already
pub expired: bool,
@ -357,7 +357,7 @@ pub struct UpdateAdminTokenRequestBody {
/// Name of the admin API token
pub name: Option<String>,
/// Expiration time and date, formatted according to RFC 3339
#[schema(value_type = Option<String>)]
#[schema(value_type = Option<String>, format = DateTime)]
pub expiration: Option<chrono::DateTime<chrono::Utc>>,
/// Scope of the admin API token, a list of admin endpoint names (such as
/// `GetClusterStatus`, etc), or the special value `*` to allow all