Skip to content

Support the nested blocks of MT021, MT056 and MT096 in the parser - #347

Open
ptorres-prowide wants to merge 5 commits into
mainfrom
CU-18ubww2_Enhance-MT-parser-to-support-nested-blocks
Open

ptorres-prowide wants to merge 5 commits into
mainfrom
CU-18ubww2_Enhance-MT-parser-to-support-nested-blocks

Conversation

@ptorres-prowide

Copy link
Copy Markdown
Contributor

The block 4 of these system messages carries nested blocks, which the tag list block parser was splitting at the first closing brace. As a result the nested block 3 and block 5 lost their closing brace, their sub-tags leaked as siblings of the block 4 (colliding with the MT021 field 108) and the MT056 field 270 was truncated, so the message could not be written back as valid FIN.

The tag value is now read balancing the curly braces, but only for the tag names where SWIFT defines nested blocks: the block identifiers 1 to 5 and the field
270. Every other tag keeps the historical reading, which matters for malformed content such as a service message error code left unclosed before the next field. Verified with no difference over the 8833 FIN samples of the integrator corpus.

Also, parseBlock3 and parseBlock5 now accept the block content without the block identifier, which is the form returned by the nested block tag values, so the nested message can be rebuilt out of them.

@ptorres-prowide
ptorres-prowide force-pushed the CU-18ubww2_Enhance-MT-parser-to-support-nested-blocks branch 2 times, most recently from 6103236 to 5557b27 Compare August 26, 2026 21:27
The block 4 of these system messages carries nested blocks, which the tag list
block parser was splitting at the first closing brace. As a result the nested
block 3 and block 5 lost their closing brace, their sub-tags leaked as siblings
of the block 4 (colliding with the MT021 field 108) and the MT056 field 270 was
truncated, so the message could not be written back as valid FIN.

The tag value is now read balancing the curly braces, but only for the tag names
where SWIFT defines nested blocks: the block identifiers 1 to 5 and the field
270. Every other tag keeps the historical reading, which matters for malformed
content such as a service message error code left unclosed before the next
field. Verified with no difference over the 8833 FIN samples of the integrator
corpus.

Also, parseBlock3 and parseBlock5 now accept the block content without the block
identifier, which is the form returned by the nested block tag values, so the
nested message can be rebuilt out of them.
@ptorres-prowide
ptorres-prowide force-pushed the CU-18ubww2_Enhance-MT-parser-to-support-nested-blocks branch from 5557b27 to 1d7b0ca Compare September 11, 2026 19:01
The block 4 of these system messages carries nested blocks, which the tag list
block parser was splitting at the first closing brace. As a result the nested
block 3 and block 5 lost their closing brace, their sub-tags leaked as siblings
of the block 4 (colliding with the MT021 field 108) and the MT056 field 270 was
truncated, so the message could not be written back as valid FIN.

The tag value is now read balancing the curly braces, but only for the tag names
where SWIFT defines nested blocks: the block identifiers 1 to 5 and the field
270. Every other tag keeps the historical reading, which matters for malformed
content such as a service message error code left unclosed before the next
field. Verified with no difference over the 8833 FIN samples of the integrator
corpus.

Also, parseBlock3 and parseBlock5 now accept the block content without the block
identifier, which is the form returned by the nested block tag values, so the
nested message can be rebuilt out of them.
@zubri
zubri force-pushed the CU-18ubww2_Enhance-MT-parser-to-support-nested-blocks branch from 1d7b0ca to c58e39f Compare September 11, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants