rules: allianz-trade-operation-summary-prefix: description: All operation summaries must start with "Allianz Trade" severity: warn given: "$.paths[*][*].summary" then: function: pattern functionOptions: match: "^Allianz Trade" allianz-trade-operation-tags: description: All operations must have at least one tag severity: error given: "$.paths[*][*]" then: field: tags function: truthy allianz-trade-operation-id: description: All operations must have an operationId severity: error given: "$.paths[*][*]" then: field: operationId function: truthy allianz-trade-operation-description: description: All operations must have a description severity: warn given: "$.paths[*][*]" then: field: description function: truthy allianz-trade-pagination-page-size: description: List operations must support pageSize query parameter severity: warn given: "$.paths[*].get" then: function: schema functionOptions: schema: properties: parameters: type: array contains: type: object properties: name: const: pageSize allianz-trade-pagination-page: description: List operations must support page query parameter severity: warn given: "$.paths[*].get" then: function: schema functionOptions: schema: properties: parameters: type: array contains: type: object properties: name: const: page allianz-trade-pagination-total-required: description: List operations must support totalRequired query parameter severity: warn given: "$.paths[*].get" then: function: schema functionOptions: schema: properties: parameters: type: array contains: type: object properties: name: const: totalRequired allianz-trade-async-202: description: Write operations (POST/PATCH/DELETE) must return 202 for async processing severity: warn given: "$.paths[*][post,patch,delete]" then: function: schema functionOptions: schema: properties: responses: type: object required: - "202" allianz-trade-async-job-response: description: 202 responses must reference JobResponse schema severity: warn given: "$.paths[*][post,patch,delete].responses.202.content.application/json.schema.$ref" then: function: pattern functionOptions: match: "JobResponse" allianz-trade-error-response-401: description: All operations must document 401 Unauthorized response severity: error given: "$.paths[*][*].responses" then: field: "401" function: truthy allianz-trade-error-schema-code: description: ErrorResponse must have a code property severity: warn given: "$.components.schemas.ErrorResponse.properties" then: field: code function: truthy allianz-trade-error-schema-message: description: ErrorResponse must have a message property severity: warn given: "$.components.schemas.ErrorResponse.properties" then: field: message function: truthy allianz-trade-oauth2-security: description: API must use OAuth2 security scheme severity: error given: "$.components.securitySchemes" then: field: OAuth2 function: truthy allianz-trade-oauth2-client-credentials: description: OAuth2 must use client credentials flow severity: error given: "$.components.securitySchemes.OAuth2.flows" then: field: clientCredentials function: truthy allianz-trade-schema-title: description: All schemas must have a title severity: warn given: "$.components.schemas[*]" then: field: title function: truthy allianz-trade-schema-description: description: All schemas must have a description severity: warn given: "$.components.schemas[*]" then: field: description function: truthy allianz-trade-property-description: description: All schema properties must have a description severity: warn given: "$.components.schemas[*].properties[*]" then: field: description function: truthy allianz-trade-property-example: description: Schema properties should have examples severity: info given: "$.components.schemas[*].properties[*]" then: field: example function: truthy allianz-trade-microcks-operation: description: All operations should have x-microcks-operation extension severity: info given: "$.paths[*][*]" then: field: x-microcks-operation function: truthy allianz-trade-id-pattern: description: Identifier fields should follow Allianz Trade ID pattern (PREFIX-NNNNNN) severity: info given: "$.components.schemas[*].properties[?(@property.endsWith('Id'))].example" then: function: pattern functionOptions: match: "^[A-Z]+-[0-9]+$" allianz-trade-currency-iso: description: Currency properties must use ISO 4217 format severity: warn given: "$.components.schemas[*].properties.currency.description" then: function: pattern functionOptions: match: "ISO 4217" allianz-trade-date-format: description: Date properties must specify date format severity: warn given: "$.components.schemas[*].properties[?(@property.endsWith('Date') || @property.endsWith('date'))].format" then: function: enumeration functionOptions: values: - date - date-time