All Spectral rules used in the IPA validation are defined in rulesets grouped by IPA number (IPA-XXX.yaml). These rulesets are imported into the main IPA ruleset ipa-spectral.yaml which is used for running the validation.
Below is a list of all available rules, their descriptions and severity levels.
Rules are based on https://mongodb.github.io/ipa/5.
IPA exception extensions must follow the correct format.
Rule checks for the following conditions:
- Exception rule names must start with 'xgen-IPA-' prefix followed by exactly 3 digits
- Exception rule names can be either short format (xgen-IPA-XXX) or full format (xgen-IPA-XXX-rule-name)
- Rule names in full format can use letters (upper/lowercase), numbers, and hyphens
- Each exception must include a non-empty reason as a string that starts with uppercase and ends with a full stop
- This rule itself does not allow exceptions
Rules are based on https://mongodb.github.io/ipa/102.
Collection identifiers must be in camelCase.
Rule checks for the following conditions:
- All path segments that are not path parameters
- Only the resource identifier part before any colon in custom method paths (e.g.,
resourcein/resource:customMethod) - Path parameters should also follow camelCase naming
- Certain values can be exempted via the ignoredValues configuration that can be supplied as
ignoredValuesargument to the rule - Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation - Double slashes (//) are not allowed in paths
- If any parent path has an exception for this rule, the exception will be inherited.
Paths should alternate between resource names and path params.
Rule checks for the following conditions:
- Paths must follow a pattern where resource names and path parameters strictly alternate
- Even-indexed path segments should be resource names (not path parameters)
- Odd-indexed path segments should be path parameters
- A trailing
operationsoroperations/{operationId}suffix is exempt, for the Operations endpoints defined by IPA-132 - Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation - If any parent path has an exception for this rule, the exception will be inherited.
Collection identifiers must begin with a lowercase letter and contain only ASCII letters and numbers.
Rule checks for the following conditions:
- All path segments that are not path parameters must match pattern
/^[a-z][a-zA-Z0-9]*$/ - Path parameters (inside curly braces) are excluded from validation
- Custom methods (segments containing colons) are excluded from validation
- Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation - Each non-parameter path segment must start with a lowercase letter followed by any combination of ASCII letters and numbers
- If any parent path has an exception for this rule, the exception will be inherited.
Rules are based on https://mongodb.github.io/ipa/104.
APIs must provide a Get method for resources.
Rule checks for the following conditions:
- Only applies to resource collection identifiers
- For singleton resources, verifies the resource has a GET method
- For regular resources, verifies there is a single resource path with a GET method
The purpose of the Get method is to return data from a single resource.
Rule checks for the following conditions:
- Applies only to 2xx responses of GET methods on single resources or singleton resources
- Verifies the response is not an array or paginated result
- Different error messages are provided for standard vs singleton resources
The Get method must return a 200 OK response.
Rule checks for the following conditions:
- Applies only to GET methods on single resources or singleton resources
- Verifies the 200 OK response code is present
- Fails if the method lacks a 200 OK response or defines a different 2xx status code
The Get method of a resource should return a "Response" suffixed object.
Rule checks for the following conditions:
- Applies only to 2xx responses of GET methods on single resources or singleton resources
- Verifies the schema references a predefined schema (not inline)
- Confirms the referenced schema name ends with "Response" suffix
The Get method response object must not include writeOnly properties (fields that should be used only on creation or update, ie output fields).
Rule checks for the following conditions:
- Applies only to 2xx responses of GET methods on single resources or singleton resources
- Searches through the schema to find any properties marked with writeOnly attribute
- Fails if any writeOnly properties are found in the response schema
The Get method request must not include a body.
Rule checks for the following conditions:
- Applies only to GET methods on single resources or singleton resources
- Verifies that the operation object does not contain a requestBody property
The Operation ID must start with the verb “get” and should be followed by a noun or compound noun.
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
If the resource is a singleton resource, the last noun may be the plural form of the collection identifier.
For a collection-scoped Operations resource, such as '/resources/operations/{operationId}', the parent noun (e.g. 'resources') stays in its plural form instead of being singularized.
Rule checks for the following conditions:
- Applies only to GET methods on single resources or singleton resources
- Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId
This rule includes three configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID override (default: 4)
The Operation ID should not be longer than 4 words. If the generated operation ID exceeds 4 words,
add an 'x-xgen-operation-id-override' extension with a shorter operation ID.
Rule checks for the following conditions:
- Applies only to GET methods on single resources or singleton resources
- Verifies that the operation ID is not longer than 4 words
- If the operation ID is longer than 4 words, requires an 'x-xgen-operation-id-override' extension
- Can be exempted using 'x-xgen-IPA-exception' for APIs where long operation IDs are intentional
This rule includes three configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID (default: 4)
Rules are based on https://mongodb.github.io/ipa/105.
The List method must return a 200 OK response.
Rule checks for the following conditions:
- Applies only to GET methods on resource collection paths
- Ignores singleton resources
- Verifies the 200 OK response code is present
- Fails if the method lacks a 200 OK response or defines a different 2xx status code
The List method request must not include a body.
Rule checks for the following conditions:
- Applies only to GET methods on resource collection paths
- Ignores singleton resources
- Verifies that the operation object does not contain a requestBody property
APIs must provide a List method for resources.
Rule checks for the following conditions:
- Applies only to resource collection paths
- Ignores singleton resources
- Verifies the resource path has a GET method
- Fails if the resource path does not have a GET method
The response body of the List method should consist of the same resource object returned by the Get method.
- Applies only to resource collection paths with JSON content types
- Ignores singleton resources
- Ignores responses without a schema or non-paginated responses
- A response is considered paginated if it has a schema with a 'results' array property
- Verifies that the schema of items in the 'results' array matches the schema used in the Get method response
- Fails if the Get method doesn't have a schema reference or if the schemas don't match
- Validation ignores resources without a Get method
- Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The Operation ID must start with the verb “list” and should be followed by a noun or compound noun.
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form, where the last noun is in plural form.
For a collection-scoped Operations resource, such as '/resources/operations', the parent noun (e.g. 'resources') stays in its plural form instead of being singularized.
Rule checks for the following conditions:
- Applies only to GET methods on resource collection paths
- Ignores singleton resources
- Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId
This rule includes three configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID override (default: 4)
The Operation ID should not be longer than 4 words. If the generated operation ID exceeds 4 words,
add an 'x-xgen-operation-id-override' extension with a shorter operation ID.
Rule checks for the following conditions:
- Applies only to GET methods on resource collection paths
- Ignores singleton resources
- Verifies that the operation ID is not longer than 4 words
- If the operation ID is longer than 4 words, requires an 'x-xgen-operation-id-override' extension
- Can be exempted using 'x-xgen-IPA-exception' for APIs where long operation IDs are intentional
This rule includes three configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID (default: 4)
Rules are based on https://mongodb.github.io/ipa/106.
The Create method request should be a Request suffixed object.
Rule checks for the following conditions:
- Applies only to POST methods on resource collection paths (non-singleton resources)
- Applies only to JSON content types
- Verifies the schema references a predefined schema (not inline)
- Confirms the referenced schema name ends with "Request" suffix
Create operations should not use query parameters.
Rule checks for the following conditions:
- Applies only to POST methods on resource collection paths (non-singleton resources)
- Verifies the operation does not contain query parameters
- Ignores specified parameters like 'pretty' and 'envelope' via configuration
Request body content of the Create method and response content of the Get method should refer to the same resource.
Validation checks the POST method for resource collection paths.
- Validation ignores resources without a Get method.
readOnly:trueproperties of Get method response will be ignored.writeOnly:trueproperties of Create method request will be ignored.- Property comparison is based on
typeandnamematching. oneOfanddiscriminatordefinitions must match exactly.
Create method Request object must not include fields with readOnly:true.
Rule checks for the following conditions:
- Applies only to POST methods on resource collection paths (non-singleton resources)
- Applies only to JSON content types
- Searches through the request schema to find any properties marked with readOnly attribute
- Fails if any readOnly properties are found in the request schema
Create methods must return a 201 Created response code.
Rule checks for the following conditions:
- Applies only to POST methods on resource collection paths (non-singleton resources)
- Verifies the 201 Created response code is present
- Fails if the method lacks a 201 Created response or defines a different 2xx status code
The response body of the Create method should consist of the same resource object returned by the Get method.
Rule checks for the following conditions:
- Applies only to POST methods on resource collection paths
- Applies only to JSON response content types
- Verifies that both Create and Get methods have schema references
- Confirms that the Create method 201 response schema reference matches the Get method response schema reference
- Ignores resources without a Get method
- Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Read-only resources must not define the Create method.
Rule checks for the following conditions:
- Applies to POST methods on resource collection paths
- Checks if the resource is a read-only resource (all properties in GET response have readOnly:true)
- If a resource does not have a standard GET method, it is not considered read-only (cannot determine the resource schema)
- Fails if a Create method is defined on a read-only resource
- Operation objects with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The Operation ID must start with the verb “create” and should be followed by a noun or compound noun.
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
Rule checks for the following conditions:
- Applies only to POST methods that are not custom methods
- Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId
This rule includes two configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")
The Operation ID should not be longer than 4 words. If the generated operation ID exceeds 4 words,
add an 'x-xgen-operation-id-override' extension with a shorter operation ID.
Rule checks for the following conditions:
- Applies only to POST methods that are not custom methods
- Verifies that the operation ID is not longer than 4 words
- If the operation ID is longer than 4 words, requires an 'x-xgen-operation-id-override' extension
- Can be exempted using 'x-xgen-IPA-exception' for APIs where long operation IDs are intentional
This rule includes three configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID (default: 4)
Rules are based on https://mongodb.github.io/ipa/107.
Update operations must not accept query parameters.
Validation checks the PATCH/PUT methods for single resource paths and singleton resources.
- Query parameters
envelopeandprettyare exempt from this rule - Operation objects with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The Update method response status code should be 200 OK.
Validation checks the PATCH/PUT methods for single resource paths and singleton resources.
- Operation objects with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The response body of the Update method should consist of the same resource object returned by the Get method.
- Applies only to single resource paths and singleton resources with JSON content types
- Ignores singleton resources and responses without a schema
- Validation ignores resources without a Get method
- Fails if the Get method doesn't have a schema reference or if the schemas don't match
- Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Update method Request object must not include fields with readOnly:true.
Rule checks for the following conditions:
- Applies only to Update methods on single resource paths or singleton resources
- Applies only to JSON content types
- Searches through the request schema to find any properties marked with readOnly attribute
- Fails if any readOnly properties are found in the request schema
The request body must contain the resource being updated, i.e. the resource or parts of the resource returned by the Get method.
Validation checks the PATCH/PUT methods for single resource paths and singleton resources.
- Validation ignores resources without a Get method.
readOnly:trueproperties of Get method response will be ignored.writeOnly:trueproperties of Update method request will be ignored.- Property comparison is based on
typeandnamematching. oneOfanddiscriminatordefinitions must match exactly.
The Update method request schema should reference an
UpdateRequest suffixed object.
Rule checks for the following conditions:
- Applies to PUT/PATCH methods on single resource paths and singleton resources
- Applies only to JSON content types
- Validation only applies to schema references to a predefined schema (not inline)
- Confirms the referenced schema name ends with "Request" suffix
Read-only resources must not define the Update method.
Rule checks for the following conditions:
- Applies to PUT/PATCH methods on all resource paths
- Checks if the resource is a read-only resource (all properties in GET response have readOnly:true)
- If a resource does not have a standard GET method, it is not considered read-only (cannot determine the resource schema)
- Fails if an Update method is defined on a read-only resource
- Operation objects with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The Operation ID must start with the verb “update” and should be followed by a noun or compound noun.
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
If the resource is a singleton resource, the last noun may be the plural form of the collection identifier.
Rule checks for the following conditions:
- Applies only to PUT/PATCH methods that are not custom methods
- Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId
This rule includes two configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")
The Operation ID should not be longer than 4 words. If the generated operation ID exceeds 4 words,
add an 'x-xgen-operation-id-override' extension with a shorter operation ID.
Rule checks for the following conditions:
- Applies only to PUT/PATCH methods that are not custom methods
- Verifies that the operation ID is not longer than 4 words
- If the operation ID is longer than 4 words, requires an 'x-xgen-operation-id-override' extension
- Can be exempted using 'x-xgen-IPA-exception' for APIs where long operation IDs are intentional
This rule includes three configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID (default: 4)
Rules are based on https://mongodb.github.io/ipa/108.
Delete method response should not have schema reference to object.
Rule checks for the following conditions:
- Applies to 204 responses in DELETE methods for single resource endpoints (with path parameters)
- Verifies that the response does not contain a schema property
- Fails if any content type in the response has a defined schema as reference
- Skips validation for collection endpoints (without path parameters)
DELETE method must return 204 No Content.
Rule checks for the following conditions:
- Applies to all DELETE methods for single resource endpoints (with path parameters)
- Verifies the 204 No Content response code is present
- Fails if the method lacks a 204 No Content response or defines a different 2xx status code
- Ensures no other 2xx response codes are defined
- Fails if the 204 status code is missing or if other 2xx responses exist
- Skips validation for collection endpoints (without path parameters)
DELETE method must not have request body.
Rule checks for the following conditions:
- Applies to all DELETE methods for single resource endpoints (with path parameters)
- Verifies that the operation object does not contain a requestBody property
- Fails if any requestBody is defined for the DELETE method
- Skips validation for collection endpoints (without path parameters)
Read-only resources must not define the Delete method.
Rule checks for the following conditions:
- Applies to DELETE methods on single resource paths and singleton resources
- Checks if the resource is a read-only resource (all properties in GET response have readOnly:true)
- If a resource does not have a standard GET method, it is not considered read-only (cannot determine the resource schema)
- Fails if a Delete method is defined on a read-only resource
- Operation objects with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The Operation ID must start with the verb “delete” and should be followed by a noun or compound noun.
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
Rule checks for the following conditions:
- Applies only to DELETE methods that are not custom methods
- Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId
This rule includes two configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")
The Operation ID should not be longer than 4 words. If the generated operation ID exceeds 4 words,
add an 'x-xgen-operation-id-override' extension with a shorter operation ID.
Rule checks for the following conditions:
- Applies only to DELETE methods that are not custom methods
- Verifies that the operation ID is not longer than 4 words
- If the operation ID is longer than 4 words, requires an 'x-xgen-operation-id-override' extension
- Can be exempted using 'x-xgen-IPA-exception' for APIs where long operation IDs are intentional
This rule includes three configuration options:
methodName: The verb to be used in the OperationIdsignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID (default: 4)
Rules are based on https://mongodb.github.io/ipa/109.
The HTTP method for custom methods must be GET or POST.
Rule checks for the following conditions:
- Applies only to paths containing custom method identifiers (with colon format)
- Verifies the HTTP methods used are either GET or POST
- Fails if any other HTTP methods are used (PUT, DELETE, PATCH, etc.)
- Fails if multiple valid methods are defined for the same custom method endpoint
The custom method must use camelCase format.
Rule checks for the following conditions:
- Applies only to paths containing custom method identifiers (with colon format)
- Extracts the method name portion following the colon
- Verifies the method name is not empty or blank
- Validates that the method name uses proper camelCase formatting
- Fails if the method name contains invalid casing (such as snake_case, PascalCase, etc.)
Custom methods must be defined using a colon followed by the method name.
Rule checks for the following conditions:
- Identifies paths containing a colon (potential custom methods)
- Validates that the path follows proper custom method format
- Does not validate after the colon (xgen-IPA-109-custom-method-must-use-camel-case rule validates the method name)
- Fails if a slash appears before a colon
- Fails if multiple colons appear in the path
- Fails if other than an alphabetical character or a closing curly brace appears before a colon
The Operation ID must start with the custom method verb (the custom method path section delimited by the colon (:) character) and should be followed by a noun or compound noun.
If the custom Operation ID has a verb + noun, the Operation ID should end with the noun.
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier.
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form, where the last noun:
- Is in plural form if the method applies to a collection of resources
- Is in singular form if the method applies to a single resource
Rule checks for the following conditions:
- Applies only to paths containing custom method identifiers (with colon format)
- Confirms that the existing OperationId is compliant with generated IPA Compliant OperationId
This rule includes one configuration options:
ignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")
The Operation ID should not be longer than 4 words. If the generated operation ID exceeds 4 words,
add an 'x-xgen-operation-id-override' extension with a shorter operation ID.
Rule checks for the following conditions:
- Applies only to paths containing custom method identifiers (with colon format)
- Verifies that the operation ID is not longer than 4 words
- If the operation ID is longer than 4 words, requires an 'x-xgen-operation-id-override' extension
- Can be exempted using 'x-xgen-IPA-exception' for APIs where long operation IDs are intentional
This rule includes two configuration options:
ignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")maxLength: The maximum number of words allowed in the operation ID (default: 4)
Rules are based on https://mongodb.github.io/ipa/110.
APIs that return collections of resources must use a schema with the "Paginated" prefix.
Rule checks for the following conditions:
- Only applies to List methods (GET operations that return collections of resources)
- Checks if List method has a response schema defined
- Checks that the 200 response schema references a schema with a "Paginated" prefix
The response for collections must define an array of results containing the paginated resource.
Rule checks for the following conditions:
- Only applies to List methods (GET operations that return collections of resources)
- Verifies the 200 response schema has the required results fields
The request should support an integer itemsPerPage query parameter allowing users to specify the maximum number of results to return per page.
itemsPerPage must not be required
itemsPerPage default value should be 100.
Rule checks for the following conditions:
- Only applies to List methods (GET on resource collection paths)
- Verifies the operation includes itemsPerPage query parameter
- Verifies the itemsPerPage query parameter is not required
- Verifies the itemsPerPage query parameter has a default value of 100
The request should support an integer pageNum query parameter allowing users to specify the maximum number of results to return per page.
pageNum must not be required
pageNum default value should be 1.
Rule checks for the following conditions:
- Only applies to List methods (GET on resource collection paths)
- Verifies the operation includes pageNum query parameter
- Verifies the pageNum query parameter is not required
- Verifies the pageNum query parameter has a default value of 1
If the request supports an includeCount query parameter, it must not be required.
Rule checks for the following conditions:
- Only applies to List methods (GET on resource collection paths)
- Checks if includeCount query parameter exists
- If it exists, verifies the includeCount parameter is not required
The response for collections should define a links array field, providing links to next and previous pages.
Rule checks for the following conditions:
- Only applies to List methods (GET operations that return collections of resources)
- Verifies the response schema includes a links field of type array
Rules are based on https://mongodb.github.io/ipa/111.
Optional fields must not define a default value.
Rule checks for the following conditions:
- Applies to optional (non-required) schema properties in request bodies only
- Boolean fields are exempt (covered by xgen-IPA-111-optional-boolean-fields-default-false)
- Fields marked with the x-xgen-server-computed-when-client-omitted extension are exempt
- Fails if the field defines a default value
Effective-value fields must be marked as readOnly: true and must not appear in request schemas.
Rule checks for the following conditions:
- Applies to schema properties whose name starts with the "effective" prefix
- Fails if the field appears in a request schema
- Fails if the field is not marked with readOnly: true
Optional boolean fields must default to false.
Rule checks for the following conditions:
- Applies to optional (non-required) boolean schema properties in request bodies only
- Fails if the field does not define a default value of false
Rules are based on https://mongodb.github.io/ipa/112.
Schema field names should avoid using "project", "projects", or "projectId".
Rule checks for the following conditions:
- Searches through all schemas in the API definition
- Identifies property names that match "project" (case-insensitive)
- Ignores fields where prohibited words appear with specified words (e.g., "gcpProjectId")
- Reports any instances where these field names are used
- Suggests using "group", "groups", or "groupId" as alternatives
Schema field names should be in camelCase format.
Rule checks for the following conditions:
- Searches through all schemas in the API definition
- Identifies property names that are not in camelCase format
- Reports any instances where these field names are not in camelCase format
Boolean field names should avoid the "is" prefix.
Rule checks for the following conditions:
- Applies only to properties with type 'boolean'
- Identifies property names that start with "is" followed by an uppercase letter
- Suggests using the direct adjective form instead (e.g., "disabled" instead of "isDisabled")
Rules are based on https://mongodb.github.io/ipa/113.
Singleton resources must not have a user-provided or system-generated ID.
Rule checks for the following conditions:
- Applies only to singleton resources that are identified as resource collection identifiers
- Checks that the resource has a GET method defined
- Examines all 2xx response schemas from the GET method
- Verifies that no schema contains 'id' or '_id' properties in their object definitions
- Fails if any response schema contains these identifier properties
Singleton resources must not define the Delete standard method.
Rule checks for the following conditions:
- Applies only to singleton resources
- Checks that the resource does not have a DELETE method defined
Singleton resources should define the Update method. Validation for the presence of Get method is covered by IPA-104 (see xgen-IPA-104-resource-has-GET).
Rule checks for the following conditions:
- Applies only to singleton resources
- Excludes read-only singleton resources (where all properties in the GET response schema are marked as readOnly; for List responses, all properties in the items schema must be readOnly)
- Checks that the resource has the PUT and/or PATCH methods defined
The :reset custom method must use the POST HTTP method.
Rule checks for the following conditions:
- Applies only to paths ending with :reset
- Verifies that only POST method is defined
- Fails if GET or any other HTTP method is used
- Fails if multiple HTTP methods are defined for the same :reset endpoint
The :reset custom method must not have a request body.
Rule checks for the following conditions:
- Applies only to POST methods on paths ending with :reset
- Verifies that the operation object does not contain a requestBody property
- Fails if any request body is defined
The :reset custom method must return a 200 OK response with the reset resource in the response body.
Rule checks for the following conditions:
- Applies only to POST methods on paths ending with :reset
- Verifies that a 200 OK response code is present
- Fails if the method lacks a 200 OK response or defines a different 2xx status code
- Verifies that the 200 response has a response body with schema
The :reset custom method response must match the GET method response schema.
Rule checks for the following conditions:
- Applies only to POST methods on paths ending with :reset
- Applies only to JSON response content types
- Verifies that both :reset and GET methods have schema references
- Confirms that the :reset method 200 response schema reference matches the GET method response schema reference
- Ensures the reset resource returned is the same type as the singleton resource
The :reset custom method must only be defined on singleton resources.
Rule checks for the following conditions:
- Applies only to paths ending with :reset
- Verifies that the parent path (without :reset) is a singleton resource
- Uses existing isSingletonResource() helper function
- Fails if :reset is defined on a non-singleton resource
Read-only singleton resources must not define a :reset custom method.
Rule checks for the following conditions:
- Applies only to paths ending with :reset
- Verifies that the parent singleton resource is not read-only
- Uses existing isReadOnlyResource() helper function
- Fails if the singleton resource has all properties marked as readOnly: true
The :reset custom method must have a valid operation ID.
Rule checks for the following conditions:
- Applies only to POST methods on paths ending with :reset
- Confirms that the operation ID follows the pattern: reset{ResourceName}
- Uses existing operation ID validation infrastructure
This rule includes a configuration option:
ignoreSingularizationList: Words that are allowed to maintain their assumed plurality (e.g., "Fts")
Rules are based on https://mongodb.github.io/ipa/114.
APIs must return ApiError when errors occur
This rule checks that all 4xx and 5xx error responses reference the ApiError schema.
ApiError schema should have badRequestDetail field with proper structure.
Rule checks that:
- ApiError schema has badRequestDetail field
- badRequestDetail must include an array of fields
- Each field must include description and field properties
- This rule does not allow exceptions
Authenticated endpoints must define 401 and 403 responses.
This rule checks that all authenticated endpoints (those without explicit 'security: []' and not containing '/unauth' in the path) include 401 and 403 responses.
Paths with parameters must define 404 responses.
This rule checks that all endpoints with path parameters (identified by '{param}' in the path) include a 404 response to handle the case when the requested resource is not found.
Rules are based on https://mongodb.github.io/ipa/117.
API producers must provide descriptions for Properties, Operations and Parameters.
Rule checks for description property in the following components:
- Info object
- Tags
- Operation objects
- Inline schema properties for operation object requests and responses
- Parameter objects (in operations and components)
- Schema properties The rule also fails if the description is an empty string.
Descriptions must start with Uppercase.
Rule checks the format of the description property in the following components:
- Info object
- Tags
- Operation objects
- Inline schema properties for operation object requests and responses
- Parameter objects (in operations and components)
- Schema properties
- Schemas
Descriptions must end with a full stop(.).
Rule checks the format of the description property in the following components:
- Info object
- Tags
- Operation objects
- Inline schema properties for operation object requests and responses
- Parameter objects (in operations and components)
- Schema properties
- Schemas
The rule ignores descriptions that end with
|, i.e. inline markdown tables
Descriptions must not use raw HTML.
Rule checks the format of the descriptions for components:
- Info object
- Tags
- Operation objects
- Inline schema properties for operation object requests and responses
- Parameter objects (in operations and components)
- Schema properties
- Schemas The rule validates that the description content does not include opening and/or closing HTML tags.
Descriptions should not include inline tables as this may not work well with all tools, in particular generated client code.
Rule checks the format of the descriptions for components:
- Info object
- Tags
- Operation objects
- Inline schema properties for operation object requests and responses
- Parameter objects (in operations and components)
- Schema properties
- Schemas The rule validates that the description content does not include inline markdown tables.
Descriptions should not include inline links.
Rule checks the format of the descriptions for components:
- Tags
- Operation objects
- Inline schema properties for operation object requests and responses
- Parameter objects (in operations and components)
- Schema properties
- Schemas
The rule validates that the description content does not include inline markdown links. The rule ignores HTML
<a>links - this is covered byxgen-IPA-117-description-must-not-use-html.
For APIs that respond with plain text, for example CSV, API producers must provide an example. Some tools are not able to generate examples for such responses
- The rule only applies to 2xx responses
- The rule ignores JSON and YAML responses (passed as
allowedTypes) - The rule ignores responses with
format: 'binary'(i.e. file types) - The rule checks for the presence of the example property as a sibling to the
schemaproperty, or inside theschemaobject
Components of type "object" must be well-defined, i.e. have of one of the properties:
schemaexamplesexampleoneOf,anyOforallOfpropertiesadditionalProperties
The rule applies to the following components:
- Inline operation responses/request bodies (JSON only)
- Inline operation response/request body properties (JSON only)
- Inline operation response/request body array items (JSON only)
- Schemas defined in
components/schemas - Schema properties defined in
components/schemas itemsproperties defined incomponents/schemasThe rule is applied to the unresolved OAS, and ignores components with$refproperties. Specific paths can be ignored using theignoredPathsoption.
Request and response bodies must be well-defined, i.e. include a schema to ensure that consumers understand the expected format of the request/response.
The rule applies to the following components:
- Operation request bodies
- Operation responses, except for:
- 202 Accepted responses
- DELETE method 2xx responses
- Custom method 2xx POST responses
These components must be described, i.e. has the schema property:
API producers must provide a well-defined schema or example(s) for parameters.
The rule checks for the presence of the schema, examples or example property in:
- Operation parameters
- Parameters defined in
components/parameters
Operation summaries must use Title Case, must not end with a period and must not use CommonMark.
The rule checks that the summary property of all operations are in Title Case.
This rule includes two configuration options:
ignoreList: Words that are allowed to maintain their specific casing (e.g., "API", "AWS", "DNS")grammaticalWords: Common words that can remain lowercase in titles (e.g., "and", "or", "the")
In operation summaries, use 'Return' instead of 'Get' or 'List'. For example "Return One Identity Provider".
- The rule checks that the
summaryproperty of get and list operations use the word 'Return' as the first word. - The rule only applies to get and list methods and ignores custom methods
This rule includes a configuration option:
allowedStartVerbs: Allow list of verb that the operation summary can start with, defaults to['Return']
In operation summaries, use 'Update' instead of 'Modify' or 'Change'. For example "Update One Identity Provider".
- The rule checks that the
summaryproperty of update operations use the word 'Update' as the first word. - The rule only applies to update methods and ignores custom methods
This rule includes a configuration option:
allowedStartVerbs: Allow list of verb that the operation summary can start with, defaults to['Update']
In operation summaries, use 'Create' when the operation is creating a resource, and use 'Add' when the resource itself isn't being created. For example "Create One Identity Provider" or "Add One MongoDB Cloud User to One Project".
- The rule checks that the
summaryproperty of create operations use the word 'Create' or 'Add' as the first word. - The rule only applies to create methods and ignores custom methods
This rule includes a configuration option:
allowedStartVerbs: Allow list of verb that the operation summary can start with, defaults to['Create', 'Add']
In operation summaries, use 'Delete' when the operation is destroying a resource, and use 'Remove' when the resource itself isn't being destroyed. For example "Delete One Identity Provider" or "Remove One MongoDB Cloud User from One Project".
- The rule checks that the
summaryproperty of delete operations use the word 'Delete' or 'Remove' as the first word. - The rule only applies to delete methods and ignores custom methods
This rule includes a configuration option:
allowedStartVerbs: Allow list of verb that the operation summary can start with, defaults to['Delete', 'Remove']
API Producers must use "One" when referring to a single item instead of "a" or "specified".
- The rule checks that the
summaryproperty of operations does not use the words "a", "specified" or "provided" - This rule applies to all operations, including custom methods
This rule includes a configuration option:
preferredWords: List of words that the operation summary should use for single items, defaults to['one']. Only used for error messagesforbiddenWords: List of words (lowercase) that the operation summary should not use, defaults to['a', 'specified']
Rules are based on https://mongodb.github.io/ipa/118.
Schemas must not use
additionalProperties: false
This rule checks that schemas don't restrict additional properties by setting additionalProperties: false.
Schemas without explicit additionalProperties settings (which default to true) or with additionalProperties set to true are compliant.
This rule checks all nested schemas, but only parent schemas can be marked for exception.
Rules are based on https://mongodb.github.io/ipa/119.
When using a provider field or parameter, API producers should not define a default value.
This rule checks fields and parameters named "cloudProvider" and ensures they do not have a default value.
It also checks enum fields that might contain cloud provider values.
All cloudProviderEnumValues should be listed in the enum array.
Rules are based on https://mongodb.github.io/ipa/121.
Fields with format="date-time" should mention ISO 8601 and UTC in their description.
It collects adoption metrics at schema property level and parameter level
Rules are based on https://mongodb.github.io/ipa/123.
Enum values must be UPPER_SNAKE_CASE.
Rule checks for the following conditions:
- Applies to all enum value arrays defined in the OpenAPI schema
- Resolves the schema object that contains the enum values
- Validates each enum value individually against the UPPER_SNAKE_CASE pattern
- Skips validation if the schema has an exception defined for this rule
Allowable enum values should not exceed 20 entries.
Rule checks for the following conditions:
- Validates that each enum set has 20 or fewer values
- Skips validation if the schema has an exception defined for this rule
- This validation threshold can be adjusted by changing the functionOptions.maxEnumValues parameter
Rules are based on https://mongodb.github.io/ipa/124.
Array fields must have a
maxItems property defined to enforce an upper bound on the number of items (recommended max: 100). If the array field has the chance of being too large, the API should use a sub-resource instead.
Rule checks for the following conditions:
- All schema objects with type 'array' must have a
maxItemsproperty - The
maxItemsvalue must be lower than or equal to 100
- maxAllowedValue: Required integer parameter specifying the maximum allowed value for the `maxItems` property (100)
- ignore: Required array parameter listing property names to be exempted from validation
Rules are based on https://mongodb.github.io/ipa/125.
Each oneOf property must include a discriminator property to define the exact type.
Rule checks for the following conditions:
- Applies only to schemas with
oneOfcontaining references - Ensures a
discriminatorproperty is present with a validpropertyName - Validates that
discriminator.mappingcontains exactly the same number of entries asoneOfreferences - Validates that each
discriminator.mappingvalue matches a reference in theoneOfarray - Ignores
oneOfdefinitions with inline schemas
- The
discriminator.mappingmust have the same number of entries as there are references in theoneOfarray - Each value in the
discriminator.mappingmust match one of the$refvalues in theoneOfarray - Each
$refin theoneOfarray must have a corresponding entry in thediscriminator.mapping - Example:
This is valid because there are exactly 2 mappings for 2 oneOf references, and all values match.
oneOf: - $ref: '#/components/schemas/Dog' - $ref: '#/components/schemas/Cat' discriminator: propertyName: type mapping: dog: '#/components/schemas/Dog' cat: '#/components/schemas/Cat'
API producers should not use oneOf with different base types like integer, string, boolean, or number or references at the same time.
Rule checks for the following conditions:
- Applies to schemas with
oneOfarrays - Ensures no mixing of base types with references
- Ensures no multiple different base types in the same oneOf
- Base types considered are: integer, string, boolean, number
- Using the same base type multiple times is allowed (e.g., multiple string enums)
Using oneOf with multiple primitive types can lead to ambiguity and validation problems. Clients may not be able to properly determine which type to use in which context. Instead, use more specific object types with clear discriminators.
If multiple
oneOf models define a property with the same name, that property must have the same base type or schema in each model
Rule checks for the following conditions:
- Applies only to object type schemas with
oneOf - Ensures that if a property is defined in multiple
oneOfschemas, it must have the same type in each schema (base type or object schema)
Each discriminator property must be accompanied by a
oneOf, anyOf or allOf property
- Rule checks that a
discriminatorproperty has aoneOf,anyOforallOfsibling
Rules are based on https://mongodb.github.io/ipa/126.
Tag names in the OpenAPI specification should use Title Case.
Rule checks for the following conditions:
- All tag names defined in the OpenAPI tags object should use Title Case
- Title Case means each word starts with an uppercase letter, and the rest are lowercase
- Certain abbreviations (like "API", "AWS", etc.) in the ignoreList are allowed to maintain their casing
- Grammatical words (like "and", "or", "the", etc.) are allowed to be all lowercase
This rule includes two configuration options:
ignoreList: Words that are allowed to maintain their specific casing (e.g., "API", "AWS", "DNS")grammaticalWords: Common words that can remain lowercase in titles (e.g., "and", "or", "the")
Rules are based on https://mongodb.github.io/ipa/132.
Operations endpoints must not be defined as standalone, global endpoints with no parent
resource in their path.
Rule checks for the following conditions:
- Applies to Operations endpoints, i.e. paths ending with an
operationssegment or anoperations/{operationId}suffix - The
operationssegment must be preceded by at least one parent resource segment - A root-level Operations endpoint, such as
/api/atlas/v2/operationsor/api/atlas/v2/unauth/operations, is a violation - Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Operations endpoints are read-only. They may only define the get method, and all properties
of the Operation resource must be readOnly.
Rule checks for the following conditions:
- Applies to Operations endpoints, i.e. paths ending with an
operationssegment or anoperations/{operationId}suffix - The path item must not define any HTTP method other than
get - On the single Operation endpoint (
.../operations/{operationId}), where the Get method is defined, all properties of every 2xx response schema of thegetmethod must be marked asreadOnly: true - Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Operations endpoints must be leaf resources, with no resources nested below them.
Rule checks for the following conditions:
- Applies to paths containing an
operationssegment - An
operationssegment may only be followed by a single operation identifier path parameter, e.g..../operationsand.../operations/{operationId}are valid - Any further nesting, such as
.../operations/subresourceor.../operations/{operationId}/subresource, is a violation - Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Operation endpoints must return the OperationResponse schema to report long-running
operation status.
Rule checks for the following conditions:
- Applies to 2xx responses of GET methods on Operations endpoints; the response content
is defined inline,
components.responsesis reserved for error responses - Every 2xx response must define at least one JSON media type carrying a schema
- The single Operation endpoint (
.../operations/{operationId}) must reference theOperationResponseschema - The Operations collection endpoint (
.../operations) must reference a paginated wrapper schema that defines theresultsarray directly; inline andallOf-composed wrappers are rejected, consistent withxgen-IPA-110-collections-use-paginated-prefixandxgen-IPA-110-collections-response-define-results-array - Inline Operation schemas are violations, the response must reference the predefined
OperationResponseschema - Responses with
x-xgen-IPA-exceptionfor this rule at the response level are excluded from validation
The OperationResponse schema must define its properties directly. There is one and only one
OperationResponse, so allOf, oneOf and anyOf composition is a violation.
Rule checks for the following conditions:
- Applies to the OperationResponse component schema
- The schema must not use allOf, oneOf or anyOf composition
- The other OperationResponse schema rules skip composed schemas, relying on this rule to reject them
- Schemas with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The OperationResponse schema must define every field the IPA-132 standard marks as always
required: operationId, status, operationType, createdAt, updatedAt and expiresAt.
Rule checks for the following conditions:
- Applies to the OperationResponse component schema
- Each field listed in the rule's functionOptions must be defined and listed as required
- Composed schemas are skipped: composition is rejected by the must-not-use-composition rule
- For expiresAt, only the field declaration is validated; the retention behavior and the 404 after expiry are backend-defined
- Schemas with
x-xgen-IPA-exceptionfor this rule are excluded from validation
The OperationResponse schema must define every field the IPA-132 standard marks as
conditionally present, and none of them may be listed as required: customMethod, error,
resultHref and retryAfterSeconds are present only under runtime conditions.
Rule checks for the following conditions:
- Applies to the OperationResponse component schema
- Each field listed in the rule's functionOptions must be defined and must not be listed as required: the condition under which it is present is a runtime state that cannot be validated statically
- Composed schemas are skipped: composition is rejected by the must-not-use-composition rule
- Schemas with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Every enum field of the OperationResponse schema must use exactly the standard enum values
defined by IPA-132: the status lifecycle enum, the operationType enum and the retryStrategy
enum of the error object.
Rule checks for the following conditions:
- Applies to the OperationResponse component schema
- Each enum field listed in the rule's functionOptions must use exactly the listed values, in any order
- Fields that are not defined are skipped: top-level field presence is validated by the required-fields and optional-fields rules
- Composed schemas are skipped: composition is rejected by the must-not-use-composition rule
- Schemas with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Every nested object field of the OperationResponse schema must define the properties the
IPA-132 standard requires of it: the error object must define code, message and retryable.
Rule checks for the following conditions:
- Applies to the OperationResponse component schema
- Each nested object field listed in the rule's functionOptions must define the listed properties
- Fields that are not defined are skipped: their presence is validated by the optional-fields rule
- Composed schemas are skipped: composition is rejected by the must-not-use-composition rule
- Schemas with
x-xgen-IPA-exceptionfor this rule are excluded from validation
An Operation should expose statusMessage, progress, and estimatedCompletionTime so clients
can reason about in-flight work.
Rule checks for the following conditions:
- Applies to the OperationResponse component schema
- The schema should define the fields listed in the rule's functionOptions:
statusMessage,progressandestimatedCompletionTime - The progress object should define
completed,totalandunitproperties - Kept separate from the must-level rules because it enforces should-level guidance
- Composed schemas are skipped: composition is rejected by the must-not-use-composition rule
- Schemas with
x-xgen-IPA-exceptionfor this rule are excluded from validation
A Get method must not be a long-running operation. A Get returns the current state of a
single resource that already resides on the server.
Rule checks for the following conditions:
- Applies to GET methods on single resources and singleton resources
- The Get method must not declare a 202 response; a Get reads state that already exists on the server, so there is no background work to track
- Operations with
x-xgen-IPA-exceptionfor this rule are excluded from validation
A List method must not be a long-running operation. A List returns data from a collection
that already exists on the server.
Rule checks for the following conditions:
- Applies to GET methods on resource collections
- The List method must not declare a 202 response; a List returns existing collection data, so the response is returned within the request cycle
- Operations with
x-xgen-IPA-exceptionfor this rule are excluded from validation
Operations endpoints must not define custom methods. Control actions require mutating
methods, which the read-only Operations resource does not allow.
Rule checks for the following conditions:
- Applies to custom method paths (
:customMethod) whose resource identifier, the part before the colon, is an Operations endpoint, i.e. ends with anoperationssegment or anoperations/{operationId}suffix - Any custom method attached to the Operations collection or to a single Operation is a violation
- Paths with
x-xgen-IPA-exceptionfor this rule are excluded from validation
A method that starts a long-running operation must return 202 Accepted with a Location
header pointing at the Operation resource URI that clients poll for status.
Rule checks for the following conditions:
- Applies to mutating methods that declare a 202 response; the
x-xgen-long-running-operationextension is derived from the 202 during the merge step, so the rule behaves identically on merged and per-service specs - Legacy operations that predate IPA-132 are excluded from validation, whether marked
legacy: trueduring the merge step or matched by the shared legacy operationId list - The 202 response must declare a
Locationheader, named with that exact casing for consistency across the spec - Operations with
x-xgen-IPA-exceptionfor this rule are excluded from validation
A method that starts a long-running operation must not return anything other than 202
Accepted as a success status code.
Rule checks for the following conditions:
- Applies to mutating methods that declare a 202 response; the
x-xgen-long-running-operationextension is derived from the 202 during the merge step, so the rule behaves identically on merged and per-service specs - Legacy operations that predate IPA-132 are excluded from validation, whether marked
legacy: trueduring the merge step or matched by the shared legacy operationId list - The operation must not declare any 2xx response other than 202, including wildcard
response codes such as
2XX - Operations with
x-xgen-IPA-exceptionfor this rule are excluded from validation
A long-running operation must not return a body with 202 Accepted. The operation handle is
conveyed through the Location header.
Rule checks for the following conditions:
- Applies to mutating methods that declare a 202 response; the
x-xgen-long-running-operationextension is derived from the 202 during the merge step, so the rule behaves identically on merged and per-service specs - Legacy operations that predate IPA-132 are excluded from validation, whether marked
legacy: trueduring the merge step or matched by the shared legacy operationId list - No media type of the 202 response may declare a schema
- Media types carrying only versioning metadata, such as
x-xgen-version, without a schema, are allowed - Operations with
x-xgen-IPA-exceptionfor this rule are excluded from validation
A long-running operation must expose an Operations endpoint through which clients poll the
operation status.
Rule checks for the following conditions:
- Applies to mutating methods that declare a 202 response; the
x-xgen-long-running-operationextension is derived from the 202 during the merge step, so the rule behaves identically on merged and per-service specs - Legacy operations that predate IPA-132 are excluded from validation, whether marked
legacy: trueduring the merge step or matched by the shared legacy operationId list - Both the Operations collection (
.../operations) and the single Operation endpoint (.../operations/{operationId}) must be defined, nested under the resource path of the long-running operation - Each endpoint must define the
getmethod, i.e. List on the Operations collection and Get on the single Operation; the Operations resource is read-only, sogetis the only method through which clients can poll status - A mutation of a collection must expose the endpoints under the collection path
(
/resource/operations), and a mutation of a single resource under the resource instance path (/resource/{resourceId}/operations) - Custom method suffixes are ignored when deriving the resource path
- Operations with
x-xgen-IPA-exceptionfor this rule are excluded from validation