Re: TOSCA examples from spec

From
Tal Liron <>
Date
2022-01-28T18:14:38+00:00
ID
Thread
Re: TOSCA examples from spec
On Fri, Jan 28, 2022 at 12:04 PM Chris Lauwers <> wrote:

For example. I donât believe there should be any difference between the two following âemptyâ service
 templates:

Â

tosca_definitions_version: tosca_simple_yaml_1_3

topology_template:

Â

and

Â

tosca_definitions_version: tosca_simple_yaml_1_3

topology_template: {}

Â

I think both should be valid. As a general rule, we should make the TOSCA syntax as permissive as possible without sacrificing correctness.

Well ... I have a slight disagreement here. The problem is that the first example will indeed be parsed as a null value. This is a quirk of YAML that I'm frankly not a fan of, and frankly I wish it would be a syntax error. For TOSCA, I'm in favor of making it explicitly an empty map. This allows designers at a glance to know what is missing or empty. So, it would be parsable in YAML, but the TOSCA parser would say "sorry, there is a null value here, but it must be a map" (this is what Puccini does; I always go for strictness).

If folk are in favor of this permissiveness, then perhaps an exception can be made ONLY for maps and lists (and sequenced lists). I hope none of us wants a string or integer to automatically convert null to empty string or zero.