# harvested from https://github.com/Raiffeisen-DGTL/rest-api-guide/blob/b2afc8e0247d5ff43a3cb61b2c343752fd2f6ee6/spectral/base-ruleset.yaml on 2026-10-09 — a Spectral ruleset published in the provider's own GitHub repository (Raiffeisen-DGTL/rest-api-guide); found by GitHub code search, fetched verbatim x-method: harvested x-stamped: 2026-10-09 x-source-url: https://github.com/Raiffeisen-DGTL/rest-api-guide/blob/b2afc8e0247d5ff43a3cb61b2c343752fd2f6ee6/spectral/base-ruleset.yaml # AUTOGENERATED - DO NOT EDIT THIS FILE MANUALLY documentationUrl: https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi aliases: ArrayProperties: targets: - formats: - "oas3_0" given: - "$..[?(@ && @.type==\"array\")]" - formats: - "oas3_1" given: - "$..[?(@ && @.type==\"array\")]" - "$..[?(@ && @.type && @.type.constructor.name === \"Array\" && @.type.includes(\"array\"))]" LinkObject: targets: - formats: - "oas3" given: - "$.components.links[*]" - "#ResponseObject.links[*]" OperationObject: - "#PathItem[get,put,post,delete,options,head,patch,trace]" PathItem: - "$.paths[*]" ResponseObject: targets: - formats: - "oas3" given: - "#OperationObject.responses[*]" - "$.components.responses[*]" SecurityRequirementObject: - "$.security[*]" - "#OperationObject.security[*]" extends: [['spectral:oas', off]] functions: - "allOffTypesConsistency" - "arrayItems" - "methodRequestResponseComponents" - "refSiblings" - "oasSecurityDefined" - "serverVariables" - "oasUnusedComponent" - "oasExample" - "objectRequestResponsePostfix" - "uniquenessTags" - "operationMustHaveSecurity" - "oasOpIdUnique" - "oasOpParams" - "oasOpSuccessResponse" - "oasTagDefined" - "oasPathParam" - "provideHeadMethod" - "responseErrorStructure" - "typedEnum" - "validSchemaExample" rules: all-off-types-consistency: description: "Все элементы allOf должны иметь одинаковый тип" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#all-off-types-consistency" given: "$..[?(@ && @.allOf)]" severity: "error" then: function: "allOffTypesConsistency" array-items: description: "Объекты типа Array должны содержать массив элементов" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#array-items" formats: - "oas3_0" - "oas3_1" given: "#ArrayProperties" severity: "error" then: function: "arrayItems" blank-strings-forbidden: description: "Пустые строки запрещены" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#blank-strings-forbidden" formats: - "oas3_0" - "oas3_1" given: - "$..[description,title]" - "$..[required[*]]" - "$..[summary,example]" - "$..[x-raif-api-description-en]" severity: "error" then: function: "pattern" functionOptions: match: "(.|\\s)*\\S(.|\\s)*" body-fields-camel-case: description: "Поля в requestBody и responseBody должны быть в camelCase" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#body-fields-camel-case" given: - "$.paths.*.*.requestBody.content.*.schema..properties.*~" - "$.paths.*.requestBody.content.*.schema..properties.*~" - "$.paths.*.*.responses.*.content.*.schema..properties.*~" - "$.paths.*.responses.*.content.*.schema..properties.*~" - "$.components.schemas.*..properties.*~" - "$.components.requestBodies.*.content.*.schema..properties.*~" - "$.components.responses.*.content.*.schema..properties.*~" severity: "error" then: function: "casing" functionOptions: type: "camel" contact-x-team-id-required: description: "Поле info.contact.x-team-id является обязательным" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#contact-x-team-id-required" given: "$.info" message: "Отсутствует поле info.contact.x-team-id" severity: "error" then: field: "contact.x-team-id" function: "truthy" description-required-for-schema-fields: description: "У каждого поля в схеме должен быть description" given: - "$..properties.*" - "$.components.schemas.*.enum[*]" severity: "error" then: - field: "description" function: "truthy" duplicated-entry-in-enum: description: "Значения в ENUM должны быть уникальны." documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#duplicated-entry-in-enum" given: "$..enum" message: "Duplicate entry '{{value}}' in enum." severity: "error" then: function: "schema" functionOptions: schema: type: "array" uniqueItems: true empty-objects-forbidden: description: "Запрещены пустые объекты" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#empty-objects-forbidden" given: - "$" - "$..*" severity: "error" then: function: "schema" functionOptions: schema: not: maxProperties: 0 type: "object" enum-discriminator-upper-snake-case: description: "Перечисления и значения маппинга для дискриминаторов именуются UPPER_SNAKE_CASE" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#enum-discriminator-upper-snake-case" given: - "$.components.schemas..enum[*]" - "$.components.schemas..discriminator.mapping.*~" message: "Enum values and discriminator mappings must be in UPPER_SNAKE_CASE format" severity: "error" then: function: "casing" functionOptions: type: "macro" info-contact: description: "Блок info должен содержать раздел contact" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#info-contact" given: "$" severity: "error" then: field: "info.contact" function: "truthy" info-description: description: "Блок info должен содержать раздел description" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#info-description" given: "$" severity: "error" then: field: "info.description" function: "truthy" method-operation-id-camel-case: description: "OperationId должны быть в camelCase формате" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#method-operation-id-camel-case" given: "$.paths[*][get,put,post,delete,options,head,patch,trace]" severity: "error" then: field: "operationId" function: "casing" functionOptions: type: "camel" method-request-response-components: description: "Тело запроса и ответа должны быть вынесены в блок components как schema" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#method-request-response-components" given: "$.paths" resolved: false severity: "error" then: function: "methodRequestResponseComponents" names-should-be-in-english: description: "Названия полей, параметров и операций должны быть на английском языке" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#names-should-be-in-english" given: - "$..enum[*]" - "$.paths[*][get,put,post,delete,options,head,patch,trace].operationId" - "$.paths[*][get,put,post,delete,options,head,patch,trace].parameters[*].name" - "$.components.parameters[*].name" - "$.components.schemas.*~" - "$.components.schemas.*.properties.*~" - "$.paths[*][get,put,post,delete,options,head,patch,trace].requestBody.content.*.schema.properties.*~" - "$.paths[*][get,put,post,delete,options,head,patch,trace].responses.*.content.*.schema.properties.*~" severity: "error" then: function: "pattern" functionOptions: match: "^[a-zA-Z0-9\\s\\-_.,:;!?()\"\\[\\]{}@#$%^&*+=<>|/~`]+$" no-eval-in-markdown: description: "Блок description и title не должен содержать eval()" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#no-eval-in-markdown" given: "$..[description,title]" severity: "error" then: function: "pattern" functionOptions: notMatch: "eval\\(" no-ref-siblings: description: "Рядом с $ref не должно быть property" documentationUrl: "https://gitlabci.raiffeisen.ru/cib/api-guide/-/tree/master/spectral/rules/openapi?ref_type=heads#no-ref-siblings" formats: - "oas3_0" given: "$.paths" resolved: false severity: "error" then: function: "refSiblings" no-script-tags-in-markdown: description: "Блок description и title не должен содержать