File tree Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,45 @@ await registerOasSchema();
1313await registerSchema ( "./src/schemas/validation/schema.yaml" ) ;
1414const fixtures = './tests/schema' ;
1515
16- describe ( "v3.1" , ( ) => {
16+ describe ( "v3.2" , ( ) => {
17+ test ( "schema.yaml schema test" , async ( ) => {
18+ // Hardcode this simple document instead of putting it in pass/fail directories because
19+ // documents in those folders get run against schema-base.yaml instead of schema.yaml.
20+ const oad = {
21+ // Also need to include required properties
22+ openapi : "3.2.0" ,
23+ info : {
24+ title : "API" ,
25+ version : "1.0.0"
26+ } ,
27+ components : {
28+ schemas : {
29+ foo : { }
30+ }
31+ }
32+ } ;
33+ await expect ( oad ) . to . matchJsonSchema ( "./src/schemas/validation/schema.yaml" ) ; // <-- "schema.yaml" instead of "schema-base.yaml"
34+ } ) ;
35+
36+ test ( "schema.yaml invalid Schema Object type" , async ( ) => {
37+ // Hardcode this simple document instead of putting it in pass/fail directories because
38+ // documents in those folders get run against schema-base.yaml instead of schema.yaml.
39+ const oad = {
40+ // Also need to include required properties
41+ openapi : "3.2.0" ,
42+ info : {
43+ title : "API" ,
44+ version : "1.0.0"
45+ } ,
46+ components : {
47+ schemas : {
48+ foo : 42
49+ }
50+ }
51+ } ;
52+ await expect ( oad ) . to . not . matchJsonSchema ( "./src/schemas/validation/schema.yaml" ) ; // <-- "schema.yaml" instead of "schema-base.yaml"
53+ } ) ;
54+
1755 describe ( "Pass" , ( ) => {
1856 readdirSync ( `${ fixtures } /pass` , { withFileTypes : true } )
1957 . filter ( ( entry ) => entry . isFile ( ) && / \. y a m l $ / . test ( entry . name ) )
You can’t perform that action at this time.
0 commit comments