[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: TOSCA examples from spec
On Fri, Jan 28, 2022 at 11:35 AM Chris Lauwers <lauwers@ubicity.com> wrote:
Yes, please. I've made a similar proposal in the past -- that we allow any arbitrary YAML 1.2 data in "metadata". Let's please add this to the TODO spreadsheet so we don't forget. Great. Hopefully no one disagrees so we can just include this in the spec.
We define this in terms of values. In TOSCA 2.0 there is a "nil" primitive type (it used to be called "null") which is the
only type that can accept a null value, which is represented in YAML as null. Also, I do think we define it for keywords. For example, a keyword type can be "string", "integer", "list of string", or "map of property assignments". For all of these I don't think null should be an acceptable
value. A null value for a string is not equivalent to an empty string. A null value for an integer is not equivalent to zero. And a null value is not equivalent to an empty list or map. Thus, in my opinion, a TOSCA parser should emit an error if a null is
used for any of these keywords. For an empty string you should put "". For zero, you should put 0. For an empty list you should put []. And for an empty map you should put {}. Thus there is no ambiguity about either types or values. That's not to say that Ubicity's interpretation is unreasonable, but I think we all agree that this should be consistent across implementations. Let's then also please add a decision about this to the TODO spreadsheet. Yes, we should distinguish between values that need to comply with TOSCA types vs. syntax elements in the language. I completely agree that for âvaluesâ there is a difference between âan empty mapâ vs. ânullâ
and the spec needs to spell out exactly how YAML values map to TOSCA values. However, I was talking more specifically about syntax elements in the language. 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. Chris |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]