File tree Expand file tree Collapse file tree 6 files changed +13
-14
lines changed
Expand file tree Collapse file tree 6 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1414 - name : openapi-github-action
1515 uses : ./
1616 with :
17- file-path : ' ./schemas/openapiv3.yml'
17+ filepath : ' ./schemas/openapiv3.yml'
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ This action validates whether the OpenAPI/Swagger schema file is valid or not
44
55## Inputs
66
7- ### ` file-path `
7+ ### ` filepath `
88
99** Required** Path of the OpenAPI schema file. Default is ` "openapi.yaml" ` at root. Path starts root of github repo.
1010For example, if your schema is in ` schemas ` folder.
1717└── package-lock.json
1818```
1919
20- You should use ` file_path : './schemas/file-path .yaml'`
20+ You should use ` filepath : './schemas/openapi .yaml'`
2121
2222## Example usage
2323
2424```
2525- name: 'validate openapi schema'
26- uses: thiyagu08 /validate-github-action@v1
26+ uses: thiyagu06 /validate-github-action@v1
2727 with:
2828 filepath: 'openapi.yaml'
2929```
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: 'openapi-validator-action'
22author : ' Thiyagu GK'
33description : ' This action validates if the OpenAPI/Swagger schema file is valid or not.'
44inputs :
5- file-path :
5+ filepath :
66 description : ' Path of openapi schema file'
77 required : true
88 default : ' openapi.yaml'
Original file line number Diff line number Diff line change @@ -18157,8 +18157,8 @@ const dir = process.env.GITHUB_WORKSPACE || __dirname
1815718157const fullPath = path.resolve(dir, filePath)
1815818158console.log(`schema file full path:${fullPath}`)
1815918159try {
18160- const SwaggerParser = __nccwpck_require__(2980);
18161- let api = await SwaggerParser.validate(fullPath, {continueOnError:true, validate:{spec: false}});
18160+ const SwaggerParser = __nccwpck_require__(2980)
18161+ let api = await SwaggerParser.validate(fullPath, {continueOnError:true})
1816218162 console.log("API specification is valid ")
1816318163}
1816418164catch(err) {
@@ -18416,9 +18416,8 @@ const core = __nccwpck_require__(4247);
1841618416const validate = __nccwpck_require__(282)
1841718417
1841818418try {
18419- // const filePath = core.getInput('file-path');
18420- const filePath = "openapiv3.yml"
18421- console.log(`file path ${filePath}!`);
18419+ const filePath = core.getInput('filepath');
18420+ console.log(`file path ${filePath}`);
1842218421 validate(filePath)
1842318422} catch (error) {
1842418423 core.setFailed(error.message);
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ const core = require('@actions/core');
22const validate = require ( './validator' )
33
44try {
5- const filePath = core . getInput ( 'file-path ' ) ;
6- console . log ( `file path ${ filePath } ! ` ) ;
5+ const filePath = core . getInput ( 'filepath ' ) ;
6+ console . log ( `file path ${ filePath } ` ) ;
77 validate ( filePath )
88} catch ( error ) {
99 core . setFailed ( error . message ) ;
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ const dir = process.env.GITHUB_WORKSPACE || __dirname
1010const fullPath = path . resolve ( dir , filePath )
1111console . log ( `schema file full path:${ fullPath } ` )
1212try {
13- const SwaggerParser = require ( "@apidevtools/swagger-parser" ) ;
14- let api = await SwaggerParser . validate ( fullPath , { continueOnError :true , validate : { spec : false } } ) ;
13+ const SwaggerParser = require ( "@apidevtools/swagger-parser" )
14+ let api = await SwaggerParser . validate ( fullPath , { continueOnError :true } )
1515 console . log ( "API specification is valid " )
1616}
1717catch ( err ) {
You can’t perform that action at this time.
0 commit comments