Skip to content

Commit 82d7bbe

Browse files
committed
Fix #377
Signed-off-by: Alan Cha <Alan.cha1@ibm.com>
1 parent 8275405 commit 82d7bbe

15 files changed

+291
-270
lines changed

packages/openapi-to-graphql/lib/oas_3_tools.d.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,26 @@ export declare function getSchemaTargetGraphQLType<TSource, TContext, TArgs>(sch
9999
*/
100100
export declare function inferResourceNameFromPath(path: string): string;
101101
/**
102-
* Returns JSON-compatible schema required by the given operation
102+
* Get the request object for a given operation
103103
*/
104104
export declare function getRequestBodyObject(operation: OperationObject, oas: Oas3): {
105-
payloadContentType: string;
106-
requestBodyObject: RequestBodyObject;
107-
} | null;
105+
payloadContentType?: string;
106+
requestBodyObject?: RequestBodyObject;
107+
};
108108
/**
109109
* Returns the request schema (if any) for the given operation,
110110
* a dictionary of names from different sources (if available), and whether the
111111
* request schema is required for the operation.
112112
*/
113113
export declare function getRequestSchemaAndNames(path: string, method: HTTP_METHODS, operation: OperationObject, oas: Oas3): RequestSchemaAndNames;
114114
/**
115-
* Returns JSON-compatible schema produced by the given operation
115+
* Select a response object for a given operation and status code, prioritizing
116+
* objects with a JSON content-type
116117
*/
117118
export declare function getResponseObject(operation: OperationObject, statusCode: string, oas: Oas3): {
118-
responseContentType: string;
119-
responseObject: ResponseObject;
120-
} | null;
119+
responseContentType?: string;
120+
responseObject?: ResponseObject;
121+
};
121122
/**
122123
* Returns the response schema for the given operation,
123124
* a successful status code, and a dictionary of names from different sources
@@ -127,7 +128,7 @@ export declare function getResponseSchemaAndNames<TSource, TContext, TArgs>(path
127128
/**
128129
* Returns a success status code for the given operation
129130
*/
130-
export declare function getResponseStatusCode<TSource, TContext, TArgs>(path: string, method: string, operation: OperationObject, oas: Oas3, data: PreprocessingData<TSource, TContext, TArgs>): string | void;
131+
export declare function getResponseStatusCode<TSource, TContext, TArgs>(path: string, method: string, operation: OperationObject, oas: Oas3, data: PreprocessingData<TSource, TContext, TArgs>): string;
131132
/**
132133
* Returns a hash containing the links in the given operation.
133134
*/

packages/openapi-to-graphql/lib/oas_3_tools.js

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

packages/openapi-to-graphql/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)