Bentley Systems · API Governance Rules
Bentley Systems API Rules
Spectral linting rules defining API design standards and conventions for Bentley Systems.
Bentley Systems API Rules is a Spectral governance ruleset published by Bentley Systems on the APIs.io network, containing 12 lint rules.
The ruleset includes 4 error-severity rules, 6 warning-severity rules, and 2 info-severity rules.
Tagged areas include Infrastructure Engineering, Digital Twin, BIM, CAD, and Reality Capture.
Rulesets can be applied to your own OpenAPI specs via Spectral to enforce the same governance standards.
12 Rules
error 4
warn 6
info 2
Rule Categories
bentley
Rules
error
bentley-itwin-base-url
All iTwin Platform APIs must use api.bentley.com as the host
$.servers[*].url
error
bentley-oauth2-required
iTwin Platform APIs must define OAuth2 (Bentley IMS) as the security scheme
$.components.securitySchemes.OAuth2
error
bentley-operation-id-required
All iTwin operations must define an operationId
$.paths[*][get,post,put,patch,delete]
warn
bentley-operation-id-pascal-case
iTwin operationIds use PascalCase (e.g., GetIModel, CreateChangeset)
$.paths[*][get,post,put,patch,delete].operationId
warn
bentley-tags-required
All iTwin operations must include at least one tag
$.paths[*][get,post,put,patch,delete]
warn
bentley-summary-title-case
iTwin operation summaries should use Title Case
$.paths[*][get,post,put,patch,delete].summary
error
bentley-response-200-or-201
All iTwin operations must define a 2xx success response
$.paths[*][get,post,put,patch,delete].responses
warn
bentley-uuid-path-params
iTwin resource id path parameters should be uuid-typed
$.paths[*].parameters[?(@.in=='path' && @.name=~/Id$/)].schema
info
bentley-itwin-id-required
Top-level collection GETs should accept iTwinId query parameter for scoping
$.paths[?(@property==/)].get.parameters[?(@.name=='iTwinId')]
warn
bentley-external-docs-required
iTwin Platform API specs should reference developer.bentley.com via externalDocs
$.externalDocs.url
warn
bentley-info-contact-required
Spec info.contact must reference Bentley Developer Relations
$.info.contact
info
bentley-license-required
Spec info.license should reference the Bentley Developer Portal terms
$.info.license.url