OASIS TC Open Repository: Manages TOSCA profiles, tests, and templates that are maintained by the TOSCA community. They are intended to be used as examples to help developers get started with TOSCA and to test compliance of TOSCA implementations with the standard.
The problem is that the last 3 lines are a YAML syntax error because we have a YAML map in which 3 keys are identical.
To be clear, this not a TOSCA issue, but strictly a YAML one. A TOSCA processor would know to call each of these three functions separately. (It would have to then map sure that their values are unique in that map, but that is a separate concern.) But YAML does not allow us to express this.
I propose the following workaround: allow for a special character in function names after which TOSCA will ignore all characters. This allows users to create unique names in YAML for this use case while allowing them to be considered the same name in TOSCA. We might as well re-use the "$" character for this purpose. Example:
There is no YAML syntax error here. The TOSCA processor will ignore the the $1 and $2 suffixes, ensuring that all three of these keys are calling the same function.
We should also for this "middle $" to be escapable. Example:
$convert$$to€
The actual name of the function above would be convert$to€.
The following is a valid use case, but currently cannot be expressed in TOSCA:
The problem is that the last 3 lines are a YAML syntax error because we have a YAML map in which 3 keys are identical.
To be clear, this not a TOSCA issue, but strictly a YAML one. A TOSCA processor would know to call each of these three functions separately. (It would have to then map sure that their values are unique in that map, but that is a separate concern.) But YAML does not allow us to express this.
I propose the following workaround: allow for a special character in function names after which TOSCA will ignore all characters. This allows users to create unique names in YAML for this use case while allowing them to be considered the same name in TOSCA. We might as well re-use the "$" character for this purpose. Example:
There is no YAML syntax error here. The TOSCA processor will ignore the the
$1
and$2
suffixes, ensuring that all three of these keys are calling the same function.We should also for this "middle $" to be escapable. Example:
The actual name of the function above would be
convert$to€
.