Uploaded image for project: 'OASIS Cloud Application Management for Platforms (CAMP) TC'
  1. OASIS Cloud Application Management for Platforms (CAMP) TC
  2. CAMP-52

Use of Cardinality for JSON array attributes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Spec
    • Labels:
      None
    • Proposal:
      Hide

      Change the use of the "cardinality" property of attribute definitions to a boolean "required" .

      Need to add text to clarify that. if the required property value is "false" then
      the message is valid both with and without the attribute present.

      If the value is "true" the the message is valid only if the attribute is present.

      We should also work on a clarification on whether array attribute types have any constraints on the minimum or maximum array bounds.

      We should clarify the spec after answering the following questions:

      Are there any attributes with array type which have upper or lower bounds on the array sizes?

      In particular:
      can every array attribute be present in a message with no members (i.e., empty)?
      are there any array attributes which have upper bounds on array size?

      If there is a need to specify such array size bounds we would need to provide notation for this.

      Show
      Change the use of the "cardinality" property of attribute definitions to a boolean "required" . Need to add text to clarify that. if the required property value is "false" then the message is valid both with and without the attribute present. If the value is "true" the the message is valid only if the attribute is present. We should also work on a clarification on whether array attribute types have any constraints on the minimum or maximum array bounds. We should clarify the spec after answering the following questions: Are there any attributes with array type which have upper or lower bounds on the array sizes? In particular: can every array attribute be present in a message with no members (i.e., empty)? are there any array attributes which have upper bounds on array size? If there is a need to specify such array size bounds we would need to provide notation for this.

      Description

      There are several attributes defined with an array type (e.g, String[] . Link[])

      These attribute definitions have various cardinality values, including, 1, 0..1, or 0..*

      It makes no sense for an array attribute to have cardinality 0..*, for this implies multiple arrays in the JSON serialization.

      In the case of 0..1 cardinality, Is there a difference in having an array present with 0 elements, versus not having the array present?

      In the case of 1 cardinality, is it allowed to have an array with 0 elements present for its serialization?

      There does not seem to be a way to specify that an array should not be present in the serialization with zero elements. What is the difference between no attribute in the serialization, verses an array attribute with no elements?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tomrutt Tom Rutt (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: