Skip to content

Commit 8beba4e

Browse files
Alan-ChaErikWittern
authored andcommitted
Added baseUrl to CLI
Signed-off-by: Alan Cha <[email protected]>
1 parent b901bb5 commit 8beba4e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/oasgraph-cli/lib/oasgraph.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oasgraph-cli/lib/oasgraph.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oasgraph-cli/src/oasgraph.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ program
2121
.usage('<OAS JSON file path or remote url> [options]')
2222
.arguments('<path>')
2323
.option('-p, --port <port>', 'select the port where the server will start', parseInt)
24+
.option('-u, --url <url>', 'select the base url which paths will be built on')
2425
.option('-s, --strict', 'throw an error if OASGraph cannot run without compensating for errors or missing data in the OAS')
2526
.option('-a, --addSubOperations', 'nest operations based on path hierarchy')
2627
.option('-f, --fillEmptyResponses', 'create placeholder schemas for operations with HTTP status code 204 (no response) rather than ignore them')
@@ -114,7 +115,8 @@ function startGraphQLServer(oas, port) {
114115
strict: program.strict,
115116
viewer: program.viewer,
116117
addSubOperations: program.addSubOperations,
117-
fillEmptyResponses: program.fillEmptyResponses
118+
fillEmptyResponses: program.fillEmptyResponses,
119+
baseUrl: program.url
118120
})
119121
.then(({schema, report}) => {
120122
console.log(JSON.stringify(report, null, 2))

0 commit comments

Comments
 (0)