From 0a589cd381a74b656d5950089602cdbec3b795cc Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Mon, 19 Sep 2022 13:17:01 +0200 Subject: [PATCH] fix(ls): fixes inconsistencies in OpenAPI 3.1.0 docs rules --- .../apidom-ls/src/config/openapi/components/documentation.ts | 2 +- .../src/config/openapi/request-body/documentation.ts | 4 +++- .../src/config/openapi/security-requirement/documentation.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/apidom-ls/src/config/openapi/components/documentation.ts b/packages/apidom-ls/src/config/openapi/components/documentation.ts index fba9feef63..1524ea6e96 100644 --- a/packages/apidom-ls/src/config/openapi/components/documentation.ts +++ b/packages/apidom-ls/src/config/openapi/components/documentation.ts @@ -50,7 +50,7 @@ const documentation = [ targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], }, { - docs: '#### Components Object\nHolds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\nschemas | Map[`string`, [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject)] | An object to hold reusable [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject).\nresponses | Map[`string`, [Response Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responseObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Response Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responseObject).\nparameters | Map[`string`, [Parameter Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject).\nexamples | Map[`string`, [Example Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#exampleObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Example Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#exampleObject).\nrequestBodies | Map[`string`, [Request Body Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Request Body Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject).\nheaders | Map[`string`, [Header Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#headerObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#headerObject).\nsecuritySchemes | Map[`string`, [Security Scheme Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securitySchemeObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Security Scheme Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securitySchemeObject).\nlinks | Map[`string`, [Link Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#linkObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Link Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#linkObject).\ncallbacks | Map[`string`, [Callback Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Callback Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject).\npathItems | Map[`string`, [Path Item Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Path Item Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject).\n\n\\\nThis object MAY be extended with Specification Extensions.\n\n\\\nAll the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\\.\\-_]+$`.\n\n\\\nField Name Examples:\n\n\\\nYAML\n```yaml\nUser\nUser_1\nUser_Name\nuser-name\nmy.org.User\n```\n\n##### Components Object Example\n\n\\\nJSON\n```json\n"components": {\n "schemas": {\n "GeneralError": {\n "type": "object",\n "properties": {\n "code": {\n "type": "integer",\n "format": "int32"\n },\n "message": {\n "type": "string"\n }\n }\n },\n "Category": {\n "type": "object",\n "properties": {\n "id": {\n "type": "integer",\n "format": "int64"\n },\n "name": {\n "type": "string"\n }\n }\n },\n "Tag": {\n "type": "object",\n "properties": {\n "id": {\n "type": "integer",\n "format": "int64"\n },\n "name": {\n "type": "string"\n }\n }\n }\n },\n "parameters": {\n "skipParam": {\n "name": "skip",\n "in": "query",\n "description": "number of items to skip",\n "required": true,\n "schema": {\n "type": "integer",\n "format": "int32"\n }\n },\n "limitParam": {\n "name": "limit",\n "in": "query",\n "description": "max records to return",\n "required": true,\n "schema" : {\n "type": "integer",\n "format": "int32"\n }\n }\n },\n "responses": {\n "NotFound": {\n "description": "Entity not found."\n },\n "IllegalInput": {\n "description": "Illegal input for operation."\n },\n "GeneralError": {\n "description": "General Error",\n "content": {\n "application/json": {\n "schema": {\n "$ref": "#/components/schemas/GeneralError"\n }\n }\n }\n }\n },\n "securitySchemes": {\n "api_key": {\n "type": "apiKey",\n "name": "api_key",\n "in": "header"\n },\n "petstore_auth": {\n "type": "oauth2",\n "flows": {\n "implicit": {\n "authorizationUrl": "https://example.org/api/oauth/dialog",\n "scopes": {\n "write:pets": "modify pets in your account",\n "read:pets": "read your pets"\n }\n }\n }\n }\n }\n}\n```\n\n\\\nYAML\n```yaml\ncomponents:\n schemas:\n GeneralError:\n type: object\n properties:\n code:\n type: integer\n format: int32\n message:\n type: string\n Category:\n type: object\n properties:\n id:\n type: integer\n format: int64\n name:\n type: string\n Tag:\n type: object\n properties:\n id:\n type: integer\n format: int64\n name:\n type: string\n parameters:\n skipParam:\n name: skip\n in: query\n description: number of items to skip\n required: true\n schema:\n type: integer\n format: int32\n limitParam:\n name: limit\n in: query\n description: max records to return\n required: true\n schema:\n type: integer\n format: int32\n responses:\n NotFound:\n description: Entity not found.\n IllegalInput:\n description: Illegal input for operation.\n GeneralError:\n description: General Error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/GeneralError\'\n securitySchemes:\n api_key:\n type: apiKey\n name: api_key\n in: header\n petstore_auth:\n type: oauth2\n flows: \n implicit:\n authorizationUrl: https://example.org/api/oauth/dialog\n scopes:\n write:pets: modify pets in your account\n read:pets: read your pets\n```\n', + docs: '#### [Components Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject)\n\nHolds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\nschemas | Map[`string`, [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject)] | An object to hold reusable [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject).\nresponses | Map[`string`, [Response Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responseObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Response Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responseObject).\nparameters | Map[`string`, [Parameter Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject).\nexamples | Map[`string`, [Example Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#exampleObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Example Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#exampleObject).\nrequestBodies | Map[`string`, [Request Body Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Request Body Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject).\nheaders | Map[`string`, [Header Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#headerObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#headerObject).\nsecuritySchemes | Map[`string`, [Security Scheme Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securitySchemeObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Security Scheme Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securitySchemeObject).\nlinks | Map[`string`, [Link Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#linkObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Link Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#linkObject).\ncallbacks | Map[`string`, [Callback Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Callback Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject).\npathItems | Map[`string`, [Path Item Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)] | An object to hold reusable [Path Item Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject).\n\n\\\nThis object MAY be extended with Specification Extensions.\n\n\\\nAll the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\\.\\-_]+$`.\n\n\\\nField Name Examples:\n\n\\\nYAML\n```yaml\nUser\nUser_1\nUser_Name\nuser-name\nmy.org.User\n```\n\n##### Components Object Example\n\n\\\nJSON\n```json\n"components": {\n "schemas": {\n "GeneralError": {\n "type": "object",\n "properties": {\n "code": {\n "type": "integer",\n "format": "int32"\n },\n "message": {\n "type": "string"\n }\n }\n },\n "Category": {\n "type": "object",\n "properties": {\n "id": {\n "type": "integer",\n "format": "int64"\n },\n "name": {\n "type": "string"\n }\n }\n },\n "Tag": {\n "type": "object",\n "properties": {\n "id": {\n "type": "integer",\n "format": "int64"\n },\n "name": {\n "type": "string"\n }\n }\n }\n },\n "parameters": {\n "skipParam": {\n "name": "skip",\n "in": "query",\n "description": "number of items to skip",\n "required": true,\n "schema": {\n "type": "integer",\n "format": "int32"\n }\n },\n "limitParam": {\n "name": "limit",\n "in": "query",\n "description": "max records to return",\n "required": true,\n "schema" : {\n "type": "integer",\n "format": "int32"\n }\n }\n },\n "responses": {\n "NotFound": {\n "description": "Entity not found."\n },\n "IllegalInput": {\n "description": "Illegal input for operation."\n },\n "GeneralError": {\n "description": "General Error",\n "content": {\n "application/json": {\n "schema": {\n "$ref": "#/components/schemas/GeneralError"\n }\n }\n }\n }\n },\n "securitySchemes": {\n "api_key": {\n "type": "apiKey",\n "name": "api_key",\n "in": "header"\n },\n "petstore_auth": {\n "type": "oauth2",\n "flows": {\n "implicit": {\n "authorizationUrl": "https://example.org/api/oauth/dialog",\n "scopes": {\n "write:pets": "modify pets in your account",\n "read:pets": "read your pets"\n }\n }\n }\n }\n }\n}\n```\n\n\\\nYAML\n```yaml\ncomponents:\n schemas:\n GeneralError:\n type: object\n properties:\n code:\n type: integer\n format: int32\n message:\n type: string\n Category:\n type: object\n properties:\n id:\n type: integer\n format: int64\n name:\n type: string\n Tag:\n type: object\n properties:\n id:\n type: integer\n format: int64\n name:\n type: string\n parameters:\n skipParam:\n name: skip\n in: query\n description: number of items to skip\n required: true\n schema:\n type: integer\n format: int32\n limitParam:\n name: limit\n in: query\n description: max records to return\n required: true\n schema:\n type: integer\n format: int32\n responses:\n NotFound:\n description: Entity not found.\n IllegalInput:\n description: Illegal input for operation.\n GeneralError:\n description: General Error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/GeneralError\'\n securitySchemes:\n api_key:\n type: apiKey\n name: api_key\n in: header\n petstore_auth:\n type: oauth2\n flows: \n implicit:\n authorizationUrl: https://example.org/api/oauth/dialog\n scopes:\n write:pets: modify pets in your account\n read:pets: read your pets\n```\n', targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], }, ]; diff --git a/packages/apidom-ls/src/config/openapi/request-body/documentation.ts b/packages/apidom-ls/src/config/openapi/request-body/documentation.ts index afbfcdf546..984b691494 100644 --- a/packages/apidom-ls/src/config/openapi/request-body/documentation.ts +++ b/packages/apidom-ls/src/config/openapi/request-body/documentation.ts @@ -6,13 +6,15 @@ const documentation = [ { target: 'content', docs: 'Map[`string`, [Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)]\n\\\n\\\n**REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*', + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], }, { target: 'required', docs: 'Determines if the request body is required in the request. Defaults to `false`.', }, { - docs: '#### Request Body Object\n\nDescribes a single request body.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.\ncontent | Map[`string`, [Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*\nrequired | `boolean` | Determines if the request body is required in the request. Defaults to `false`.\n\n\\\nThis object MAY be extended with [Specification Extensions](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions).\n\n##### Request Body Examples\n\nA request body with a referenced model definition.\n\n\\\nJSON\n```json\n{\n "description": "user to add to the system",\n "content": {\n "application/json": {\n "schema": {\n "$ref": "#/components/schemas/User"\n },\n "examples": {\n "user" : {\n "summary": "User Example", \n "externalValue": "https://foo.bar/examples/user-example.json"\n } \n }\n },\n "application/xml": {\n "schema": {\n "$ref": "#/components/schemas/User"\n },\n "examples": {\n "user" : {\n "summary": "User example in XML",\n "externalValue": "https://foo.bar/examples/user-example.xml"\n }\n }\n },\n "text/plain": {\n "examples": {\n "user" : {\n "summary": "User example in Plain text",\n "externalValue": "https://foo.bar/examples/user-example.txt" \n }\n } \n },\n "*/*": {\n "examples": {\n "user" : {\n "summary": "User example in other format",\n "externalValue": "https://foo.bar/examples/user-example.whatever"\n }\n }\n }\n }\n}\n```\n\n\n\\\nYAML\n```yaml\ndescription: user to add to the system\ncontent: \n \'application/json\':\n schema:\n $ref: \'#/components/schemas/User\'\n examples:\n user:\n summary: User Example\n externalValue: \'https://foo.bar/examples/user-example.json\'\n \'application/xml\':\n schema:\n $ref: \'#/components/schemas/User\'\n examples:\n user:\n summary: User example in XML\n externalValue: \'https://foo.bar/examples/user-example.xml\'\n \'text/plain\':\n examples:\n user:\n summary: User example in Plain text\n externalValue: \'https://foo.bar/examples/user-example.txt\'\n \'*/*\':\n examples:\n user: \n summary: User example in other format\n externalValue: \'https://foo.bar/examples/user-example.whatever\'\n```\n\nA body parameter that is an array of string values:\n```json\n{\n "description": "user to add to the system",\n "required": true,\n "content": {\n "text/plain": {\n "schema": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n }\n }\n}\n```\n\n```yaml\ndescription: user to add to the system\nrequired: true\ncontent:\n text/plain:\n schema:\n type: array\n items:\n type: string\n```', + docs: '#### [Request Body Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject)\n\nDescribes a single request body.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.\ncontent | Map[`string`, [Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*\nrequired | `boolean` | Determines if the request body is required in the request. Defaults to `false`.\n\n\\\nThis object MAY be extended with [Specification Extensions](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions).\n\n##### Request Body Examples\n\nA request body with a referenced model definition.\n\n\\\nJSON\n```json\n{\n "description": "user to add to the system",\n "content": {\n "application/json": {\n "schema": {\n "$ref": "#/components/schemas/User"\n },\n "examples": {\n "user" : {\n "summary": "User Example", \n "externalValue": "https://foo.bar/examples/user-example.json"\n } \n }\n },\n "application/xml": {\n "schema": {\n "$ref": "#/components/schemas/User"\n },\n "examples": {\n "user" : {\n "summary": "User example in XML",\n "externalValue": "https://foo.bar/examples/user-example.xml"\n }\n }\n },\n "text/plain": {\n "examples": {\n "user" : {\n "summary": "User example in Plain text",\n "externalValue": "https://foo.bar/examples/user-example.txt" \n }\n } \n },\n "*/*": {\n "examples": {\n "user" : {\n "summary": "User example in other format",\n "externalValue": "https://foo.bar/examples/user-example.whatever"\n }\n }\n }\n }\n}\n```\n\n\n\\\nYAML\n```yaml\ndescription: user to add to the system\ncontent: \n \'application/json\':\n schema:\n $ref: \'#/components/schemas/User\'\n examples:\n user:\n summary: User Example\n externalValue: \'https://foo.bar/examples/user-example.json\'\n \'application/xml\':\n schema:\n $ref: \'#/components/schemas/User\'\n examples:\n user:\n summary: User example in XML\n externalValue: \'https://foo.bar/examples/user-example.xml\'\n \'text/plain\':\n examples:\n user:\n summary: User example in Plain text\n externalValue: \'https://foo.bar/examples/user-example.txt\'\n \'*/*\':\n examples:\n user: \n summary: User example in other format\n externalValue: \'https://foo.bar/examples/user-example.whatever\'\n```\n\nA body parameter that is an array of string values:\n```json\n{\n "description": "user to add to the system",\n "required": true,\n "content": {\n "text/plain": {\n "schema": {\n "type": "array",\n "items": {\n "type": "string"\n }\n }\n }\n }\n}\n```\n\n```yaml\ndescription: user to add to the system\nrequired: true\ncontent:\n text/plain:\n schema:\n type: array\n items:\n type: string\n```', + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], }, ]; diff --git a/packages/apidom-ls/src/config/openapi/security-requirement/documentation.ts b/packages/apidom-ls/src/config/openapi/security-requirement/documentation.ts index a434afccdc..1ab27fc835 100644 --- a/packages/apidom-ls/src/config/openapi/security-requirement/documentation.ts +++ b/packages/apidom-ls/src/config/openapi/security-requirement/documentation.ts @@ -1,6 +1,6 @@ const documentation = [ { - docs: '#### Security Requirement Object\nLists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the [Components Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject).\n\n\\\nSecurity Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.\n\n\\\nWhen a list of Security Requirement Objects is defined on the [OpenAPI Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oasObject) or [Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject), only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the Security Schemes under the [Components Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MAY contain a list of role names which are required for the execution, but are not otherwise defined or exchanged in-band.\n\n##### Security Requirement Object Examples\n\n##### Non-OAuth2 Security Requirement\nJSON\n```json\n{\n "api_key": []\n}\n```\n\n\\\nYAML\n```yaml\napi_key: []\n```\n##### OAuth2 Security Requirement\nJSON\n```json\n{\n "petstore_auth": [\n "write:pets",\n "read:pets"\n ]\n}\n```\n\n\\\nYAML\n```yaml\npetstore_auth:\n- write:pets\n- read:pets\n```\n##### Optional OAuth2 Security\nOptional OAuth2 security as would be defined in an OpenAPI Object or an Operation Object:\n\n\\\nJSON\n```json\n{\n "security": [\n {},\n {\n "petstore_auth": [\n "write:pets",\n "read:pets"\n ]\n }\n ]\n}\n```\n\n\\\nYAML\n```yaml\nsecurity:\n - {}\n - petstore_auth:\n - write:pets\n - read:pets\n```\n', + docs: '#### [Security Requirement Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securityRequirementObject)\n\nLists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the [Components Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject).\n\n\\\nSecurity Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.\n\n\\\nWhen a list of Security Requirement Objects is defined on the [OpenAPI Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oasObject) or [Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject), only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the Security Schemes under the [Components Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MAY contain a list of role names which are required for the execution, but are not otherwise defined or exchanged in-band.\n\n##### Security Requirement Object Examples\n\n##### Non-OAuth2 Security Requirement\nJSON\n```json\n{\n "api_key": []\n}\n```\n\n\\\nYAML\n```yaml\napi_key: []\n```\n##### OAuth2 Security Requirement\nJSON\n```json\n{\n "petstore_auth": [\n "write:pets",\n "read:pets"\n ]\n}\n```\n\n\\\nYAML\n```yaml\npetstore_auth:\n- write:pets\n- read:pets\n```\n##### Optional OAuth2 Security\nOptional OAuth2 security as would be defined in an OpenAPI Object or an Operation Object:\n\n\\\nJSON\n```json\n{\n "security": [\n {},\n {\n "petstore_auth": [\n "write:pets",\n "read:pets"\n ]\n }\n ]\n}\n```\n\n\\\nYAML\n```yaml\nsecurity:\n - {}\n - petstore_auth:\n - write:pets\n - read:pets\n```\n', targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], }, ];