Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/apidom-ls/src/config/openapi/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import infoMeta from './info/meta';
import contactMeta from './contact/meta';
import licenseMeta from './license/meta';
import tagMeta from './tag/meta';
import externalDocumentationMeta from './external-documentation/meta';
import headerMeta from './header/meta';
import infoMeta from './info/meta';
import licenseMeta from './license/meta';
import operationMeta from './operation/meta';
import parameterMeta from './parameter/meta';
import pathItemMeta from './path-item/meta';
Expand All @@ -11,6 +11,7 @@ import responseMeta from './response/meta';
import responsesMeta from './responses/meta';
import serverMeta from './server/meta';
import serverVariableMeta from './server-variable/meta';
import tagMeta from './tag/meta';
import openapi3_1Meta from './openapi3_1/meta';
import schemaMeta from '../common/schema/meta';
import ApilintCodes from '../codes';
Expand All @@ -28,10 +29,11 @@ export default {
},
],
},
info: infoMeta,
contact: contactMeta,
externalDocumentation: externalDocumentationMeta,
header: headerMeta,
info: infoMeta,
license: licenseMeta,
schema: schemaMeta,
operation: operationMeta,
parameter: parameterMeta,
parameters: parameterMeta,
Expand All @@ -42,6 +44,6 @@ export default {
server: serverMeta,
serverVariable: serverVariableMeta,
tag: tagMeta,
externalDocumentation: externalDocumentationMeta,
openApi3_1: openapi3_1Meta,
schema: schemaMeta,
};
15 changes: 15 additions & 0 deletions packages/apidom-ls/src/config/openapi/header/documentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const documentation = [
// todo: copy the paramter targets with the required changes.
// but: should we copy & replace `parameter` text with `header`?
// and do we remove links, even though there isn't a direct equivalent for the header docs?
{
// this "raw" doc wouldn't appear anywhere in Docs. always part of a Map
// Link expect a link name e.g. `address` # the target link operationId
// Media-Type expect something like `application/json`
// Callback expect a callback name e.g. `myCallback`
// Encoding ok.
docs: '#### Header Object\n\nThe Header Object follows the structure of the [Parameter Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject) with the following changes:\n\n 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.\n 2. `in` MUST NOT be specified, it is implicitly in `header`.\n 3. All traits that are affected by the location MUST be applicable to a location of `header` (for example, [`style`](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterStyle)).\n\n##### Header Object Example\n\n\\\nA simple header of type `integer`:\n\n\\\nJSON\n```json\n{\n "description": "The number of allowed requests in the current period",\n "schema": {\n "type": "integer"\n }\n}\n```\n\n\\\nYAML\n```yaml\ndescription: The number of allowed requests in the current period\nschema:\n type: integer\n```\n',
},
];

export default documentation;
8 changes: 8 additions & 0 deletions packages/apidom-ls/src/config/openapi/header/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import documentation from './documentation';
import { FormatMeta } from '../../../apidom-language-types';

const meta: FormatMeta = {
documentation,
};

export default meta;