[CORD-2022] Adding inherited fields to TOSCA definition
Change-Id: I76140526fe9c40980a614213b25b9fe424118bd7
diff --git a/src/tosca/xtarget/tosca.xtarget b/src/tosca/xtarget/tosca.xtarget
index d162d30..5faafee 100644
--- a/src/tosca/xtarget/tosca.xtarget
+++ b/src/tosca/xtarget/tosca.xtarget
@@ -1,7 +1,10 @@
+
+{% for m in proto.messages %}
+
tosca_definitions_version: tosca_simple_yaml_1_0
node_types:
-{% for m in proto.messages %}
+
tosca.nodes.{{ m.name }}:
derived_from: tosca.nodes.Root
description: {% if m.options.description -%}{{ m.options.description}}{% else%}"An XOS {{ m.name }}"{%- endif %}
@@ -13,7 +16,7 @@
type: boolean
default: false
description: Allow to reference existing models in TOSCA recipes
- {% for f in m.fields %}
+ {% for f in (m.fields + xproto_base_fields(m, proto.message_table)) | sort(attribute='name') %}
{%- if not f.link -%}
{{ f.name }}:
type: {{ xproto_tosca_field_type(f.type) }}
@@ -38,4 +41,8 @@
tosca.capabilities.xos.{{ m.name }}:
derived_from: tosca.capabilities.Root
description: {{ m.name }}
-{%- endfor %}
\ No newline at end of file
+
++++ {{ m.name }}.yaml
+
+{%- endfor %}
+