File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,18 @@ import jsonpath from 'jsonpath';
3
3
import { safeStringify , parseWithPointers } from "@stoplight/yaml" ;
4
4
import mergician from 'mergician' ;
5
5
6
- try {
6
+ // example: node index.js test/specs/petstore.yaml test/overlays/overlay.yaml
7
+ const openapiFile = process . argv [ 2 ]
8
+ const overlayFile = process . argv [ 3 ]
7
9
8
- // Parse the "input" OpenAPI spec document
10
+ try {
9
11
10
- const specraw = fs . readFileSync ( 'big.yaml' , 'utf8' ) ;
12
+ // Parse the "input" OpenAPI document
13
+ const specraw = fs . readFileSync ( openapiFile , 'utf8' ) ;
11
14
var spec = parseWithPointers ( specraw ) . data ;
12
15
13
- // Parse the "overlay" OpenAPI document
14
-
15
- const overlayraw = fs . readFileSync ( 'overlay.yaml' , 'utf8' ) ;
16
+ // Parse the "overlay" document
17
+ const overlayraw = fs . readFileSync ( overlayFile , 'utf8' ) ;
16
18
const overlay = parseWithPointers ( overlayraw ) . data ;
17
19
18
20
// Use jsonpath.apply to do the changes
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments