Skip to content

Commit 8927be6

Browse files
Alan-ChaErikWittern
authored andcommitted
Small change to warning message
Related #140 Signed-off-by: Alan Cha <[email protected]>
1 parent 1f962ef commit 8927be6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/oasgraph/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ The options object can contain the following properties:
149149

150150
* `tokenJSONpath` (type: `string`, default: `undefined`): Used to pass the [JSONPath](http://goessner.net/articles/JsonPath/) of the OAuth token in the GraphQL context. To see more details, click [here](./README.md#authorization).
151151

152-
* `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.
152+
* `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, _specifically ones with the 204 HTTP status code_, by assigning these operations a nullable data structure. Although this data structure is meaningless, the operation will appear in the schema.
153153

154154
* `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.
155155

156156
* `operationIdFieldNames` (type: `boolean`, default: `false`): By default, query field names are based on the return type type name and mutation field names are based on the [`operationId`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operation-object), which may be generated if it does not exist. This option forces OASGraph to only create field names based on the operationId.
157157

158-
* `requestOptions` (type: `object`, default: `{}`): Additional [options](https://github.com/request/request#requestoptions-callback), provided by the [`Request` module](https://github.com/request/request), that can be used to configure the HTTP calls that powers the generated GraphQL resolvers. A common usecase is to use this to set a web proxy through the `proxy` field.
158+
* `requestOptions` (type: `object`, default: `{}`): Additional [options](https://github.com/request/request#requestoptions-callback), provided by the [`Request` module](https://github.com/request/request), that can be used to configure the HTTP calls that powers the generated GraphQL resolvers. A common use case is to use this to up set a web proxy with the `proxy` field.
159159

160160
Consider this example of passing options:
161161

packages/oasgraph/src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export const WarningTypes: {
3535
return {
3636
type: 'MissingResponseSchema',
3737
message: `Operation '${culprit}' has no (valid) response schema. ` +
38-
`You can create placeholder schemas using the fillEmptyResponses option.`,
38+
`If this operation has a 204 HTTP code, you can create a placeholder ` +
39+
`schema using the fillEmptyResponses option.`,
3940
mitigation: `Ignore operation`
4041
}
4142
},

0 commit comments

Comments
 (0)