API design principles
General considerationsβ
The following considerations come from past implementations:
- Null safety: Implementations MUST treat a missing field the same as a field set to
null, and behave the same way in both cases. This aligns with the Consumer Data Standards. - Unknown enumeration values: In line with the Consumer Data Standards, blank strings are invalid for
enumeration values. If an enumeration value is not available, the field MUST either be omitted or set
to
null(where applicable, Biza defaults toUnspecifiedif the Data Adapter value isnull). - Specification first: We aim to keep this documentation fully aligned with the underlying specifications, but implementers MUST treat the published OpenAPI specifications as the source of truth.
API design principlesβ
The following principles guide the design of Biza APIs. Biza applies them pragmatically rather than rigidly.
- Simplify: The CDS has several endpoints that can be collapsed for data collection. For APIs that deliver information for CDS purposes (mainly the Data Adapter), Biza collapses this functionality where it makes sense.
- Use upstream structure: Inherit upstream structures where possible. Where that is not possible, keep the original "shape" but apply the other principles for engineering benefit (for example, Strongly typed).
- Strongly typed: The Data Standards use custom data types wrapped in
String-based OpenAPI data types. Biza API endpoints use strongly typed values where it is reasonable to do so.
Versioning principlesβ
- Multiple release compatibility: When Biza API definitions change, backward compatibility MUST be maintained for at least 2 releases and SHOULD be maintained for as long as possible.
- Global version: Biza API definitions avoid the CDR's complex version negotiation, mainly because it is unnecessary in an internal environment. Each API specification is released as a single version covering all the endpoints it defines.
- Retirement dates: When a newer Data Adapter endpoint version supersedes an older one, Biza sets a retirement date for the older version, usually based on the CDR Future Dated Obligations.
- One version where feasible: Where feasible, Biza documents a downgrade path, so that your adapter needs to support only one version of an endpoint to meet all current CDR obligations.
- Upgrade only when needed: You usually need to upgrade only to meet a retirement date or a new CDR Future Dated Obligation, or to use a new HaaS feature.
See Versioning for how the Data Adapter advertises and negotiates versions.
Note
Biza API schemas do not necessarily map 1:1 to CDS APIs. You can use VTS (the Verification Testing Tool combined with the Biza Test Suite) to check the responses HaaS returns to the CDR ecosystem.