in scripts/schema/cleaner.py [0:0]
def schema_cleanup(schema: FieldEntry) -> None:
# Sanity check first
schema_mandatory_attributes(schema)
# trailing space cleanup
ecs_helpers.dict_clean_string_values(schema['schema_details'])
ecs_helpers.dict_clean_string_values(schema['field_details'])
# Some defaults
schema['schema_details'].setdefault('group', 2)
schema['schema_details'].setdefault('root', False)
schema['field_details'].setdefault('type', 'group')
schema['field_details'].setdefault('short', schema['field_details']['description'])
if 'reusable' in schema['schema_details']:
# order to perform chained reuses. Set to 1 if it needs to happen earlier.
schema['schema_details']['reusable'].setdefault('order', 2)
# Precalculate stuff. Those can't be set in the YAML.
if schema['schema_details']['root']:
schema['schema_details']['prefix'] = ''
else:
schema['schema_details']['prefix'] = schema['field_details']['name'] + '.'
normalize_reuse_notation(schema)
# Final validity check if in strict mode
schema_assertions_and_warnings(schema)