tosca-comment

 View Only
  • 1.  Sequenced list

    Posted 03-06-2017 07:18
    Hi,

    We are currently working on a Java data model for the current version
    of the specification.

    There, the data type "sequenced list" is used. For instance, at the
    "constraints" of properties (page 94 / 3.6.9.5 Example), it reads as
    follows:

    constraints:
    - min_length: 6
    - max_length: 10

    Why is not the normal YAML syntax used?

    constraints:
    min_length: 6
    max_length: 10

    The former leads to a List of Maps, whereas the directly leads to a map.

    Maybe the specification could elaborate more an the design decisions
    or try to simplify the data structure a bit.

    Cheers,

    Oliver



  • 2.  Re: [tosca-comment] Sequenced list

    Posted 03-06-2017 22:17
    Hi Oliver,

    Actually, I think you got the indentation off a bit, but are correct that
    it yields a list of Maps

    e.g.,

    properties:
    listen_ports:
    type: list
    entry_schema:
    description: listen port entry (simple integer type)
    type: integer
    constraints:
    - max_length: 128

    yields:

    {
    "properties": {
    "listen_ports": {
    "entry_schema": {
    "type": "integer",
    "description": "listen port entry (simple integer type)",
    "constraints": [
    {
    "max_length": 128
    }
    ]
    },
    "type": "list"
    }
    }
    }

    It was decided that a sequence was needed, going back to v1.0, in order to
    cause the constraints to applied/validated in order. There is no
    concrete use case to show this, nor is there one I can think of, but it is
    valid and does work despite adding complexity. It could be considered,
    in a future version, to lax the syntax and allow for unordered lists;
    however, the ordered/sequenced list would still be preserved for backwards
    compatibility.

    Kind regards,
    Matt




    From: Oliver Kopp <kopp.dev@gmail.com>
    To: tosca-comment@lists.oasis-open.org
    Date: 03/06/2017 01:18 AM
    Subject: [tosca-comment] Sequenced list
    Sent by: <tosca-comment@lists.oasis-open.org>



    Hi,

    We are currently working on a Java data model for the current version
    of the specification.

    There, the data type "sequenced list" is used. For instance, at the
    "constraints" of properties (page 94 / 3.6.9.5 Example), it reads as
    follows:

    constraints:
    - min_length: 6
    - max_length: 10

    Why is not the normal YAML syntax used?

    constraints:
    min_length: 6
    max_length: 10

    The former leads to a List of Maps, whereas the directly leads to a map.

    Maybe the specification could elaborate more an the design decisions
    or try to simplify the data structure a bit.

    Cheers,

    Oliver

    --
    This publicly archived list offers a means to provide input to the
    OASIS Topology and Orchestration Specification for Cloud Applications
    (TOSCA) TC.

    In order to verify user consent to the Feedback License terms and
    to minimize spam in the list archive, subscription is required
    before posting.

    Subscribe: tosca-comment-subscribe@lists.oasis-open.org
    Unsubscribe: tosca-comment-unsubscribe@lists.oasis-open.org
    List help: tosca-comment-help@lists.oasis-open.org
    List archive: http://lists.oasis-open.org/archives/tosca-comment/
    Feedback License: http://www.oasis-open.org/who/ipr/feedback_license.pdf
    List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
    Committee: http://www.oasis-open.org/committees/tosca
    Join OASIS: http://www.oasis-open.org/join/