From 4071482f983d66b16cc8a5519f5665990dc7bc02 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Mon, 30 Mar 2026 14:02:53 +0200 Subject: refactor: camelCase response --- lib/api-config/src/schema/create.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'lib/api-config/src/schema/create.rs') 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, } -- cgit v1.2.3