extends: spectral:oas rules: bea-operation-must-have-userid-param: description: All BEA API operations must include a UserID query parameter for authentication. severity: error given: "$.paths[*][get].parameters[*]" then: field: name function: pattern functionOptions: match: "^UserID$" bea-operation-must-have-method-param: description: All BEA API GET operations must include a 'method' query parameter specifying the API method to invoke. severity: error given: "$.paths[*][get]" then: field: parameters function: schema functionOptions: schema: type: array contains: type: object properties: name: type: string enum: ["method"] in: type: string enum: ["query"] bea-result-format-enum: description: ResultFormat parameter must only accept JSON or XML values. severity: warn given: "$.paths[*][get].parameters[?(@.name == 'ResultFormat')].schema" then: field: enum function: truthy bea-operations-must-have-tags: description: All operations must be tagged to organize by domain (Metadata, National Accounts, Regional, Industry, International). severity: warn given: "$.paths[*][get]" then: field: tags function: truthy bea-operations-must-have-summary: description: All operations must have a summary using Title Case. severity: warn given: "$.paths[*][get]" then: field: summary function: truthy bea-responses-must-include-200: description: All BEA API operations must define a 200 success response. severity: error given: "$.paths[*][get].responses" then: field: "200" function: truthy bea-responses-must-include-400: description: All BEA API operations should define a 400 error response for invalid request parameters. severity: warn given: "$.paths[*][get].responses" then: field: "400" function: truthy bea-userid-must-be-required: description: The UserID parameter must be marked as required on all endpoints. severity: error given: "$.paths[*][get].parameters[?(@.name == 'UserID')]" then: field: required function: truthy bea-parameters-must-have-descriptions: description: All parameters must have descriptions to aid API consumers. severity: warn given: "$.paths[*][get].parameters[*]" then: field: description function: truthy bea-info-must-have-contact: description: The API info object should include contact information for developer support. severity: warn given: "$.info" then: field: contact function: truthy