IPA-112: Field Names
Naming fields in a way that is intuitive to users can often be one of the most challenging aspects of designing an API. This is true for many reasons; often a field name that seems entirely intuitive to the author can baffle a reader.
Users rarely use only one API; they use many APIs together. As a result, a single company using the same name to mean different things (or different names to mean the same thing) can often cause unnecessary confusion.
It's important to keep consistency to allow users take what they've already learned from one API and apply that to another.
In short, APIs are easiest to understand when field names are simple, intuitive, and consistent with one another.
Guidance
Clarity
Field names should communicate the concept being presented and avoid ambiguous names.
components:
schemas:
User:
type: object
properties:
createdAt:
type: string
format: date-time
accountStatus:
type: stringWhy:createdAtandaccountStatusclearly describe what the field represents without ambiguity.components:
schemas:
User:
type: object
properties:
ts:
type: string
format: date-time
status2:
type: stringWhy:tsis ambiguous — it could mean timestamp, TypeScript, or something else.status2implies a second status field without explaining the concept.Locate all field names across the spec's request and response schemas.
For each field, determine whether its name clearly describes the concept it holds without requiring additional context.
Flag fields whose names could be confused with a different concept or that require reading the description to understand their purpose.
Field names should avoid including unnecessary words.
components:
schemas:
Order:
type: object
properties:
status:
type: stringWhy:statusis concise. TheOrderschema context already implies it is the order's status.components:
schemas:
Order:
type: object
properties:
orderStatus:
type: stringWhy:orderStatusrepeats the schema name. TheOrdercontext makes theorderprefix redundant.For each field name, check whether any part of the name duplicates the surrounding schema name or other contextual information already implied by the location.
Identify words that add no meaning and could be removed without loss of clarity.
Flag fields where removing a word makes the name equally clear.
Field names should not use abbreviations unless the abbreviation is well-understood by the audience (for example:
ip,aws,tcp).components:
schemas:
Server:
type: object
properties:
ipAddress:
type: string
region:
type: stringWhy:ipAddressuses the widely understoodipabbreviation.regionis fully spelled out.components:
schemas:
Server:
type: object
properties:
srvAddr:
type: string
rgn:
type: stringWhy:srvAddrandrgnare non-standard abbreviations that require readers to guess the full meaning.- List all field names across the spec.
Identify names containing abbreviations (short sequences or missing vowels).
Determine whether each abbreviation is widely understood in the target audience domain (networking, cloud infrastructure, etc.).
Flag abbreviations that are not industry-standard or are ambiguous without additional context.
Casing and characters
Field names must use
camelCase.components:
schemas:
User:
type: object
properties:
firstName:
type: string
lastLoginAt:
type: string
format: date-timeWhy:firstNameandlastLoginAtstart with a lowercase letter and capitalize each subsequent word.components:
schemas:
User:
type: object
properties:
first_name:
type: string
LastLoginAt:
type: string
format: date-timeWhy:first_nameuses snake_case andLastLoginAtuses PascalCase. Both violate the camelCase requirement.Fields must not contain leading, trailing, or adjacent underscores.
components:
schemas:
Document:
type: object
properties:
id:
type: stringWhy:idcontains no underscores. Field names use camelCase rather than underscore-separated words.components:
schemas:
Document:
type: object
properties:
_id:
type: string
__metadata:
type: objectWhy:_idhas a leading underscore and__metadatahas double leading underscores. Both are prohibited regardless of the originating storage convention.
Semantics
Field names must not reflect an intent or action — fields must not be verbs.
components:
schemas:
User:
type: object
properties:
disabled:
type: booleanWhy:disabledis an adjective describing state, not a verb instructing an action.components:
schemas:
User:
type: object
properties:
disable:
type: booleanWhy:disableis a verb. Field names must represent state or data, not commands or intents.List all field names across request and response schemas.
Identify names that are base-form verbs (e.g.,
disable,create,update).Verify that state-representing fields are adjectives (e.g.,
disabled,created) rather than verbs.Flag any field name that functions as a command or imperative verb.
Repeated fields must use the proper plural form.
components:
schemas:
Order:
type: object
properties:
items:
type: array
items:
$ref: "#/components/schemas/OrderItem"
tags:
type: array
items:
type: stringWhy:itemsandtagsare correctly pluralized array fields.components:
schemas:
Order:
type: object
properties:
item:
type: array
items:
$ref: "#/components/schemas/OrderItem"
tag:
type: array
items:
type: stringWhy:itemandtagare singular but represent collections. Singular names for array fields mislead readers about cardinality.Find all schema properties typed as
arrayacross the spec.Verify that each array property name uses the proper plural form.
- Flag array properties with singular names.
Boolean fields
Boolean fields should omit the
isprefix.components:
schemas:
User:
type: object
properties:
disabled:
type: boolean
active:
type: booleanWhy:disabledandactiveare clear boolean adjectives without a redundantisprefix.components:
schemas:
User:
type: object
properties:
isDisabled:
type: boolean
isActive:
type: booleanWhy:isDisabledandisActivecarry a redundantisprefix. The boolean type already implies a yes/no value.
Consistency
APIs should use the same name for the same concept and different names for different concepts, including across APIs and resources.
components:
schemas:
User:
type: object
properties:
createdAt:
type: string
format: date-time
Order:
type: object
properties:
createdAt:
type: string
format: date-timeWhy:Both
UserandOrderusecreatedAtfor the creation timestamp. Readers immediately recognize the semantics when they encounter it on any resource.components:
schemas:
User:
type: object
properties:
createdAt:
type: string
format: date-time
Order:
type: object
properties:
creationDate:
type: string
format: date-timeWhy:createdAtandcreationDaterepresent the same concept but use different names, forcing consumers to learn resource-specific vocabulary.Collect all field names across all schemas in the spec.
Group fields by their documented description or semantic type (e.g., creation timestamps, identifiers, status enums).
Flag groups where multiple names describe the same concept.
Flag cases where the same field name appears on different schemas with different documented semantics.
Names should be unified between the GUI and the API wherever possible.
components:
schemas:
Cluster:
type: object
properties:
diskSizeGB:
type: number
description: >
Storage capacity in gigabytes. Displayed as "Disk Size (GB)" in the
UI.Why:The field description maps the API field name to the corresponding UI label, making it easy for users who switch between interfaces.
components:
schemas:
Cluster:
type: object
properties:
storageCapacity:
type: number
description: Storage capacity in gigabytes.Why:If the UI calls the same concept "Disk Size",
storageCapacityin the API creates a disconnect. Users searching for "disk size" in API docs won't find it.Identify the UI labels for concepts exposed by the API.
Compare each API field name against the corresponding UI label for the same concept.
Flag API field names that diverge from their GUI counterparts without a documented justification.
Field names that represent common conventions must use the same name and description as established across existing APIs.
components:
schemas:
Resource:
type: object
properties:
id:
type: string
description: Unique identifier for the resource.
createdAt:
type: string
format: date-time
description: Timestamp when the resource was created.Why:idandcreatedAtmatch established standard names and descriptions used for identifiers and creation timestamps across APIs.components:
schemas:
Resource:
type: object
properties:
resourceId:
type: string
description: The ID of this resource.
dateCreated:
type: string
format: date-time
description: The date the resource was created.Why:resourceIdanddateCreateddeviate from the standard namesidandcreatedAtfor well-known conventions, fragmenting the shared vocabulary across APIs.Identify fields in the spec that represent common cross-API concepts such as identifiers, timestamps, status, and error codes.
Cross-reference these fields against established standard field names and descriptions documented in IPA guidelines or the API style guide.
Flag fields that use a non-standard name or description for a well-known convention.
Field names must refer to a singular concept when used across APIs.
components:
schemas:
User:
type: object
properties:
status:
type: string
enum: [active, inactive, suspended]
description: Lifecycle state of the user account.
Order:
type: object
properties:
status:
type: string
enum: [pending, fulfilled, cancelled]
description: Fulfillment state of the order.Why:Both schemas use
statusfor a lifecycle/state concept. Enum values differ, but the semantic type is the same across both usages.components:
schemas:
User:
type: object
properties:
status:
type: string
description: Lifecycle state of the user account.
ServerResponse:
type: object
properties:
status:
type: integer
description: HTTP status code of the last operation.Why:statusmeans "lifecycle state" onUserbut "HTTP status code" onServerResponse. The same name maps to two unrelated concepts.Find all field names that appear in more than one schema across the spec.
For each repeated name, compare the descriptions and types across schemas.
Flag field names where the same name is used for semantically different concepts.
Existing concepts must map to a singular field name.
components:
schemas:
User:
type: object
properties:
groupId:
type: string
description: The group this user belongs to.
Project:
type: object
properties:
groupId:
type: string
description: The group this project belongs to.Why:Both schemas use
groupIdfor the organizational grouping concept. Consumers learn the name once and recognize it everywhere.components:
schemas:
User:
type: object
properties:
groupId:
type: string
description: The group this user belongs to.
Project:
type: object
properties:
teamId:
type: string
description: The group this project belongs to.Why:groupIdandteamIddescribe the same organizational grouping but use different names, forcing consumers to learn schema-specific synonyms.Identify concepts that appear across multiple schemas (e.g., group membership, ownership, timestamps).
List all field names used for each concept across the spec.
Flag concepts represented by more than one distinct field name.
Field names must be consistent between the request body, response body, and path parameters for the same concept.
paths:
/users/{userId}:
get:
parameters:
- name: userId
in: path
required: true
schema:
type: string
responses:
"200":
content:
application/json:
schema:
properties:
userId:
type: string
patch:
requestBody:
content:
application/json:
schema:
properties:
userId:
type: stringWhy:userIdappears consistently in the path parameter, response body, and request body.paths:
/users/{userId}:
get:
parameters:
- name: userId
in: path
required: true
schema:
type: string
responses:
"200":
content:
application/json:
schema:
properties:
id:
type: string
patch:
requestBody:
content:
application/json:
schema:
properties:
user_id:
type: stringWhy:The same concept appears as
userIdin the path,idin the response, anduser_idin the request. Consumers must map these manually.For each resource path with path parameters, note the parameter names.
Inspect the request and response schemas for the same operation and verify that the same concept uses the same field name in all locations.
Flag any discrepancy where request body, response body, or path parameter names differ for the same concept.
For enum fields, the allowable values may differ from values allowed in other instances of the same field name across APIs or resources.
Group vs. Project
For historical reasons, some MongoDB APIs used project and projectId where
the concept is more accurately described as a group. New APIs must align on the
group terminology.
For consistency, APIs must use
group,groups, orgroupIdrather thanproject,projects, orprojectId.paths:
/groups/{groupId}/clusters:
get:
parameters:
- name: groupId
in: path
required: true
schema:
type: stringWhy:groupIdis the canonical name for the organizational grouping concept.paths:
/projects/{projectId}/clusters:
get:
parameters:
- name: projectId
in: path
required: true
schema:
type: stringWhy:projectIdis a legacy term. Using it in new APIs diverges from the establishedgroupIdconvention.