Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ls): fix allowed fiedls lint rule for OpenAPI 2.0 Header Object #3682

Merged
merged 1 commit into from
Jan 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const allowedFields2_0Lint: LinterMeta = {
linterFunction: 'allowedFields',
linterParams: [
[
'description',
'type',
'format',
'items',
Expand Down
9 changes: 8 additions & 1 deletion packages/apidom-ls/test/validate-valid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ describe('apidom-ls-validate', function () {
const oasPath = path.join(__dirname, 'fixtures', 'validation', 'oas', 'valid');
const asyncPath = path.join(__dirname, 'fixtures', 'validation', 'asyncapi', 'valid');
let dir = await fs.promises.opendir(oasPath);

try {
for await (const dirent of dir) {
console.log(`expecting ${path.join(dir.path, dirent.name)} to be valid`);
const pathToSpec = path.join(dir.path, dirent.name);
const specString = fs.readFileSync(path.join(dir.path, dirent.name)).toString();
const doc: TextDocument = TextDocument.create('foo://bar/doc.json', 'yaml', 0, specString);
const doc: TextDocument = TextDocument.create(
`foo://bar/${pathToSpec}`,
'yaml',
0,
specString,
);
const result = await languageService.doValidation(doc, validationContext);
assert.deepEqual(result, [] as Diagnostic[]);
}
Expand Down