Skip to content

Commit b361b12

Browse files
committed
Read yaml files with CORE_SCHEMA
Date-time related formats in ajv-formats expects string data type, but js-yaml by default reads yamls with full type yaml support. That means that dates aren't read as strings and therefore the values are invalid in terms of ajv-formats format Fixes #122
1 parent aa7c506 commit b361b12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function decodeFile(contents: string, format: string): any {
3535
return JSON5.parse(contents)
3636
case "yml":
3737
case "yaml":
38-
return yaml.safeLoad(contents)
38+
return yaml.safeLoad(contents, {schema: yaml.CORE_SCHEMA})
3939
default:
4040
throw new Error(`unsupported file format ${format}`)
4141
}

0 commit comments

Comments
 (0)