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

 


Help: OASIS Mailing Lists Help | MarkMail Help

tosca message

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


Subject: Re: [tosca] Clarification required for "!!timestamp" type in YAML


Yes, that is my recommendation: always put quotation marks around timestamp notations, and if a YAML "!!timestamp" is used, the TOSCA parser should emit an error about an unsupported data type.

Otherwise we would get inconsistent results. Since my last email I've done more testing with various YAML parsers in various programming languages and found differences between each of them in how they handle such objects. Especially when doing round trips you might find strings turning into internal time representations and back again. It is a mess that can lead to inconsistent results across TOSCA parsers.

By decoupling the TOSCA timestamp from the YAML timestamp we can guarantee consistent behavior. Beyond that, we free the TOSCA spec from a dependency on another spec.

On Sat, Nov 23, 2019 at 12:37 PM Chris Lauwers <lauwers@ubicity.com> wrote:

Hi Tal, just to make sure I understand your recommendation: youâre proposing to explicitly put quotes around timestamp values to make sure the YAML parser doesnât convert these into (language-specific) timestamp data structures, and instead make it the TOSCA parserâs responsibility to convert strings to timestamps.

Â

Iâm fine with this proposal (especially since the TOSCA parser will have to provide this functionality anyway).

Â

Chris

Â

From: Tal Liron [mailto:tliron@redhat.com]
Sent: Monday, October 07, 2019 6:11 AM
To: Chris Lauwers
Cc: tosca@lists.oasis-open.org
Subject: Re: [tosca] Clarification required for "!!timestamp" type in YAML

Â

On Sun, Oct 6, 2019 at 8:14 PM Chris Lauwers <lauwers@ubicity.com> wrote:

These are good comments, but unfortunately I think thatâs just how YAML works: parsers will try their best to determine the intended type of a value, and theyâre not always right.

Â

If that's the case, I do recommend the following:

  1. We explicitly state that we accept both the timestamp type and strings.
  2. I think we should change all the examples in the spec to use either "!!timestamp" or to wrap it in strings, and that it should be the "good practice" that we decide to encourage. As for the good practice, I think it should be string: so, always wrap in quotes. This ensures that the TOSCA spec is the right one for timestamps and that we're not at the mercy of another spec, YAML. E.g. if the string is stored in a database, etc., we can refer to the TOSCA spec and not have to add another one.


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