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] key_schema in TOSCA 1.3?


Yes. I use ruamel.yaml, so I didnât know this was an issue 😊 Iâll put this topic on the agenda for tomorrow.

 

Chris

 

From: Tal Liron <tliron@redhat.com>
Sent: Monday, September 09, 2019 6:52 AM
To: Chris Lauwers <lauwers@ubicity.com>
Cc: tosca@lists.oasis-open.org
Subject: Re: [tosca] key_schema in TOSCA 1.3?

 

Closer look: this is tricky.

 

The YAML spec is indeed clear in 10.1.1.1: "YAML places no restrictions on the type of keys; in particular, they are not restricted to being scalars." Also see Example 2.11.

 

Unfortunately, reality is more complicated. Some popular YAML parsers do not support this feature. From testing I found that PyYAML and Go's YAML parser do not. Ruby's YAML parser and Ruamel YAML parser (Python) do. This is obviously a challenging feature to support due to the nature of implementing hashtables. The bottom line is that it will make it tricky across platforms to parse TOSCA that uses this feature.

 

I guess the general question is what we are trying to achieve with this feature, what are the use cases, etc. There might be better grammatical solutions.

 

On Mon, Sep 9, 2019 at 1:34 AM Tal Liron <tliron@redhat.com> wrote:

It's seems that you are right, it's a rather obscure feature and does require a special syntax. It would be interesting to see what YAML parsers make of it.

 

On Sun, Sep 8, 2019 at 9:22 PM Chris Lauwers <lauwers@ubicity.com> wrote:

My understanding is that YAML allows pretty much anything to be used as a key in a map, including complex objects.

 

This might be a good topic to revisit during our Tuesday meeting.

 

Thanks,

 

Chris

 

From: tosca@lists.oasis-open.org <tosca@lists.oasis-open.org> On Behalf Of Tal Liron
Sent: Sunday, September 08, 2019 1:42 PM
To: tosca@lists.oasis-open.org
Subject: [tosca] key_schema in TOSCA 1.3?

 

I'm confused by the intent for new grammar for key_schema.

 

How do you assign values if the key_schema is not a string? YAML does not have such syntax. Would it be a list a tuples, perhaps? Is this in the spec somewhere but I missed it?

 

Also, it seems the the new "schema definition" itself has keywords for key_schema and entry_schema. Is this a mistake? Shouldn't those only be in attribute/property definitions?

 

Also, a long-standing issue: the entry_schema and key_schema keywords are marked as non-required. However, if the type is a list or map then they should be required, no? Or is there a default value (string?) that is expected. This behavior is not specified.



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