rules: # INFO / METADATA info-title-prefix: description: Info title must start with "Microsoft Edge" severity: error given: $.info.title then: function: pattern functionOptions: match: ^Microsoft Edge info-description-required: description: Info description is required severity: error given: $.info then: field: description function: truthy info-description-min-length: description: Info description should be at least 50 characters severity: warn given: $.info.description then: function: length functionOptions: min: 50 info-version-required: description: Info version is required severity: error given: $.info then: field: version function: truthy info-contact-required: description: Info contact is required severity: warn given: $.info then: field: contact function: truthy # OPENAPI VERSION openapi-version: description: OpenAPI version should be 3.0.x severity: error given: $.openapi then: function: pattern functionOptions: match: ^3\.0\.\d+$ # SERVERS servers-defined: description: At least one server must be defined severity: error given: $ then: field: servers function: truthy servers-description: description: Each server should have a description severity: warn given: $.servers[*] then: field: description function: truthy # PATHS - NAMING CONVENTIONS paths-kebab-case: description: Path segments should use kebab-case severity: warn given: $.paths then: field: '@key' function: pattern functionOptions: match: ^(/[a-z0-9\-\{\}\.]+)+$ paths-no-trailing-slash: description: Paths must not have trailing slashes severity: error given: $.paths then: field: '@key' function: pattern functionOptions: notMatch: .+\/$ # OPERATIONS operation-summary-required: description: Every operation must have a summary severity: error given: $.paths[*][get,post,put,patch,delete] then: field: summary function: truthy operation-summary-prefix: description: Operation summary should start with "Microsoft Edge" severity: warn given: $.paths[*][get,post,put,patch,delete].summary then: function: pattern functionOptions: match: ^Microsoft Edge operation-description-required: description: Every operation must have a description severity: error given: $.paths[*][get,post,put,patch,delete] then: field: description function: truthy operation-operationid-required: description: Every operation must have an operationId severity: error given: $.paths[*][get,post,put,patch,delete] then: field: operationId function: truthy operation-operationid-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: Every operation must have at least one tag severity: error given: $.paths[*][get,post,put,patch,delete] then: field: tags function: truthy # TAGS tags-title-case: description: Tags should use Title Case severity: warn given: $.paths[*][get,post,put,patch,delete].tags[*] then: function: pattern functionOptions: match: ^[A-Z] # PARAMETERS parameter-description-required: description: Every parameter must have a description severity: warn given: $.paths[*][get,post,put,patch,delete].parameters[*] then: field: description function: truthy parameter-schema-required: description: Every parameter must have a schema severity: error given: $.paths[*][get,post,put,patch,delete].parameters[*] then: field: schema function: truthy # RESPONSES response-success-required: description: Every operation must have a success response (2xx) severity: error given: $.paths[*][get,post,put,patch,delete].responses then: function: schema functionOptions: schema: anyOf: - required: ['200'] - required: ['201'] - required: ['202'] - required: ['204'] response-description-required: description: Every response must have a description severity: error given: $.paths[*][get,post,put,patch,delete].responses[*] then: field: description function: truthy # SCHEMAS schema-description-required: description: Top-level schemas should have descriptions severity: warn given: $.components.schemas[*] then: field: description function: truthy schema-type-required: description: Schemas should have a type defined severity: warn given: $.components.schemas[*] then: field: type function: truthy # SECURITY security-schemes-defined: description: Security schemes should be defined when security is used severity: warn given: $.components then: field: securitySchemes function: truthy # HTTP METHOD CONVENTIONS get-no-request-body: description: GET operations should not have a request body severity: error given: $.paths[*].get then: field: requestBody function: falsy delete-no-request-body: description: DELETE operations should not have a request body severity: warn given: $.paths[*].delete then: field: requestBody function: falsy # GENERAL QUALITY no-empty-descriptions: description: Descriptions should not be empty strings severity: error given: $..description then: function: truthy