feat: upgrade js-yaml package (#403)

* feat: upgraded js-yaml package from v.3 to v.4 with YAML 1.2 support

* feat: removed timestamp type from YAML schema
This commit is contained in:
Yaroslav Shuhailo
2021-10-12 11:52:08 +03:00
committed by GitHub
parent 4cbd04ecae
commit 35fc48c667
25 changed files with 291 additions and 314 deletions

View File

@@ -1,4 +1,4 @@
import * as yaml from 'js-yaml';
import { parseYaml } from '../js-yaml';
import { Document, Source } from '../resolve';
import { Oas3RuleSet } from '../oas-types';
import { RuleConfig, LintConfig, Plugin } from '../config/config';
@@ -6,7 +6,7 @@ import { RuleConfig, LintConfig, Plugin } from '../config/config';
export function parseYamlToDocument(body: string, absoluteRef: string = ''): Document {
return {
source: new Source(absoluteRef, body),
parsed: yaml.safeLoad(body, { filename: absoluteRef }),
parsed: parseYaml(body, { filename: absoluteRef }),
};
}