feat: update ApiKeySchema and ApiKeyListSchema with proper serde renaming for keyPrefix and createdAt
This commit is contained in:
@@ -8,7 +8,9 @@ use uuid::Uuid;
|
|||||||
pub struct ApiKeySchema {
|
pub struct ApiKeySchema {
|
||||||
pub id: Uuid,
|
pub id: Uuid,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
#[serde(rename = "keyPrefix")]
|
||||||
pub key_prefix: String,
|
pub key_prefix: String,
|
||||||
|
#[serde(rename = "createdAt")]
|
||||||
pub created_at: DateTimeWithTimeZoneWrapper,
|
pub created_at: DateTimeWithTimeZoneWrapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +18,6 @@ pub struct ApiKeySchema {
|
|||||||
pub struct ApiKeyResponse {
|
pub struct ApiKeyResponse {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub key: ApiKeySchema,
|
pub key: ApiKeySchema,
|
||||||
/// The full plaintext API key. This is only returned on creation.
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none", rename = "plaintextKey")]
|
#[serde(skip_serializing_if = "Option::is_none", rename = "plaintextKey")]
|
||||||
pub plaintext_key: Option<String>,
|
pub plaintext_key: Option<String>,
|
||||||
}
|
}
|
||||||
@@ -37,6 +38,7 @@ impl ApiKeyResponse {
|
|||||||
|
|
||||||
#[derive(Serialize, ToSchema)]
|
#[derive(Serialize, ToSchema)]
|
||||||
pub struct ApiKeyListSchema {
|
pub struct ApiKeyListSchema {
|
||||||
|
#[serde(rename = "apiKeys")]
|
||||||
pub api_keys: Vec<ApiKeySchema>,
|
pub api_keys: Vec<ApiKeySchema>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user