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:
45
45
operationRef : https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get
46
46
parameters :
47
47
username : $response.body#/username
48
+ withBody :
49
+ operationId : queryUserWithBody
50
+ requestBody :
51
+ userId : $request.path.id
48
52
# the path item of the linked operation
49
53
/users/{userid}/address :
50
54
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();
13
13
await registerSchema ( "./src/schemas/validation/schema.yaml" ) ;
14
14
const fixtures = './tests/schema' ;
15
15
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
+
17
35
describe ( "Pass" , ( ) => {
18
36
readdirSync ( `${ fixtures } /pass` , { withFileTypes : true } )
19
37
. filter ( ( entry ) => entry . isFile ( ) && / \. y a m l $ / . test ( entry . name ) )
You can’t perform that action at this time.
0 commit comments