File tree Expand file tree Collapse file tree 6 files changed +752
-12
lines changed
Expand file tree Collapse file tree 6 files changed +752
-12
lines changed Original file line number Diff line number Diff line change 5252 uses : char0n/swagger-editor-validate@master
5353 with :
5454 definition-file : examples/openapi-2-0.yaml
55+
56+ test_swagger_editor_ignore_error :
57+ runs-on : ubuntu-latest
58+ name : Swagger Editor Ignore Errors
59+
60+ steps :
61+ - uses : actions/checkout@v2
62+ - name : Validate OpenAPI definition
63+ uses : char0n/swagger-editor-validate@master
64+ with :
65+ definition-file : examples/openapi-2-0-ignore-error.yaml
66+ ignore-error : examples/ignore-error.js
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ file is going to be validated. Default `https://editor.swagger.io/`.
2626** Required** Defines path of [ OAS] ( https://github.com/OAI/OpenAPI-Specification ) definition file that exists
2727as a physical file in your repository.
2828
29+ ### ` ignore-error `
30+
31+ ** Optional** Defines path to JavaScript file containing predicate for determining if the error should be ignored or not.
32+
2933
3034## Example usage
3135
Original file line number Diff line number Diff line change @@ -9,12 +9,15 @@ inputs:
99 definition-file :
1010 description : Path to definition file
1111 required : true
12+ ignore-error :
13+ description : JavaScript file containing predicate for determining if the error should be ignored or not
14+ required : false
1215runs :
1316 using : composite
1417 steps :
1518 - run : cd ${{ github.action_path }} && npm install
1619 shell : bash
17- - run : cd ${{ github.action_path }} && SWAGGER_EDITOR_URL=${{ inputs.swagger-editor-url }} DEFINITION_FILE=${{ inputs.definition-file }} node src/index.js
20+ - run : cd ${{ github.action_path }} && SWAGGER_EDITOR_URL=${{ inputs.swagger-editor-url }} DEFINITION_FILE=${{ inputs.definition-file }} IGNORE_ERROR=${{ inputs.ignore-error }} node src/index.js
1821 shell : bash
1922branding :
2023 icon : ' file-text'
Original file line number Diff line number Diff line change 1+ const shouldIgnoreError = ( error ) => {
2+ if ( error . lineNo === 2 ) {
3+ if ( / s h o u l d N O T h a v e a d d i t i o n a l p r o p e r t i e s \s * a d d i t i o n a l P r o p e r t y : c o n t a c t 1 / mg. test ( error . message ) ) {
4+ return true ;
5+ }
6+ }
7+
8+ return false ;
9+ }
10+
11+ module . exports = shouldIgnoreError ;
You can’t perform that action at this time.
0 commit comments