@@ -26,63 +26,10 @@ const parseYamlFromFile = (filePath) => {
2626
2727setMetaSchemaOutputFormat ( BASIC ) ;
2828
29- addKeyword ( {
30- id : "https://spec.openapis.org/oas/schema/vocab/keyword/discriminator" ,
31- interpret : ( discriminator , instance , context ) => {
32- return true ;
33- } ,
34- /* discriminator is not exactly an annotation, but it's not allowed
35- * to change the validation outcome (hence returing true from interopret())
36- * and for our purposes of testing, this is sufficient.
37- */
38- annotation : ( discriminator ) => {
39- return discriminator ;
40- } ,
41- } ) ;
42-
43- addKeyword ( {
44- id : "https://spec.openapis.org/oas/schema/vocab/keyword/example" ,
45- interpret : ( example , instance , context ) => {
46- return true ;
47- } ,
48- annotation : ( example ) => {
49- return example ;
50- } ,
51- } ) ;
52-
53- addKeyword ( {
54- id : "https://spec.openapis.org/oas/schema/vocab/keyword/externalDocs" ,
55- interpret : ( externalDocs , instance , context ) => {
56- return true ;
57- } ,
58- annotation : ( externalDocs ) => {
59- return externalDocs ;
60- } ,
61- } ) ;
62-
63- addKeyword ( {
64- id : "https://spec.openapis.org/oas/schema/vocab/keyword/xml" ,
65- interpret : ( xml , instance , context ) => {
66- return true ;
67- } ,
68- annotation : ( xml ) => {
69- return xml ;
70- } ,
71- } ) ;
72-
73- defineVocabulary (
74- "https://spec.openapis.org/oas/3.1/vocab/base" ,
75- {
76- "discriminator" : "https://spec.openapis.org/oas/schema/vocab/keyword/discriminator" ,
77- "example" : "https://spec.openapis.org/oas/schema/vocab/keyword/example" ,
78- "externalDocs" : "https://spec.openapis.org/oas/schema/vocab/keyword/externalDocs" ,
79- "xml" : "https://spec.openapis.org/oas/schema/vocab/keyword/xml" ,
80- } ,
81- ) ;
82-
8329registerSchema ( parseYamlFromFile ( "./src/schemas/validation/meta.yaml" ) ) ;
8430registerSchema ( parseYamlFromFile ( "./src/schemas/validation/dialect.yaml" ) ) ;
8531registerSchema ( parseYamlFromFile ( "./src/schemas/validation/schema.yaml" ) ) ;
32+
8633const validateOpenApi = await validate ( "./src/schemas/validation/schema-base.yaml" ) ;
8734const fixtures = './tests/schema' ;
8835
0 commit comments