[Bug] Incorrect Integrations Schema Parsing for Nested Fields (#5058)

* Add proper handling for nested fields

* Updated schemas

* bump patch

---------

Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
This commit is contained in:
Eric Forte
2025-09-04 14:12:33 -04:00
committed by GitHub
parent 3c1de72f6b
commit cbb892b4bc
65 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -128,7 +128,11 @@ def _flatten_schema(schema: list[dict[str, Any]] | None, prefix: str = "") -> li
flattened.extend(_flatten_schema(s["fields"], prefix=nested_prefix))
elif "fields" in s:
flattened.extend(_flatten_schema(s["fields"], prefix=prefix))
if s.get("name") and s.get("type") == "nested":
nested_prefix = prefix + s["name"] + "."
flattened.extend(_flatten_schema(s["fields"], prefix=nested_prefix))
else:
flattened.extend(_flatten_schema(s["fields"], prefix=prefix))
elif "name" in s:
_s = s.copy()
# type is implicitly keyword if not defined
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "detection_rules"
version = "1.3.29"
version = "1.3.30"
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Securitys Detection Engine."
readme = "README.md"
requires-python = ">=3.12"