Skip to content

Commit

Permalink
Add support for a top-level type (#4)
Browse files Browse the repository at this point in the history
* Add support for a top-level type

* Actually, don't need to be all the complicated
  • Loading branch information
lksnyder0 authored Jun 17, 2024
1 parent d7b3965 commit c9e52bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion schemas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Optional field set attributes:
- group (default 2): To sort field sets against one another.
For example the "base" field set has group=1 and is the first listed in the documentation.
All others have group=2 and are therefore after "base" (sorted alphabetically).
- type (ignored): at this level, should always be `group`
- type: The fieldset type. Can be 'nested' or 'object'.
- reusable (optional): Used to identify which field sets are expected to be reused in multiple places.
See "Field set reuse" for details.
- short_override: Used to override the top-level fieldset's short description when nesting.
Expand Down
2 changes: 2 additions & 0 deletions scripts/generators/es_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def all_component_templates(
name_parts = flat_name.split(".")
dict_add_nested(field_mappings, name_parts, entry_for(field))
fieldset_settings = fieldset.get("settings", None)
if fieldset.get("type", "group") in ["object", "nested"]:
field_mappings["type"] = fieldset.get("type")

save_component_template(
fieldset_name,
Expand Down

0 comments on commit c9e52bf

Please sign in to comment.