# authorship: generated by API Evangelist tooling (derive-rules.py, 2026-10-06). x-method: generated # Every rule below was MEASURED against Callidus Legal AI's own contract before it was written; a rule is present only # when the contract satisfies it at 80% or more. Severity: 100% -> error, >= 90% -> warn, else info. # Provenance: # - operation-has-operationid: 100% # - operation-has-summary: 100% # - operation-has-description: 92% # - operation-has-tags: 88% # - operation-has-success-response: 100% # - operation-declares-4xx: 95% # - path-no-trailing-slash: 97% # - path-params-in-braces: 100% # - write-declares-request-body: 83% # - response-media-type: 100% # - schema-has-description: 100% # - info-has-description: 100% x-method: generated x-generator: derive-rules.py x-generated: '2026-10-06' x-source: - openapi/callidus-legal-ai-openapi.json extends: - - spectral:oas - recommended formats: - oas3 rules: operation-has-operationid: description: 'Every operation declares an operationId (measured: 100% of this contract)' severity: error given: $.paths[*][get,post,put,patch,delete] then: field: operationId function: truthy operation-has-summary: description: 'Every operation has a summary (measured: 100% of this contract)' severity: error given: $.paths[*][get,post,put,patch,delete] then: field: summary function: truthy operation-has-description: description: 'Every operation has a description (measured: 92% of this contract)' severity: warn given: $.paths[*][get,post,put,patch,delete] then: field: description function: truthy operation-has-tags: description: 'Every operation is tagged (measured: 88% of this contract)' severity: info given: $.paths[*][get,post,put,patch,delete] then: field: tags function: truthy operation-has-success-response: description: 'Every operation declares a 2xx response (measured: 100% of this contract)' severity: error given: $.paths[*][get,post,put,patch,delete].responses then: function: schema functionOptions: schema: type: object patternProperties: ^2\d\d$: {} minProperties: 1 operation-declares-4xx: description: 'Every operation declares at least one 4xx response (measured: 95% of this contract)' severity: warn given: $.paths[*][get,post,put,patch,delete].responses then: function: schema functionOptions: schema: type: object patternProperties: ^4\d\d$: {} minProperties: 1 path-no-trailing-slash: description: 'Paths carry no trailing slash (measured: 97% of this contract)' severity: warn given: $.paths[*]~ then: function: pattern functionOptions: notMatch: ./$ path-params-in-braces: description: 'Path parameters use {braces}, not :colon (measured: 100% of this contract)' severity: error given: $.paths[*]~ then: function: pattern functionOptions: notMatch: ':' write-declares-request-body: description: 'POST and PUT declare a request body (measured: 83% of this contract)' severity: info given: $.paths[*][post,put] then: field: requestBody function: truthy response-media-type: description: 'Responses are served as application/json (measured: 100% of this contract)' severity: warn given: $.paths[*][get,post,put,patch,delete].responses[*].content then: function: schema functionOptions: schema: type: object required: - application/json schema-has-description: description: 'Every component schema carries a title or description (measured: 100% of this contract)' severity: error given: $.components.schemas[*] then: function: schema functionOptions: schema: anyOf: - required: - description - required: - title info-has-description: description: 'The contract''s info block carries a description (measured: 100% of this contract)' severity: error given: $.info then: field: description function: truthy