Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
185ed64
feat(apidom-ls): initial oas3.1 path item object documentation
tim-lai Aug 19, 2022
9727393
feat(apidom-ls): render paths, path-item
tim-lai Aug 22, 2022
a7d4c82
feat(apidom-ls): render servers, server, serverVariables
tim-lai Aug 22, 2022
2a8d5bc
refactor(apidom-ls): wip update oas31 paths documentation
tim-lai Aug 23, 2022
d711b98
feat(apidom-ls): oas31 paths documentation
tim-lai Aug 24, 2022
7b9603a
feat(apidom-ls): oas31 path-item documentation
tim-lai Aug 25, 2022
9afff1c
refactor(apidom-ls): oas31 docs move to reusable docsPathItemObject
tim-lai Aug 25, 2022
63dddd7
feat(apidom-ls): oas31 operation object documentation in path-item
tim-lai Aug 25, 2022
38323bf
feat(apidom-ls): oas31 servers documentation for path-item
tim-lai Aug 26, 2022
6668be5
feat(apidom-ls): oas31 parameters object documentation in path-item
tim-lai Aug 30, 2022
6b94a2f
refactor(apidom-ls): oas31 remove style examples from path-item docs
tim-lai Aug 30, 2022
5e2b875
feat(apidom-ls): oas31 move some docs from pathItem to parent element
tim-lai Aug 30, 2022
03eeb11
feat(apidom-ls): oas31 docs add targets for parameter object
tim-lai Aug 31, 2022
82809b4
feat(apidom-ls): oas31 docs add targets for operation object
tim-lai Aug 31, 2022
e9db51c
fix(apidom-ls): wip oas31 docs for serverVariables object
tim-lai Aug 31, 2022
783084b
fix(apidom-ls): oas31 minor changes to pathItem target docs
tim-lai Aug 31, 2022
22defb1
fix(apidom-ls): fix oas31 pathItem description docs
tim-lai Sep 1, 2022
5fbf715
fix(apidom-ls): remove extraneous oas31 symbols
tim-lai Sep 1, 2022
c2a3ead
feat(apidom-ls): add serverVariable to openapi config
tim-lai Sep 1, 2022
79d4376
fix(apidom-ls): oas31 meta docs for server-variables
tim-lai Sep 1, 2022
0d46a49
refactor(apidom-ls): rename oas31 server-variables
tim-lai Sep 1, 2022
3731dc0
refactor(apidom-ls): minor fixes to oas31 operation docs
tim-lai Sep 1, 2022
0304b0a
feat(apidom-ls): oas31 docs licenseobject
tim-lai Sep 1, 2022
c5a38e8
feat(apidom-ls): oas31 docs for tags
tim-lai Sep 1, 2022
129507a
fix(apidom-ls): cumulative oas31 docs feedback changes
tim-lai Sep 2, 2022
ec86af3
feat(apidom-ls): oas31 docs for externalDocs
tim-lai Sep 6, 2022
b17dde4
feat(apidom-ls): oas31 docs more operation object fields
tim-lai Sep 6, 2022
5187be7
feat(apidom-ls): oas31 docs for responses object
tim-lai Sep 6, 2022
ab222ec
refactor(apidom-ls): rename externalDocs to externalDocumentation
tim-lai Sep 6, 2022
8192648
refactor(apidom-ls): remove unnecessary server-variables directory
tim-lai Sep 7, 2022
af4e5b1
feat(apidom-ls): oas31 docs add targetSpecs to various objects
tim-lai Sep 7, 2022
696f627
refactor(apidom-ls): oas31 docs remove placeholder imports
tim-lai Sep 7, 2022
bbd20e0
chore(apidom-ls): oas31 docs remove linting comments
tim-lai Sep 7, 2022
2810010
refactor(apidom-ls): oas31 docs parameter content field
tim-lai Sep 7, 2022
5ed1bb0
refactor(apidom-ls): oas31 docs directly set value as string
tim-lai Sep 7, 2022
82ec71c
refactor(apidom-ls): oas31 docs remove unneed tags.externalDocs
tim-lai Sep 7, 2022
e70fdb5
chore(apidom-ls): oas31 docs remove comments about oas30
tim-lai Sep 7, 2022
5bdef78
feat(apidom-ls): oas31 docs tag object
tim-lai Sep 7, 2022
ae23041
feat(apidom-ls): oas31 docs openapi3_1 with tags and servers
tim-lai Sep 7, 2022
1d9bb85
chore(apidom-ls): oas31 docs dev comments for disabled targets
tim-lai Sep 8, 2022
dc3eb1d
feat(apidom-ls): oas31 docs complete openapi3_1 fields
tim-lai Sep 8, 2022
5c1161c
Merge branch 'main' into feat/oas31-documentation-1
tim-lai Sep 9, 2022
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
23 changes: 23 additions & 0 deletions packages/apidom-ls/src/config/openapi/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
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 operationMeta from './operation/meta';
import parameterMeta from './parameter/meta';
import pathItemMeta from './path-item/meta';
import pathsMeta from './paths/meta';
import responsesMeta from './responses/meta';
import serverMeta from './server/meta';
import serverVariableMeta from './server-variable/meta';
import openapi3_1Meta from './openapi3_1/meta';
import schemaMeta from '../common/schema/meta';
import ApilintCodes from '../codes';

Expand All @@ -18,5 +29,17 @@ export default {
},
info: infoMeta,
contact: contactMeta,
license: licenseMeta,
schema: schemaMeta,
operation: operationMeta,
parameter: parameterMeta,
parameters: parameterMeta,
pathItem: pathItemMeta,
paths: pathsMeta,
responses: responsesMeta,
server: serverMeta,
serverVariable: serverVariableMeta,
tag: tagMeta,
externalDocumentation: externalDocumentationMeta,
openApi3_1: openapi3_1Meta,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const documentation = [
{
target: 'url',
docs: '**REQUIRED**. The URL for the target documentation. This MUST be in the form of a URL.',
},
{
target: 'description',
docs: 'A description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.',
},
{
docs: '#### [External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#external-documentation-object)\n\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.\nurl | `string` | **REQUIRED**. The URL for the target documentation. This MUST be in the form of a URL.\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##### External Documentation Object Example\n\n\n\\\nJSON\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n\n\\\nYAML\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
];

export default documentation;
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;
22 changes: 22 additions & 0 deletions packages/apidom-ls/src/config/openapi/license/documentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const documentation = [
{
target: 'name',
docs: '**REQUIRED**. The license name used for the API.',
},
{
target: 'identifier',
docs: 'An [SPDX](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) license expression for the API. The `identifier` field is mutually exclusive of the `url` field.',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
target: 'url',
docs: 'A URL to the license used for the API. This MUST be in the form of a URL. The `url` field is mutually exclusive of the `identifier` field.',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
docs: '#### [License Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#licenseObject)\n\nLicense information for the exposed API.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\nname | `string` | **REQUIRED**. The license name used for the API.\nidentifier | `string` | An [SPDX](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) license expression for the API. The `identifier` field is mutually exclusive of the `url` field.\nurl | `string` | A URL to the license used for the API. This MUST be in the form of a URL. The `url` field is mutually exclusive of the `identifier` field.\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##### License Object Example\n\n\n\\\nJSON\n```json\n{\n "name": "Apache 2.0",\n "identifier": "Apache-2.0"\n}\n```\n\n\n\\\nYAML\n```yaml\nname: Apache 2.0\nidentifier: Apache-2.0\n```',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
];

export default documentation;
8 changes: 8 additions & 0 deletions packages/apidom-ls/src/config/openapi/license/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;
58 changes: 58 additions & 0 deletions packages/apidom-ls/src/config/openapi/openapi3_1/documentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const documentation = [
{
target: 'openapi',
docs: '`string`\n\n**REQUIRED**. This string MUST be the [version number](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#versions) of the OpenAPI Specification that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling to interpret the OpenAPI document. This is *not* related to the API [`info.version`](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#infoVersion) string.',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
target: 'jsonSchemaDialect',
docs: '`string`\n\nThe default value for the `$schema` keyword within [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject) contained within this OAS document. This MUST be in the form of a URI.',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
target: 'webhooks',
docs: '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)]\n\n The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the `callbacks` feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An [example](https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.1/webhook-example.yaml) is available.',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
target: 'security',
docs: '#### [[Security Requirement Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securityRequirementObject)]\n\nA declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement ({}) can be included in the array.',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
target: 'servers',
docs: '#### [[Server Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject)]\n\nAn array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject) with a [url](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverUrl) value of `/`.',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
{
target: 'tags',
docs: "#### [[Tag Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tagObject)]\n\nA list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.",
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
},
/**
* The following Fixed Fields are provided as reference, but are more
* comprehensively described by their respective meta documentation
*/
// {
// target: 'info',
// docs: '#### [Info Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#infoObject)\n\n**REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.',
// targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
// },
// {
// target: 'paths',
// docs: '#### [Paths Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathsObject)\n\nThe available paths and operations for the API.',
// targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
// },
// {
// target: 'components',
// docs: '#### [Components Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject)\n\nAn element to hold various schemas for the document.',
// targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
// },
// {
// target: 'externalDocs',
// docs: '#### [External Dcoumentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#externalDocumentationObject)\n\nAdditional external documentation.',
// targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
// },
];

export default documentation;
8 changes: 8 additions & 0 deletions packages/apidom-ls/src/config/openapi/openapi3_1/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;
Loading