oasis-open / tosca-community-contributions

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.
https://github.com/oasis-open/tosca-community-contributions
Apache License 2.0
39 stars 25 forks source link

Spec is inconsistent about version values treated as floating numbers #167

Open Shishqa opened 5 months ago

Shishqa commented 5 months ago

Hi! I've recently noticed that TOSCA 2.0 spec contains the note about the necessity of wrapping 2-unit version value with quotes (link)

When specifying a version string that contains just a major and a minor version number, the version string must be enclosed in quotes to prevent the YAML parser from treating the version as a floating point value.

However, all the examples contain not enclosed version values. Some links:

Could you please clarify the actual state spec here? Should version values be enclosed?

lauwers commented 5 months ago

Thanks @Shishqa for catching this. Yes, all TOSCA version values in TOSCA files must be quoted, since the YAML parser will automatically convert unquoted 2-unit version values to floats. We will go through the draft of the spec to correct all examples.

Note however, that the same does not necessarily apply to version values in TOSCA.meta files, since those files are not defined to be YAML files.