diff --git a/api/scripts/convert-openapi.ts b/api/scripts/convert-openapi.ts index 4ce4a55c..f6c48447 100644 --- a/api/scripts/convert-openapi.ts +++ b/api/scripts/convert-openapi.ts @@ -932,6 +932,7 @@ async function processAlgodSpec() { const config: ProcessingConfig = { sourceUrl: `https://raw.githubusercontent.com/algorand/go-algorand/${stableTag}/daemon/algod/api/algod.oas2.json`, + requiredFieldTransforms: [{ schemaName: "Genesis", fieldName: "timestamp", makeRequired: false }], outputPath: join(process.cwd(), "specs", "algod.oas3.json"), fieldTransforms: [ { diff --git a/api/specs/algod.oas3.json b/api/specs/algod.oas3.json index 804c5fb0..7cd69f95 100644 --- a/api/specs/algod.oas3.json +++ b/api/specs/algod.oas3.json @@ -4720,8 +4720,7 @@ "id", "network", "proto", - "rwd", - "timestamp" + "rwd" ], "type": "object", "properties": { diff --git a/crates/algod_client/src/models/genesis.rs b/crates/algod_client/src/models/genesis.rs index b1744619..24a78774 100644 --- a/crates/algod_client/src/models/genesis.rs +++ b/crates/algod_client/src/models/genesis.rs @@ -32,8 +32,8 @@ pub struct Genesis { pub proto: String, #[serde(rename = "rwd")] pub rwd: String, - #[serde(rename = "timestamp")] - pub timestamp: u64, + #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")] + pub timestamp: Option, } impl Genesis { @@ -45,7 +45,6 @@ impl Genesis { network: String, proto: String, rwd: String, - timestamp: u64, ) -> Genesis { Genesis { alloc, @@ -54,9 +53,9 @@ impl Genesis { network, proto, rwd, - timestamp, comment: None, devmode: None, + timestamp: None, } } }