# authorship: generated by API Evangelist tooling (derive-rules.py, 2026-09-21). x-method: generated # Every rule below was MEASURED against ServGhost Agent API'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-summary: 100% # - operation-has-success-response: 100% # - path-segment-casing-camel: 100% # - path-no-trailing-slash: 92% # - path-params-in-braces: 100% # - servers-https: 100% # - write-declares-request-body: 80% # - info-has-description: 100% # - info-has-contact-or-terms: 100% x-method: generated x-generator: derive-rules.py x-generated: '2026-09-21' x-source: - openapi/_original/servghost-agent-api-openapi.json extends: - - spectral:oas - recommended formats: - oas3 rules: 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-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 path-segment-casing-camel: description: 'Path segments are camel case (measured: 100% of this contract)' severity: error given: $.paths[*]~ then: function: pattern functionOptions: match: ^(/[a-z][a-zA-Z0-9]*|/\{[^}]+\})+/?$ path-no-trailing-slash: description: 'Paths carry no trailing slash (measured: 92% 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: ':' servers-https: description: 'Servers are https (measured: 100% of this contract)' severity: error given: $.servers[*].url then: function: pattern functionOptions: match: ^(https://|\{) write-declares-request-body: description: 'POST and PUT declare a request body (measured: 80% of this contract)' severity: info given: $.paths[*][post,put] then: field: requestBody function: truthy 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 info-has-contact-or-terms: description: 'The contract''s info block names a contact or terms of service (measured: 100% of this contract)' severity: error given: $.info then: function: schema functionOptions: schema: anyOf: - required: - contact - required: - termsOfService