Skip to content

Include nested mapping fields in the fields API - #1178

Merged
mmguero merged 1 commit into
cisagov:sylvesterkaczmarek-mergesfrom
sylvesterkaczmarek:fix/api-nested-mapping-fields-20261007
Oct 7, 2026
Merged

mmguero merged 1 commit into
cisagov:sylvesterkaczmarek-mergesfrom
sylvesterkaczmarek:fix/api-nested-mapping-fields-20261007

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Summary

Fixes #1175.

Recursively collect descendants of mapping properties using qualified field names. Previously implicit objects were skipped entirely and explicit object/nested fields exposed only their parent entry.

Existing flat/dotted fields, type conversion, debug source metadata, explicit parent entries, catalogue cleanup and component lookup behavior are retained. Multi-fields under fields, template precedence and live-index discovery are outside this change.

Testing

python -m pytest -q api/tests/test_nested_mapping_fields.py

13 focused tests passed; 12 fail on unchanged main. Coverage includes implicit objects, explicit object/nested mappings, multiple nesting levels, dotted siblings, empty objects, debug metadata, the checked-in filescan/Suricata/common component templates, and real Flask /fields requests.

The API imports normally with credentials and HTTP transport isolated. Metadata responses are local fixtures; no live OpenSearch/Dashboards service, credentials or listening server was used.

89 tests passed in an isolated combined check containing these three fixes and the current #1155, #1166 and #1174 changes. That run includes the existing timezone and worker-cancellation regressions; the separate chunk-size suite was not rerun. No earlier production changes are included in this PR.

Tested on macOS with Python 3.12 and the pinned AnyIO 4.14.2. New-test formatting, scoped syntax/lint checks and git diff --check pass. No dependency or workflow changes. Full Malcolm deployment testing was not run.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@mmguero mmguero self-assigned this Oct 7, 2026
@mmguero mmguero added the api Related to issues dealing with the Malcolm REST API label Oct 7, 2026
@mmguero mmguero added this to Malcolm Oct 7, 2026
@mmguero mmguero added this to the v26.10.0 milestone Oct 7, 2026
@mmguero mmguero moved this to Review in Malcolm Oct 7, 2026
@mmguero
mmguero changed the base branch from main to sylvesterkaczmarek-merges October 7, 2026 15:26
@mmguero
mmguero merged commit 9b122b8 into cisagov:sylvesterkaczmarek-merges Oct 7, 2026
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Thanks @mmguero — appreciate you merging this batch as well (#1178, #1174, #1173, and #1172).

@mmguero mmguero moved this from Done to Released in Malcolm Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to issues dealing with the Malcolm REST API

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

The fields API omits descendants of object and nested mappings

2 participants