extends: spectral:oas rules: # Naming conventions td-synnex-account-id-required: description: All resource paths must include accountId path parameter message: "{{description}}: {{path}}" severity: warn given: "$.paths[?(@property =~ /\\/v3\\/accounts\\//)].get.parameters[?(@.name == 'accountId')]" then: function: truthy td-synnex-operationid-kebab-case: description: Operation IDs should be camelCase (StreamOne convention) message: "Operation ID '{{value}}' should use camelCase: {{path}}" severity: warn given: "$.paths.*.*.operationId" then: function: pattern functionOptions: match: "^[a-z][a-zA-Z0-9]+$" td-synnex-versioned-paths: description: All API paths must include a version prefix (v3) message: "Path '{{path}}' must begin with /v3/ or /oauth/: {{path}}" severity: error given: "$.paths" then: function: pattern functionOptions: match: "^\\/(v[0-9]+|oauth)\\/" td-synnex-pagination-list-operations: description: List operations should support page and pageSize query parameters message: "{{description}}: {{path}}" severity: warn given: "$.paths[?(@property =~ /(?= '400')].content.application/json.schema" then: function: schema functionOptions: schema: type: object properties: $ref: type: string td-synnex-tags-required: description: All operations must have tags for grouping message: "Operation missing tags: {{path}}" severity: error given: "$.paths.*.*" then: field: tags function: truthy td-synnex-description-required: description: All operations must have descriptions message: "Operation missing description: {{path}}" severity: warn given: "$.paths.*.*" then: field: description function: truthy td-synnex-schemas-have-properties: description: Schema objects should define properties message: "Schema '{{path}}' should define properties" severity: warn given: "$.components.schemas[?(@.type == 'object')]" then: field: properties function: truthy