standards-maintenance
standards-maintenance copied to clipboard
Use of additionalValue field for ADDITIONAL_CARDS
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 -
- Set to
null
according to the field description - this would fail because it is not a string and fails basic schema validation. - Set to
"null"
- it is a string, but it is not numeric and fails detailed schema validation. - Set to
""
- it is a string, but it is not numeric and fails detailed schema validation. - 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. - 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.