rules: alloy-operation-summary-prefix: description: All operation summaries must start with "Alloy" severity: warn given: "$.paths[*][*].summary" then: function: pattern functionOptions: match: "^Alloy" alloy-operation-tags: description: All operations must have at least one tag severity: error given: "$.paths[*][*]" then: field: tags function: truthy alloy-operation-id: description: All operations must have an operationId severity: error given: "$.paths[*][*]" then: field: operationId function: truthy alloy-operation-description: description: All operations must have a description severity: warn given: "$.paths[*][*]" then: field: description function: truthy alloy-error-response-401: description: All operations must document 401 Unauthorized response severity: error given: "$.paths[*][*].responses" then: field: "401" function: truthy alloy-api-key-security: description: API must use bearer API key security severity: error given: "$.components.securitySchemes" then: field: ApiKey function: truthy alloy-api-version-header: description: API version should be specified in server URL or via x-api-version header severity: info given: "$.servers[0].url" then: function: pattern functionOptions: match: "\\d{4}-\\d{2}" alloy-schema-title: description: All schemas must have a title severity: warn given: "$.components.schemas[*]" then: field: title function: truthy alloy-schema-description: description: All schemas must have a description severity: warn given: "$.components.schemas[*]" then: field: description function: truthy alloy-property-description: description: All schema properties must have a description severity: warn given: "$.components.schemas[*].properties[*]" then: field: description function: truthy alloy-property-example: description: Schema properties should have examples severity: info given: "$.components.schemas[*].properties[*]" then: field: example function: truthy alloy-microcks-operation: description: All operations should have x-microcks-operation extension severity: info given: "$.paths[*][*]" then: field: x-microcks-operation function: truthy alloy-user-id-pattern: description: User ID fields should follow usr_ prefix pattern severity: info given: "$.components.schemas[*].properties.userId.example" then: function: pattern functionOptions: match: "^usr_" alloy-post-201-or-200: description: POST operations should return 201 (created) or 200 severity: warn given: "$.paths[*].post.responses" then: function: schema functionOptions: schema: anyOf: - required: ["201"] - required: ["200"] - required: ["202"] alloy-error-response-schema: description: Error responses must reference ErrorResponse schema severity: warn given: "$.paths[*][*].responses[4XX,5XX].content.application/json.schema.$ref" then: function: pattern functionOptions: match: "ErrorResponse" alloy-connector-id-kebab-case: description: Connector IDs should use kebab-case severity: info given: "$.components.schemas[*].properties.connectorId.example" then: function: pattern functionOptions: match: "^[a-z][a-z0-9-]*$"