rules: # INFO / METADATA info-title-prefix: description: API title should start with "BeyondTrust" severity: warn given: $.info.title then: function: pattern functionOptions: match: "^BeyondTrust" info-description-required: description: API info must have a description severity: error given: $.info then: field: description function: truthy info-version-required: description: API must specify a version severity: error given: $.info then: field: version function: truthy # OPENAPI VERSION openapi-version-3: description: Should use OpenAPI 3.0.x severity: warn given: $.openapi then: function: pattern functionOptions: match: "^3\\.0\\." # SERVERS servers-defined: description: At least one server must be defined severity: error given: $ then: field: servers function: truthy # OPERATIONS operation-summary-required: description: All operations must have a summary severity: error given: $.paths[*][get,post,put,patch,delete] then: field: summary function: truthy operation-summary-prefix: description: Operation summaries should start with "BeyondTrust" severity: warn given: $.paths[*][get,post,put,patch,delete].summary then: function: pattern functionOptions: match: "^BeyondTrust" operation-id-required: description: All operations must have operationId severity: error given: $.paths[*][get,post,put,patch,delete] then: field: operationId function: truthy operation-id-camel-case: description: operationId should use camelCase severity: warn given: $.paths[*][get,post,put,patch,delete].operationId then: function: pattern functionOptions: match: "^[a-z][a-zA-Z0-9]+$" operation-tags-required: description: Operations must have tags severity: warn given: $.paths[*][get,post,put,patch,delete] then: field: tags function: truthy operation-description-required: description: Operations should have descriptions severity: warn given: $.paths[*][get,post,put,patch,delete] then: field: description function: truthy # PARAMETERS parameter-description-required: description: Parameters must have descriptions severity: warn given: $.paths[*][get,post,put,patch,delete].parameters[*] then: field: description function: truthy # RESPONSES response-success-required: description: Operations must define a success response severity: error given: $.paths[*][get,post,put,patch,delete].responses then: function: schema functionOptions: schema: type: object minProperties: 1 response-description-required: description: Response descriptions are required severity: error given: $.paths[*][get,post,put,patch,delete].responses[*] then: field: description function: truthy response-401-for-auth: description: Auth endpoints should return 401 on failure severity: info given: $.paths[*][post].responses then: function: schema functionOptions: schema: type: object # SCHEMAS schema-description-required: description: Component schemas should have descriptions severity: warn given: $.components.schemas[*] then: field: description function: truthy schema-pascal-case-names: description: Schema names should use PascalCase message: "Schema name '{{path}}' should use PascalCase" severity: info given: $.components.schemas then: function: schema functionOptions: schema: type: object # SECURITY security-schemes-defined: description: Security schemes must be defined severity: error given: $.components then: field: securitySchemes function: truthy security-global-defined: description: Global security should be defined severity: warn given: $ then: field: security function: truthy # HTTP METHODS http-get-no-body: description: GET operations should not have request bodies severity: error given: $.paths[*].get then: field: requestBody function: falsy http-delete-no-body: description: DELETE operations should not have request bodies severity: warn given: $.paths[*].delete then: field: requestBody function: falsy # PAM-SPECIFIC credential-endpoint-secured: description: Credential retrieval endpoints must require authentication severity: error given: $.paths['/requests/{requestId}/credentials'].get then: field: security function: schema functionOptions: schema: type: array minItems: 0 no-empty-descriptions: description: Descriptions should not be empty severity: warn given: $..description then: function: pattern functionOptions: match: ".+"