File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ paths:
4545 operationRef : https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get
4646 parameters :
4747 username : $response.body#/username
48+ withBody :
49+ operationId : queryUserWithBody
50+ requestBody :
51+ userId : $request.path.id
4852 # the path item of the linked operation
4953 /users/{userid}/address :
5054 parameters :
Original file line number Diff line number Diff line change 1+ openapi : 3.2.0
2+ info :
3+ title : API
4+ version : 1.0.0
5+ paths :
6+ /user :
7+ parameters :
8+ - in : query
9+ name : example
10+ schema :
11+ # Allow an arbitrary JSON object to keep
12+ # the example simple
13+ type : object
14+ # DEPRECATED: don't use example keyword inside Schema Object
15+ example : {
16+ " numbers " : [1, 2],
17+ " flag " : null
18+ }
Original file line number Diff line number Diff line change @@ -13,7 +13,25 @@ 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+ // Files in the pass/fail folders get run against schema-base.yaml.
19+ // This instance is instead run against schema.yaml.
20+ const oad = {
21+ openapi : "3.2.0" ,
22+ info : {
23+ title : "API" ,
24+ version : "1.0.0"
25+ } ,
26+ components : {
27+ schemas : {
28+ foo : { }
29+ }
30+ }
31+ } ;
32+ await expect ( oad ) . to . matchJsonSchema ( "./src/schemas/validation/schema.yaml" ) ; // <-- "schema.yaml" instead of "schema-base.yaml"
33+ } ) ;
34+
1735 describe ( "Pass" , ( ) => {
1836 readdirSync ( `${ fixtures } /pass` , { withFileTypes : true } )
1937 . filter ( ( entry ) => entry . isFile ( ) && / \. y a m l $ / . test ( entry . name ) )
You can’t perform that action at this time.
0 commit comments