rules: # INFO / METADATA info-title-format: description: API title must start with "Amazon GameLift" severity: warn given: "$.info.title" then: function: pattern functionOptions: match: "^Amazon GameLift" info-description-required: description: API must have a description severity: error given: "$.info" then: field: description function: truthy info-version-required: description: API must have a version severity: error given: "$.info" then: field: version function: truthy # OPENAPI VERSION openapi-version: description: Must use OpenAPI 3.0.x severity: warn given: "$.openapi" then: function: pattern functionOptions: match: "^3\\.0\\." # SERVERS servers-required: description: Servers must be defined severity: error given: "$" then: field: servers function: truthy servers-https: description: Server URLs should use HTTPS severity: warn given: "$.servers[*].url" then: function: pattern functionOptions: match: "^https://" # 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-company-prefix: description: Operation summaries must start with Amazon GameLift severity: warn given: "$.paths[*][get,post,put,patch,delete].summary" then: function: pattern functionOptions: match: "^Amazon GameLift" operation-description-required: description: Every operation must have a description severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: description function: truthy operation-id-required: description: Every operation must have an operationId severity: error given: "$.paths[*][get,post,put,patch,delete]" then: field: operationId function: truthy operation-id-camel-case: description: operationId must use camelCase severity: warn given: "$.paths[*][get,post,put,patch,delete].operationId" then: function: pattern functionOptions: match: "^[a-z][a-zA-Z0-9]+$" # RESPONSES response-success-required: description: Operations must have at least one success (2xx) response severity: error given: "$.paths[*][get,post,put,patch,delete].responses" then: function: schema functionOptions: schema: type: object anyOf: - required: ["200"] - required: ["201"] - required: ["204"] response-description-required: description: Responses must have descriptions severity: warn given: "$.paths[*][get,post,put,patch,delete].responses[*]" then: field: description function: truthy # REQUEST BODY request-body-description: description: Request bodies should have descriptions severity: info given: "$.paths[*][post,put,patch].requestBody" then: field: description function: truthy # SECURITY security-schemes-defined: description: Security schemes should be defined in components severity: warn given: "$" then: field: components.securitySchemes function: truthy # SCHEMAS schema-properties-typed: description: Schema properties should have types defined severity: info given: "$.components.schemas[*].properties[*]" then: field: type function: truthy # GENERAL no-empty-descriptions: description: Descriptions must not be empty strings severity: error given: "$..description" then: function: pattern functionOptions: match: ".+" microcks-operation-extension: description: Operations should have x-microcks-operation for mock support severity: info given: "$.paths[*][get,post,put,patch,delete]" then: field: x-microcks-operation function: truthy