aboutsummaryrefslogtreecommitdiffstats
path: root/lib/api-config/src/schema/create.rs
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2026-03-30 14:02:53 +0200
committerrtkay123 <dev@kanjala.com>2026-03-30 14:02:53 +0200
commit4071482f983d66b16cc8a5519f5665990dc7bc02 (patch)
treebd1b630df7c46edb34f96f4264b19ddbda14b0a0 /lib/api-config/src/schema/create.rs
parent1b5622e14ca3deaf2a25ee785af656779ded7a41 (diff)
downloadwarden-4071482f983d66b16cc8a5519f5665990dc7bc02.tar.bz2
warden-4071482f983d66b16cc8a5519f5665990dc7bc02.zip
refactor: camelCase response
Diffstat (limited to 'lib/api-config/src/schema/create.rs')
-rw-r--r--lib/api-config/src/schema/create.rs21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/api-config/src/schema/create.rs b/lib/api-config/src/schema/create.rs
index eef11f8..e6511d5 100644
--- a/lib/api-config/src/schema/create.rs
+++ b/lib/api-config/src/schema/create.rs
@@ -2,17 +2,16 @@ use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
-/// Transaction to monitor
#[cfg_attr(feature = "utoipa", schema(example = json!({
- "type": "custom.schema",
- "version": "1.0.0",
- "json_schema": {
+ "schemaType": "custom.schema",
+ "schemaVersion": "1.0.0",
+ "schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "FinancialTransaction",
"type": "object",
- "required": ["transaction_id", "amount", "currency", "timestamp"],
+ "required": ["transactionId", "amount", "currency", "timestamp"],
"properties": {
- "transaction_id": {
+ "transactionId": {
"type": "string",
"format": "uuid"
},
@@ -32,13 +31,13 @@ use serde::{Deserialize, Serialize};
}
}
})))]
+#[serde(rename_all = "camelCase")]
+/// The json schema to validate for each transaction of this type and version
pub struct CreateSchema {
- #[serde(rename = "type")]
/// Transaction schema type
- pub kind: String,
+ pub schema_type: String,
/// The schema's version
- pub version: String,
- /// The json schema to validate for each transaction of this type and version
- #[serde(rename = "json_schema")]
+ pub schema_version: String,
+ /// The json schema
pub schema: serde_json::Value,
}