diff options
| author | rtkay123 <dev@kanjala.com> | 2026-03-30 14:02:53 +0200 |
|---|---|---|
| committer | rtkay123 <dev@kanjala.com> | 2026-03-30 14:02:53 +0200 |
| commit | 4071482f983d66b16cc8a5519f5665990dc7bc02 (patch) | |
| tree | bd1b630df7c46edb34f96f4264b19ddbda14b0a0 /lib/api-config/src/schema/create.rs | |
| parent | 1b5622e14ca3deaf2a25ee785af656779ded7a41 (diff) | |
| download | warden-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.rs | 21 |
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, } |
