diff --git a/src/generated/contract_event.rs b/src/generated/contract_event.rs index d17cadfc..44c8ca51 100644 --- a/src/generated/contract_event.rs +++ b/src/generated/contract_event.rs @@ -40,6 +40,11 @@ use super::*; pub struct ContractEvent { pub ext: ExtensionPoint, pub contract_id: Option, + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "type", alias = "type_") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "type"))] pub type_: ContractEventType, pub body: ContractEventBody, } diff --git a/src/generated/dont_have.rs b/src/generated/dont_have.rs index e31b3308..b36755cb 100644 --- a/src/generated/dont_have.rs +++ b/src/generated/dont_have.rs @@ -23,6 +23,11 @@ use super::*; )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DontHave { + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "type", alias = "type_") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "type"))] pub type_: MessageType, pub req_hash: Uint256, } diff --git a/src/generated/sc_spec_event_param_v0.rs b/src/generated/sc_spec_event_param_v0.rs index 607dd0be..a3009fa3 100644 --- a/src/generated/sc_spec_event_param_v0.rs +++ b/src/generated/sc_spec_event_param_v0.rs @@ -27,6 +27,11 @@ use super::*; pub struct ScSpecEventParamV0 { pub doc: StringM<1024>, pub name: StringM<30>, + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "type", alias = "type_") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "type"))] pub type_: ScSpecTypeDef, pub location: ScSpecEventParamLocationV0, } diff --git a/src/generated/sc_spec_function_input_v0.rs b/src/generated/sc_spec_function_input_v0.rs index b11ceb34..41fc340d 100644 --- a/src/generated/sc_spec_function_input_v0.rs +++ b/src/generated/sc_spec_function_input_v0.rs @@ -26,6 +26,11 @@ use super::*; pub struct ScSpecFunctionInputV0 { pub doc: StringM<1024>, pub name: StringM<30>, + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "type", alias = "type_") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "type"))] pub type_: ScSpecTypeDef, } diff --git a/src/generated/sc_spec_udt_struct_field_v0.rs b/src/generated/sc_spec_udt_struct_field_v0.rs index 2b47f835..53292260 100644 --- a/src/generated/sc_spec_udt_struct_field_v0.rs +++ b/src/generated/sc_spec_udt_struct_field_v0.rs @@ -26,6 +26,11 @@ use super::*; pub struct ScSpecUdtStructFieldV0 { pub doc: StringM<1024>, pub name: StringM<30>, + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "type", alias = "type_") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "type"))] pub type_: ScSpecTypeDef, } diff --git a/src/generated/sc_spec_udt_union_case_tuple_v0.rs b/src/generated/sc_spec_udt_union_case_tuple_v0.rs index 57eba817..3b12a5b6 100644 --- a/src/generated/sc_spec_udt_union_case_tuple_v0.rs +++ b/src/generated/sc_spec_udt_union_case_tuple_v0.rs @@ -26,6 +26,11 @@ use super::*; pub struct ScSpecUdtUnionCaseTupleV0 { pub doc: StringM<1024>, pub name: StringM<60>, + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "type", alias = "type_") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "type"))] pub type_: VecM, } diff --git a/src/generated/serialized_binary_fuse_filter.rs b/src/generated/serialized_binary_fuse_filter.rs index 59781b06..e594bda2 100644 --- a/src/generated/serialized_binary_fuse_filter.rs +++ b/src/generated/serialized_binary_fuse_filter.rs @@ -36,6 +36,11 @@ use super::*; )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SerializedBinaryFuseFilter { + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "type", alias = "type_") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "type"))] pub type_: BinaryFuseFilterType, pub input_hash_seed: ShortHashSeed, pub filter_seed: ShortHashSeed, diff --git a/tests/serde.rs b/tests/serde.rs index dd5322ca..90680eff 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -2,7 +2,7 @@ use stellar_xdr::{BytesM, Hash, StringM, VecM}; -use stellar_xdr::{AccountId, Int128Parts}; +use stellar_xdr::{AccountId, ContractEvent, ContractEventType, Int128Parts}; use std::str::FromStr; @@ -78,3 +78,27 @@ fn test_structs_that_ser_to_string_and_dual_der() -> Result<(), Box Result<(), Box> { + let event = ContractEvent { + type_: ContractEventType::Contract, + ..Default::default() + }; + + // The SEP-51 JSON uses the key `type`, not the previously escaped `type_`. + let json = r#"{"ext":"v0","contract_id":null,"type":"contract","body":{"v0":{"topics":[],"data":{"bool":false}}}}"#; + // The legacy JSON that older versions of this crate emitted, using `type_`. + let legacy_json = r#"{"ext":"v0","contract_id":null,"type_":"contract","body":{"v0":{"topics":[],"data":{"bool":false}}}}"#; + + // Serializes with the SEP-51 key `type`. + assert_eq!(serde_json::to_string(&event)?, json); + + // Deserializes from the SEP-51 key `type`. + assert_eq!(serde_json::from_str::(json)?, event); + + // The legacy escaped key `type_` is still accepted via a serde alias. + assert_eq!(serde_json::from_str::(legacy_json)?, event); + + Ok(()) +} diff --git a/xdr-generator-rust/generator/src/generator.rs b/xdr-generator-rust/generator/src/generator.rs index 1631b01d..97dc43e9 100644 --- a/xdr-generator-rust/generator/src/generator.rs +++ b/xdr-generator-rust/generator/src/generator.rs @@ -8,7 +8,9 @@ use xdr_parser::ast::{ use xdr_parser::lexer::IntBase; use xdr_parser::types::{is_builtin_type, is_fixed_array, is_fixed_opaque, is_var_array, TypeInfo}; -use crate::naming::{case_value, field_name, mod_name, source_comment, type_name}; +use crate::naming::{ + case_value, field_json_rename, field_name, mod_name, source_comment, type_name, +}; use crate::options::RustOptions; use crate::output::{ ConstOutput, DefinitionOutput, DefinitionTemplate, EnumOutput, EnumStructMemberOutput, @@ -424,6 +426,7 @@ impl RustGenerator { custom_str: bool, ) -> StructMemberOutput { let name = field_name(&m.name); + let serde_rename = field_json_rename(&m.name); let resolved = resolve_type(&m.type_, Some(parent), &self.type_info, custom_str); StructMemberOutput { @@ -431,6 +434,7 @@ impl RustGenerator { type_ref: resolved.type_ref, turbofish_type: resolved.turbofish_type, serde_as_type: resolved.serde_as_type, + serde_rename, } } diff --git a/xdr-generator-rust/generator/src/naming.rs b/xdr-generator-rust/generator/src/naming.rs index 157ac11d..cea167e4 100644 --- a/xdr-generator-rust/generator/src/naming.rs +++ b/xdr-generator-rust/generator/src/naming.rs @@ -17,6 +17,18 @@ pub(crate) fn field_name(name: &str) -> String { escape_field_name(&snake) } +/// If the Rust field name for an XDR field was keyword-escaped away from its +/// plain snake_case name (e.g. `type` -> `type_`), return the correct JSON key +/// (the unescaped snake_case name). Returns `None` when no escaping occurred. +pub(crate) fn field_json_rename(name: &str) -> Option { + let snake = name.to_snake_case(); + if escape_field_name(&snake) == snake { + None + } else { + Some(snake) + } +} + fn escape_type_name(name: &str) -> String { match name { "type" => "type_".to_string(), diff --git a/xdr-generator-rust/generator/src/output.rs b/xdr-generator-rust/generator/src/output.rs index 88d88e60..e9fccad8 100644 --- a/xdr-generator-rust/generator/src/output.rs +++ b/xdr-generator-rust/generator/src/output.rs @@ -58,6 +58,9 @@ pub struct StructMemberOutput { pub type_ref: String, pub turbofish_type: String, pub serde_as_type: Option, + /// The correct SEP-51 JSON key when the Rust field name was keyword-escaped + /// (e.g. `type_` -> JSON `type`). `None` when the name was not escaped. + pub serde_rename: Option, } pub struct EnumOutput { diff --git a/xdr-generator-rust/generator/src/tests/naming.rs b/xdr-generator-rust/generator/src/tests/naming.rs index eb6157e8..4f473809 100644 --- a/xdr-generator-rust/generator/src/tests/naming.rs +++ b/xdr-generator-rust/generator/src/tests/naming.rs @@ -1,4 +1,4 @@ -use crate::naming::{field_name, type_name}; +use crate::naming::{field_json_rename, field_name, type_name}; #[test] fn test_type_name_snake_case() { @@ -56,6 +56,16 @@ fn test_field_name_escape_type() { assert_eq!(field_name("type"), "type_"); } +#[test] +fn test_field_json_rename_type() { + assert_eq!(field_json_rename("type"), Some("type".to_string())); +} + +#[test] +fn test_field_json_rename_non_keyword() { + assert_eq!(field_json_rename("public_key"), None); +} + #[test] fn test_field_name_upper_camel_case() { assert_eq!(field_name("PublicKey"), "public_key"); diff --git a/xdr-generator-rust/generator/templates/struct.rs.jinja b/xdr-generator-rust/generator/templates/struct.rs.jinja index ee8a7261..af139b43 100644 --- a/xdr-generator-rust/generator/templates/struct.rs.jinja +++ b/xdr-generator-rust/generator/templates/struct.rs.jinja @@ -29,6 +29,13 @@ pub struct {{ s.name }} { all(feature = "serde", feature = "alloc"), serde_as(as = "{{ serde_as }}") )] +{%- endif %} +{%- if let Some(rename) = m.serde_rename %} + #[cfg_attr( + all(feature = "serde", feature = "alloc"), + serde(rename = "{{ rename }}", alias = "{{ m.name }}") + )] + #[cfg_attr(feature = "schemars", schemars(rename = "{{ rename }}"))] {%- endif %} pub {{ m.name }}: {{ m.type_ref }}, {%- endfor %} diff --git a/xdr-json/AuthenticatedMessage.json b/xdr-json/AuthenticatedMessage.json index 4c567510..33ef013b 100644 --- a/xdr-json/AuthenticatedMessage.json +++ b/xdr-json/AuthenticatedMessage.json @@ -689,7 +689,7 @@ "type": "object", "required": [ "req_hash", - "type_" + "type" ], "properties": { "req_hash": { @@ -699,7 +699,7 @@ "contentEncoding": "hex", "contentMediaType": "application/binary" }, - "type_": { + "type": { "$ref": "#/definitions/MessageType" } } diff --git a/xdr-json/AuthenticatedMessageV0.json b/xdr-json/AuthenticatedMessageV0.json index 4fa05c4e..239c0476 100644 --- a/xdr-json/AuthenticatedMessageV0.json +++ b/xdr-json/AuthenticatedMessageV0.json @@ -671,7 +671,7 @@ "type": "object", "required": [ "req_hash", - "type_" + "type" ], "properties": { "req_hash": { @@ -681,7 +681,7 @@ "contentEncoding": "hex", "contentMediaType": "application/binary" }, - "type_": { + "type": { "$ref": "#/definitions/MessageType" } } diff --git a/xdr-json/ContractEvent.json b/xdr-json/ContractEvent.json index dea0f4e6..836d421b 100644 --- a/xdr-json/ContractEvent.json +++ b/xdr-json/ContractEvent.json @@ -6,7 +6,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "$schema": { @@ -28,7 +28,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } }, diff --git a/xdr-json/DiagnosticEvent.json b/xdr-json/DiagnosticEvent.json index a99a7570..fed652be 100644 --- a/xdr-json/DiagnosticEvent.json +++ b/xdr-json/DiagnosticEvent.json @@ -26,7 +26,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -45,7 +45,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/DontHave.json b/xdr-json/DontHave.json index 671608ed..6ac179a0 100644 --- a/xdr-json/DontHave.json +++ b/xdr-json/DontHave.json @@ -5,7 +5,7 @@ "type": "object", "required": [ "req_hash", - "type_" + "type" ], "properties": { "$schema": { @@ -18,7 +18,7 @@ "contentEncoding": "hex", "contentMediaType": "application/binary" }, - "type_": { + "type": { "$ref": "#/definitions/MessageType" } }, diff --git a/xdr-json/InvokeHostFunctionSuccessPreImage.json b/xdr-json/InvokeHostFunctionSuccessPreImage.json index 12dae45b..701304bc 100644 --- a/xdr-json/InvokeHostFunctionSuccessPreImage.json +++ b/xdr-json/InvokeHostFunctionSuccessPreImage.json @@ -30,7 +30,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -49,7 +49,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/LedgerCloseMeta.json b/xdr-json/LedgerCloseMeta.json index b4cb94bf..b284ae34 100644 --- a/xdr-json/LedgerCloseMeta.json +++ b/xdr-json/LedgerCloseMeta.json @@ -1659,7 +1659,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1678,7 +1678,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/LedgerCloseMetaBatch.json b/xdr-json/LedgerCloseMetaBatch.json index d47d1c59..8647113d 100644 --- a/xdr-json/LedgerCloseMetaBatch.json +++ b/xdr-json/LedgerCloseMetaBatch.json @@ -1647,7 +1647,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1666,7 +1666,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/LedgerCloseMetaV0.json b/xdr-json/LedgerCloseMetaV0.json index b8d7b3f0..7c48ace2 100644 --- a/xdr-json/LedgerCloseMetaV0.json +++ b/xdr-json/LedgerCloseMetaV0.json @@ -1659,7 +1659,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1678,7 +1678,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/LedgerCloseMetaV1.json b/xdr-json/LedgerCloseMetaV1.json index f052fac1..7363f8e2 100644 --- a/xdr-json/LedgerCloseMetaV1.json +++ b/xdr-json/LedgerCloseMetaV1.json @@ -1683,7 +1683,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1702,7 +1702,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/LedgerCloseMetaV2.json b/xdr-json/LedgerCloseMetaV2.json index 8da8e288..b382e63f 100644 --- a/xdr-json/LedgerCloseMetaV2.json +++ b/xdr-json/LedgerCloseMetaV2.json @@ -1675,7 +1675,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1694,7 +1694,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/OperationMetaV2.json b/xdr-json/OperationMetaV2.json index c070bfa1..acb8947f 100644 --- a/xdr-json/OperationMetaV2.json +++ b/xdr-json/OperationMetaV2.json @@ -1228,7 +1228,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1247,7 +1247,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/ScSpecEntry.json b/xdr-json/ScSpecEntry.json index de619fd4..488b6418 100644 --- a/xdr-json/ScSpecEntry.json +++ b/xdr-json/ScSpecEntry.json @@ -101,7 +101,7 @@ "doc", "location", "name", - "type_" + "type" ], "properties": { "doc": { @@ -113,7 +113,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } } @@ -164,7 +164,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "doc": { @@ -173,7 +173,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } } @@ -520,7 +520,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "doc": { @@ -529,7 +529,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } } @@ -568,7 +568,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "doc": { @@ -577,7 +577,7 @@ "name": { "$ref": "#/definitions/StringM<60>" }, - "type_": { + "type": { "type": "array", "items": { "$ref": "#/definitions/ScSpecTypeDef" diff --git a/xdr-json/ScSpecEventParamV0.json b/xdr-json/ScSpecEventParamV0.json index 8bce5c62..eb5ed50c 100644 --- a/xdr-json/ScSpecEventParamV0.json +++ b/xdr-json/ScSpecEventParamV0.json @@ -7,7 +7,7 @@ "doc", "location", "name", - "type_" + "type" ], "properties": { "$schema": { @@ -22,7 +22,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } }, diff --git a/xdr-json/ScSpecEventV0.json b/xdr-json/ScSpecEventV0.json index d5488d89..8b4c64ce 100644 --- a/xdr-json/ScSpecEventV0.json +++ b/xdr-json/ScSpecEventV0.json @@ -68,7 +68,7 @@ "doc", "location", "name", - "type_" + "type" ], "properties": { "doc": { @@ -80,7 +80,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } } diff --git a/xdr-json/ScSpecFunctionInputV0.json b/xdr-json/ScSpecFunctionInputV0.json index 435084f5..1063ca41 100644 --- a/xdr-json/ScSpecFunctionInputV0.json +++ b/xdr-json/ScSpecFunctionInputV0.json @@ -6,7 +6,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "$schema": { @@ -18,7 +18,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } }, diff --git a/xdr-json/ScSpecFunctionV0.json b/xdr-json/ScSpecFunctionV0.json index 9d9a115d..ea6fff62 100644 --- a/xdr-json/ScSpecFunctionV0.json +++ b/xdr-json/ScSpecFunctionV0.json @@ -42,7 +42,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "doc": { @@ -51,7 +51,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } } diff --git a/xdr-json/ScSpecUdtStructFieldV0.json b/xdr-json/ScSpecUdtStructFieldV0.json index 50861779..ef690b09 100644 --- a/xdr-json/ScSpecUdtStructFieldV0.json +++ b/xdr-json/ScSpecUdtStructFieldV0.json @@ -6,7 +6,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "$schema": { @@ -18,7 +18,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } }, diff --git a/xdr-json/ScSpecUdtStructV0.json b/xdr-json/ScSpecUdtStructV0.json index d695743c..35db4da9 100644 --- a/xdr-json/ScSpecUdtStructV0.json +++ b/xdr-json/ScSpecUdtStructV0.json @@ -242,7 +242,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "doc": { @@ -251,7 +251,7 @@ "name": { "$ref": "#/definitions/StringM<30>" }, - "type_": { + "type": { "$ref": "#/definitions/ScSpecTypeDef" } } diff --git a/xdr-json/ScSpecUdtUnionCaseTupleV0.json b/xdr-json/ScSpecUdtUnionCaseTupleV0.json index 30cb9714..7f776df9 100644 --- a/xdr-json/ScSpecUdtUnionCaseTupleV0.json +++ b/xdr-json/ScSpecUdtUnionCaseTupleV0.json @@ -6,7 +6,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "$schema": { @@ -18,7 +18,7 @@ "name": { "$ref": "#/definitions/StringM<60>" }, - "type_": { + "type": { "type": "array", "items": { "$ref": "#/definitions/ScSpecTypeDef" diff --git a/xdr-json/ScSpecUdtUnionCaseV0.json b/xdr-json/ScSpecUdtUnionCaseV0.json index 1705bb25..697fd4f6 100644 --- a/xdr-json/ScSpecUdtUnionCaseV0.json +++ b/xdr-json/ScSpecUdtUnionCaseV0.json @@ -243,7 +243,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "doc": { @@ -252,7 +252,7 @@ "name": { "$ref": "#/definitions/StringM<60>" }, - "type_": { + "type": { "type": "array", "items": { "$ref": "#/definitions/ScSpecTypeDef" diff --git a/xdr-json/ScSpecUdtUnionV0.json b/xdr-json/ScSpecUdtUnionV0.json index 9bbe83fd..74d90ee6 100644 --- a/xdr-json/ScSpecUdtUnionV0.json +++ b/xdr-json/ScSpecUdtUnionV0.json @@ -242,7 +242,7 @@ "required": [ "doc", "name", - "type_" + "type" ], "properties": { "doc": { @@ -251,7 +251,7 @@ "name": { "$ref": "#/definitions/StringM<60>" }, - "type_": { + "type": { "type": "array", "items": { "$ref": "#/definitions/ScSpecTypeDef" diff --git a/xdr-json/SerializedBinaryFuseFilter.json b/xdr-json/SerializedBinaryFuseFilter.json index a90057a7..f437dbfd 100644 --- a/xdr-json/SerializedBinaryFuseFilter.json +++ b/xdr-json/SerializedBinaryFuseFilter.json @@ -12,7 +12,7 @@ "segment_count", "segment_count_length", "segment_length", - "type_" + "type" ], "properties": { "$schema": { @@ -54,7 +54,7 @@ "format": "uint32", "minimum": 0.0 }, - "type_": { + "type": { "$ref": "#/definitions/BinaryFuseFilterType" } }, diff --git a/xdr-json/SorobanTransactionMeta.json b/xdr-json/SorobanTransactionMeta.json index 56c3b402..23167017 100644 --- a/xdr-json/SorobanTransactionMeta.json +++ b/xdr-json/SorobanTransactionMeta.json @@ -42,7 +42,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -61,7 +61,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/StellarMessage.json b/xdr-json/StellarMessage.json index cc4bf81e..40d0cad3 100644 --- a/xdr-json/StellarMessage.json +++ b/xdr-json/StellarMessage.json @@ -903,7 +903,7 @@ "type": "object", "required": [ "req_hash", - "type_" + "type" ], "properties": { "req_hash": { @@ -913,7 +913,7 @@ "contentEncoding": "hex", "contentMediaType": "application/binary" }, - "type_": { + "type": { "$ref": "#/definitions/MessageType" } } diff --git a/xdr-json/TransactionEvent.json b/xdr-json/TransactionEvent.json index a071dad8..2e529408 100644 --- a/xdr-json/TransactionEvent.json +++ b/xdr-json/TransactionEvent.json @@ -26,7 +26,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -45,7 +45,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/TransactionMeta.json b/xdr-json/TransactionMeta.json index 0a9951bc..8c47b9a9 100644 --- a/xdr-json/TransactionMeta.json +++ b/xdr-json/TransactionMeta.json @@ -1270,7 +1270,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1289,7 +1289,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/TransactionMetaV3.json b/xdr-json/TransactionMetaV3.json index 7ec660d1..a5057cb9 100644 --- a/xdr-json/TransactionMetaV3.json +++ b/xdr-json/TransactionMetaV3.json @@ -1242,7 +1242,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1261,7 +1261,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/TransactionMetaV4.json b/xdr-json/TransactionMetaV4.json index e189947d..bd680478 100644 --- a/xdr-json/TransactionMetaV4.json +++ b/xdr-json/TransactionMetaV4.json @@ -1258,7 +1258,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1277,7 +1277,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/TransactionResultMeta.json b/xdr-json/TransactionResultMeta.json index d38df2d3..d4535ca0 100644 --- a/xdr-json/TransactionResultMeta.json +++ b/xdr-json/TransactionResultMeta.json @@ -1466,7 +1466,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1485,7 +1485,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } } diff --git a/xdr-json/TransactionResultMetaV1.json b/xdr-json/TransactionResultMetaV1.json index 25e75f3b..75845df9 100644 --- a/xdr-json/TransactionResultMetaV1.json +++ b/xdr-json/TransactionResultMetaV1.json @@ -1474,7 +1474,7 @@ "required": [ "body", "ext", - "type_" + "type" ], "properties": { "body": { @@ -1493,7 +1493,7 @@ "ext": { "$ref": "#/definitions/ExtensionPoint" }, - "type_": { + "type": { "$ref": "#/definitions/ContractEventType" } }