I personally never knew how to handle this bizarre type, and never understood why it existed in TOSCA. Since it always can ever have one and only one value, what's the point of having "required" or "default" for it? How should those be handled?
I will leave it up to you, or another contributor to decide. :) My only guideline would be: I believe this type exists, perhaps, to allow for temporary deprecation/cancellation of properties without removing them entirely. A way of "commenting out" stuff, like you do in programming languages. With that in mind, things like "required" and "default" should still retain some meaning. So, if a null-typed property is "required" but does not have a "default" value: I believe that ARIA should still consider this an error. Basically, you want the language engine to still do the right thing even though the type is nonsensical. On Thu, Jan 4, 2018 at 11:21 PM, Vaishnavi K.R <[email protected]> wrote: > Hi, > > > I tried using the property type 'null' in one of the properties of a node > type. > > And I didn't pass any value to the property in the respective node > template. > > > When I tried storing the template, I get the following validation issues, > > > Storing service template null_test... > Validation issues: > 2: field "type" in > "aria_extension_tosca.simple_v1_0.definitions.PropertyDefinition" > is not a valid "str": None > @"null.yaml":9:15 > ValueError: not a "unicode": None > 4: "type" refers to an unknown data type in "my_null_param": 'None' > @"null.yaml":9:15 > Failed to parse service template > > I used the following service template, > > tosca_definitions_version: tosca_simple_yaml_1_0 > > node_types: > tosca.nodes.null: > derived_from: tosca.nodes.Root > properties: > my_null_param: > required: True > type: null > my_str_param: > required: True > type: string > > topology_template: > node_templates: > test_node: > type: tosca.nodes.null > properties: > my_null_param: > my_str_param: hello > > > I had a look at the source code and found that 'null' is regarded as a > primitive datatype. > > As 'null' type also have a YAML specification that must be adhered, could > that be handled as a separate datatype like 'timestamp' ? > > > And also is this a known issue? Does a JIRA exist for this? > > > Thanks, > > /Vaish >
