OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

tosca-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [tosca-comment] Re: TOSCA inputs and outputs for shell scripts


Also, regarding parse see https://github.com/cblp/yaml-sucks for example

On Wed, Oct 7, 2020 at 10:12 PM adam souzis <adam@onecommons.org> wrote:
yes, indeed -- that's why I wrote:ÂÂ

If you do want to support YAML I suggest specifying a safe subset (i.e. JSON :)



On Wed, Oct 7, 2020 at 10:08 PM Tal Liron <tliron@redhat.com> wrote:
On Wed, Oct 7, 2020 at 10:30 PM adam souzis <adam@onecommons.org> wrote:
YAML is nicer for humans but for machine interchange I think JSON is clearly superior:

Adam, I bring good news: the whitespace style in YAML is optional. You can use JSON-style if you prefer. And in fact as of version 1.2 YAML is a strict superset of JSON. Thus, every YAML 1.2 parser would be able to consume JSON. (YAML 1.2 also introduces breaking changes; it's a long story.)

JSON, like YAML, also has special keywords: true, false, null, nan, etc. So you have the same potential challenge as with JSON in consuming strings that look like these keywords. A conformant encoder should properly escape such values.

Note that JSON has a very serious deficiency compared to YAML: it does not distinguish between integers and floats. (There are implementations that do, but they are non-comfortant and portability is not guaranteed.)

As of TOSCA 2.0 we've beefed up the specification for primitive data type interchange and finally separated it from YAML. Thus, though TOSCA syntax is written in YAML, its data types (for inputs, outputs, properties, attributes, etc.) are not limited by your TOSCA code. So, at the end of the day, I think it would be safe to use whatever interchange format is convenient for your application as long as you are aware of its limitations (e.g. no integers in JSON) and understand TOSCA's assumptions. I agree that JSON's universality is a big advantage.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]