aboutsummaryrefslogtreecommitdiffstats
path: root/lib/api-config/src/schema/create.rs
diff options
context:
space:
mode:
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,
}