IPA-118: Extensible by Default
Signaling to clients any intentions for future extensibility and designing APIs conservatively reduces the potential of unintended impact.
Guidance
API specs must not set additionalProperties to
false, so that additional fields can be added later without breaking existing clients.components:
schemas:
User:
type: object
properties:
id:
type: string
name:
type: stringWhy:Leaving
additionalPropertiesunset (it defaults totrue) lets a future field appear in responses without invalidating the schema a client already validates against.components:
schemas:
User:
type: object
additionalProperties: false
properties:
id:
type: string
name:
type: stringWhy:additionalProperties: falserejects any field not listed today, so adding a new field becomes a breaking change for clients that validate responses strictly.Request parameter data constraints should be specific and restrictive, so that the accepted range can be widened later without breaking existing clients.
parameters:
- name: status
in: query
schema:
type: string
enum: [ACTIVE, ARCHIVED]Why:A narrow enum can later gain a value without affecting clients that send only the existing ones. Widening an accepted set is backward compatible; narrowing it is not.
parameters:
- name: status
in: query
schema:
type: stringWhy:An unconstrained string accepts any value from day one, leaving no room to add meaning to new values later and no way to tighten the contract without breaking callers that already send arbitrary input.
Enumerate every parameter under
paths.*.*.parametersand every shared parameter undercomponents.parameters.For each parameter, inspect its
schemafor constraints appropriate to the type:enumfor closed value sets,minimum/maximumfor numbers,minLength/maxLength/patternfor strings,formatwhere one applies.Flag any parameter whose value space is broader than the values it actually accepts — a bare
stringorintegerwith no constraint where the description or behavior implies a bounded set.Report each under-constrained parameter, since a constraint can be relaxed later without breaking clients but cannot be tightened.
API producers should default to multi-cloud support when implementing features.
paths:
/deployments:
post:
operationId: createDeployment
requestBody:
content:
application/json:
schema:
type: object
properties:
provider:
type: string
enum: [PROVIDER_A, PROVIDER_B, PROVIDER_C]
region:
type: stringWhy:The request lets the caller pick from every supported provider, so the feature works across providers rather than assuming a single one.
paths:
/deployments:
post:
operationId: createDeployment
requestBody:
content:
application/json:
schema:
type: object
properties:
region:
type: stringWhy:With no provider field, the feature implicitly hard-codes one provider. Adding multi-provider support afterward forces a new field onto an already-shipped contract.
Identify the operations and request/response schemas that introduce the feature under review.
Determine whether the feature is cloud-provider dependent by inspecting the schema for provider, region, or location fields and, where the spec is ambiguous, the backing source code or service configuration.
For a provider-dependent feature, confirm the contract admits more than one provider — for example a
providerenum listing each supported provider rather than a single hard-coded value.Report any feature whose contract or implementation assumes a single cloud provider where multi-cloud support is feasible.