Skip to content

Commit

Permalink
fix(ls): oas31 lint and completion rules for
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-lai committed Oct 5, 2022
1 parent e4a91d7 commit 766f74a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/apidom-ls/src/config/codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ enum ApilintCodes {

OPENAPI3_1_OPEN_API = 7010000,
OPENAPI3_1_OPEN_API_FIELD_WEBHOOKS_TYPE = 7010100,
OPENAPI3_1_OPEN_API_FIELD_JSON_SCHEMA_DIALECT_TYPE = 7010200,
OPENAPI3_1_OPEN_API_FIELD_JSON_SCHEMA_FORMAT_URI = 7010200,
OPENAPI3_1_OPEN_API_FIELD_INFO_TYPE = 7010300,
OPENAPI3_1_OPEN_API_FIELD_INFO_TYPE_REQUIRED,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const completion: ApidomCompletionItem[] = [
label: 'jsonSchemaDialect',
insertText: 'jsonSchemaDialect',
kind: 14,
format: CompletionFormat.OBJECT,
format: CompletionFormat.UNQUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import allowedFieldsLint from './allowed-fields';
import infoRequiredLint from './info--required';
import jsonSchemaDialectTypeLint from './jsonSchemaDialect--type';
import jsonSchemaDialectFormatURILint from './jsonSchemaDialect--format-uri';
import webhooksLint from './webhooks--type';

const lints = [allowedFieldsLint, infoRequiredLint, jsonSchemaDialectTypeLint, webhooksLint];
const lints = [allowedFieldsLint, infoRequiredLint, jsonSchemaDialectFormatURILint, webhooksLint];

export default lints;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import ApilintCodes from '../../../codes';
import { LinterMeta } from '../../../../apidom-language-types';

const jsonSchemaDialectFormatURILint: LinterMeta = {
code: ApilintCodes.OPENAPI3_1_OPEN_API_FIELD_JSON_SCHEMA_FORMAT_URI,
source: 'apilint',
message: "'jsonSchemaDialect' value MUST be in the form of a URI.",
severity: 1,
linterFunction: 'apilintValidURI',
marker: 'value',
target: 'jsonSchemaDialect',
data: {},
};

export default jsonSchemaDialectFormatURILint;

This file was deleted.

4 changes: 2 additions & 2 deletions packages/apidom-ls/src/config/openapi/openapi3_1/meta.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import lint from './lint';
import completion from './completion';
import documentation from './documentation';
import lint from './lint';
import { FormatMeta } from '../../../apidom-language-types';

const meta: FormatMeta = {
lint,
completion,
documentation,
lint,
};

export default meta;

0 comments on commit 766f74a

Please sign in to comment.