ConsumerDataStandardsAustralia / standards-maintenance

This repository houses the interactions, consultations and work management to support the maintenance of baselined components of the Consumer Data Right API Standards and Information Security profile.
41 stars 9 forks source link

Use of additionalValue field for ADDITIONAL_CARDS #390

Open nils-work opened 3 years ago

nils-work commented 3 years ago

Description

The additionalValue property of Product Features is currently specified as a conditional string based on featureType.

For the ADDITIONAL_CARDS feature type, Use of additionalValue Field states - The maximum number of additional cards. If no maximum then should be set to null

So, if a product has the ADDITIONAL_CARDS feature, the additionalValue property should exist and the value should either be a numeric string or null.

There should be no problem if a maximum number number of cards applies. The value could be set like "5", and basic schema validation tests that check that the additionalValue property exists and contains a numeric string would pass.

The options where there is no maximum number of cards appear to be -

  1. Set to null according to the field description - this would fail because it is not a string and fails basic schema validation.
  2. Set to "null" - it is a string, but it is not numeric and fails detailed schema validation.
  3. Set to "" - it is a string, but it is not numeric and fails detailed schema validation.
  4. Set to a negative number like "-1" - this could be made to pass detailed schema validation, but the value is normally expected to be a positive integer.
  5. Omit the field - this currently fails basic conditional validation (description implies the field should be present), but passes detailed schema validation (because there is no value to test). Other fields (e.g. BILL_PAYMENT, PENSION_RECIPIENT, STUDENT) state that their values are Optional.

It seems the intention may have been to omit the field completely, but this may also contradict the statement about Mandatory/Optional fields - If the conditional statement is true in a specific request or response the field is considered mandatory.

Changing the conditional statement slightly may make the logic and intent clearer and comparisons across data holders more consistent. I believe all other instances of additionalValue only require simple string values when present.

Area Affected

Documentation detail in the Use of additionalValue Field for ADDITIONAL_CARDS featureType.

Change Proposed

Consider removing the 'set to null' text and/or specify a different option for when no maximum exists. e.g. The maximum number of additional cards, or "-1" if no maximum is defined. or Optional. The maximum number of additional cards, where a maximum is defined.