Skip to content

Commit b901bb5

Browse files
Alan-ChaErikWittern
authored andcommitted
Removed preferredScheme in favor of baseUrl
As suggested in #102 and added documentation for baseUrl Signed-off-by: Alan Cha <[email protected]>
1 parent a9892bd commit b901bb5

16 files changed

+33
-131
lines changed

packages/oasgraph/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ The options object can contain the following properties:
7979

8080
* `fillEmptyResponses` (type: `boolean`, default: `false`): OASGraph, by default, will only wrap operations that have a [response schema](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responsesObject) and operations that do not have a response schema will be ignored. The reason is that all GraphQL objects must have a data structure and in these cases, where the OAS does not define a response schema, the data structure cannot be safely assumed. As a result, it is recommended that the OAS should be modified to include a response schema. However, under certain circumstances, some operations should _not in fact_ have a response schema. One circumstance is HTTP status code 204, in which no content should be returned. The option `fillEmptyResponses` will allow OASGraph to wrap these operations by assigning these operations a nullable data structure. Although this data structure is meaningless, the operation will appear in the schema.
8181

82+
* `baseUrl` (type: `string`): Used to manual specify the base URL which all paths will be built on. Normally, OASGraph will select a base URL from the [server object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#serverObject) defined in the OAS. However, if the server object contains multiple URLs, OASGraph will randomly select one. The purpose of this option is to provide greater control over the base URL in these situations, especially when the OAS cannot be modified. This option may also prove to be useful in testing and development.
83+
8284
Consider this example of passing options:
8385

8486
```javascript

packages/oasgraph/lib/index.js

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

packages/oasgraph/lib/index.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/lib/oas_3_tools.js

Lines changed: 9 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oasgraph/lib/oas_3_tools.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.

0 commit comments

Comments
 (0)