File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed
fixtures/constructor-property Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,14 @@ describe('E2E', () => {
7474 const result = getCommandOutput ( args , { } , { testPath } ) ;
7575 await expect ( cleanupOutput ( result ) ) . toMatchFileSnapshot ( join ( testPath , 'snapshot_2.txt' ) ) ;
7676 } ) ;
77+
78+ test ( 'lint file with constructor property in schema' , async ( ) => {
79+ const testPath = join ( __dirname , 'fixtures/constructor-property' ) ;
80+ const args = getParams ( indexEntryPoint , [ 'lint' , 'openapi.yaml' ] ) ;
81+
82+ const result = getCommandOutput ( args , { } , { testPath } ) ;
83+ await expect ( cleanupOutput ( result ) ) . toMatchFileSnapshot ( join ( testPath , 'snapshot.txt' ) ) ;
84+ } ) ;
7785 } ) ;
7886
7987 describe ( 'zero-config' , ( ) => {
Original file line number Diff line number Diff line change 1+ openapi : 3.0.0
2+ servers :
3+ - url : http://test.com:3000
4+ info :
5+ title : Test API - Constructor Property
6+ version : 1.0.0
7+ license :
8+ name : MIT
9+ url : https://opensource.org/licenses/MIT
10+ components :
11+ schemas :
12+ SchemaWithConstructor :
13+ type : object
14+ properties :
15+ id :
16+ type : string
17+ constructor : # This is the property we are testing
18+ type : object
19+ description : " A property named constructor"
20+ properties :
21+ foo :
22+ type : string
23+ paths :
24+ /test :
25+ get :
26+ summary : Test endpoint
27+ security : []
28+ operationId : test
29+ responses :
30+ ' 200 ' :
31+ description : OK
32+ content :
33+ application/json :
34+ schema :
35+ $ref : ' #/components/schemas/SchemaWithConstructor'
36+ ' 400 ' :
37+ description : Bad Request
Original file line number Diff line number Diff line change 1+
2+ No configurations were provided -- using built in recommended configuration by default.
3+
4+ validating openapi.yaml...
5+ openapi.yaml: validated in <test>ms
6+
7+ Woohoo! Your API description is valid. 🎉
8+
You can’t perform that action at this time.
0 commit comments