You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tosca_definitions_version: tosca_simple_yaml_1_3capability_types:
TMFAPI:
derived_from: tosca.capabilities.Nodedescription: a TMForum defined REST APIproperties:
id:
type: stringdescription: the id e.g TMF632name:
type: stringdescription: the name, e.g. partyTMF632:
derived_from: TMFAPIproperties:
id: TMF632name: party
then
$ opera validate template.yaml
Validating service template...
template.yaml:19:11: [PropertyDefinition] Expected map.
$
According to both Section 3.6.10.6 and the last example of Section 3.6.10.8 of TOSCA v1.3, both lines 18 and 19 are correct.
Hi, @philippemerle thanks for opening this, I see that we should probably use ParameterDefinition instead of PropertyDefinition in src/opera/parser/tosca/v_1_3/capability_type.py (and also in other places where appropriate).
Still opera's TOSCA parser would expect a map (= dict) and to me refinement with just property_name: value (like id: TMF632 or name: party in your example) feels weird but if this is the correct syntax we would need to add additional possibility (XOR between map and direct value).
If I use ParameterDefinition in src/opera/parser/tosca/v_1_3/capability_type.py and change template to use a map type for property it goes through xOpera validation just fine:
tosca_definitions_version: tosca_simple_yaml_1_3capability_types:
TMFAPI:
derived_from: tosca.capabilities.Nodedescription: a TMForum defined REST APIproperties:
id:
type: stringdescription: the id e.g TMF632name:
type: stringdescription: the name, e.g. partyTMF632:
derived_from: TMFAPIproperties:
id:
value: TMF632name:
value: party
According to Section 3.6.14.2 of TOSCA 1.3, the <parameter_name>: <parameter_value> | { <parameter_value_expression> } shall be supported. So you would need to add additional possibilities, i.e. map and direct value and value expression such as get_property.
Given the following template
then
According to both Section 3.6.10.6 and the last example of Section 3.6.10.8 of TOSCA v1.3, both lines 18 and 19 are correct.
Thank to @pmjordan for reporting this problem.
The text was updated successfully, but these errors were encountered: