From 9be78f3aa7f6b7577aef6891c5d47760203107da Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 29 Jul 2018 14:58:37 +0900 Subject: [PATCH] Better support enums when they come among oneOf types --- scripts/templating/matrix_templates/units.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/templating/matrix_templates/units.py b/scripts/templating/matrix_templates/units.py index 5930b0d0..90a87cd4 100644 --- a/scripts/templating/matrix_templates/units.py +++ b/scripts/templating/matrix_templates/units.py @@ -326,6 +326,10 @@ def process_data_type(prop, required=False, enforce_title=True): nested = process_data_type(t) tables.extend(nested['tables']) prop_title.append(nested['title']) + # Assuming there's at most one enum among type options + enum_desc = nested['enum_desc'] + if enum_desc: + enum_desc = "%s if the type is enum" % enum_desc else: prop_title.append(t) else: