Skip to content

Extend JSON decoder field extraction and fix DomainMode propagation - #19

Merged
viacheslauK merged 4 commits into
mainfrom
array-parser
Aug 25, 2026
Merged

Extend JSON decoder field extraction and fix DomainMode propagation#19
viacheslauK merged 4 commits into
mainfrom
array-parser

Conversation

@viacheslauK

@viacheslauK viacheslauK commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extends what MQTTJSONDecoderFB can pull out of a JSON message: escaped dots and array indexes in paths, mixed integer/floating-point value arrays; fixes MqttSubscriberFbImpl silently dropping the Timestamp key when creating decoder FBs from a JSON config.

Changes

  • Subscriber: setJsonConfig sets DomainMode explicitly. It was left at the default None, so readProperties discarded the DomainKey from the config and no domain signal was ever created for config-driven signals.
  • Value types: an array's type is derived from all its elements rather than the first (detectArrayValueType). A mix of integers and doubles is promoted to Float64, an integers-only array stays Int64, any other mix reports an error. uint64 array elements are now read via GetUint64() and cast, matching the scalar path.
  • Path syntax: resolveJsonPath supports array indexes (sensors[1].temperature, matrix[1][0]) and backslash escaping of ., [ and \ in field names.
  • Docs and tests.

@viacheslauK viacheslauK self-assigned this Aug 25, 2026
@viacheslauK viacheslauK changed the title Array parser Extend JSON decoder field extraction and fix DomainMode propagation Aug 25, 2026
@viacheslauK
viacheslauK marked this pull request as ready for review August 25, 2026 07:28

@NikolaiShipilov NikolaiShipilov left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

@viacheslauK
viacheslauK merged commit 686251a into main Aug 25, 2026
27 checks passed
@viacheslauK
viacheslauK deleted the array-parser branch August 25, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants