Skip to content

refactor(exporters): read a nested mapping's child type from the XCCDF model - #64

Merged
aaronlippold merged 1 commit into
nextfrom
refactor/fh9l13-nested-child-type
Nov 19, 2026
Merged

aaronlippold merged 1 commit into
nextfrom
refactor/fh9l13-nested-child-type

Conversation

@aaronlippold

Copy link
Copy Markdown
Member

A nested mapping's child (check-content inside check) is now found in the target's XCCDF type by its XML name, using xsdata's metadata (StyleModels.child_element). That metadata gives the child's field and type, so the engine no longer builds a class name and a field name from the element name. _element_name_to_type_name is deleted.

  • A child that the target's type does not have is refused when the style loads, at field_mappings.<name>.nested.children[0].element. Before, the style loaded and the first export with audit text failed.
  • The developer guide's nested example had two children and child attributes, which the schema refuses. It now shows the one-child form, and the real error for a misspelled child.

Checks:

  • Full suite, tests/scripts, mypy, ruff and mkdocs build --strict pass.
  • All 28 exports (9 cached real benchmarks and 5 synthetic fixtures, DISA and CIS) are byte-identical to next and pass cis-bench validate.

Card: cis-bench-fh9l.13.

…F model

A nested mapping's child (check-content inside check) is now found in
the target's XCCDF type by its XML name (StyleModels.child_element), which
gives its field and type, instead of a class name built from the element
name. _element_name_to_type_name is deleted.

A child the target's type does not have is refused when the style loads,
at field_mappings.<name>.nested.children[0].element, instead of failing
the first export with audit text. The guide's nested example shows the
one-child form the schema takes, with that error.

The 28 exports are byte-identical.

Refs: cis-bench-fh9l.13
Signed-off-by: Aaron Lippold <lippold@gmail.com>
@aaronlippold
aaronlippold merged commit 1f4b241 into next Nov 19, 2026
7 checks passed
@aaronlippold
aaronlippold deleted the refactor/fh9l13-nested-child-type branch November 19, 2026 22:22
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.

1 participant