extends: - spectral:oas rules: # All operations must have a summary visteon-operation-summary-required: message: "All Visteon Phoenix API operations must have a summary" severity: error given: "$.paths[*][*]" then: field: summary function: truthy # Summaries must use Title Case visteon-summary-title-case: message: "Operation summaries must use Title Case" severity: warn given: "$.paths[*][*].summary" then: function: pattern functionOptions: match: "^[A-Z][a-zA-Z0-9 ]+$" # Operation IDs must use camelCase visteon-operationid-camelcase: message: "Operation IDs must use camelCase" severity: warn given: "$.paths[*][*].operationId" then: function: pattern functionOptions: match: "^[a-z][a-zA-Z0-9]+$" # All operations must be tagged visteon-operation-tags: message: "All operations must have at least one tag" severity: warn given: "$.paths[*][*]" then: field: tags function: truthy # GET responses must return 200 visteon-get-200-response: message: "GET operations must return a 200 response" severity: error given: "$.paths[*].get.responses" then: field: "200" function: truthy # POST create operations return 201 visteon-post-201-response: message: "POST create operations should return 201" severity: warn given: "$.paths[*].post.responses" then: field: "201" function: truthy # DELETE operations return 204 visteon-delete-204-response: message: "DELETE operations should return 204" severity: hint given: "$.paths[*].delete.responses" then: field: "204" function: truthy # Path parameters must be described visteon-path-params-described: message: "All path parameters must have a description" severity: warn given: "$.paths[*][*].parameters[?(@.in=='path')]" then: field: description function: truthy # Schemas must have descriptions visteon-schema-descriptions: message: "All component schemas must have descriptions" severity: hint given: "$.components.schemas[*]" then: field: description function: truthy # PUT operations must have request bodies visteon-put-has-body: message: "PUT operations must include a requestBody" severity: error given: "$.paths[*].put" then: field: requestBody function: truthy