Skip to content

Commit dfab96d

Browse files
committed
fix(rest): use direct import to work around a TS bug
See microsoft/TypeScript#26985
1 parent be1f42b commit dfab96d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/rest/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"js-yaml": "^3.11.0",
4343
"lodash": "^4.17.5",
4444
"openapi-schema-to-json-schema": "^2.1.0",
45+
"openapi3-ts": "^1.0.0",
4546
"parseurl": "^1.3.2",
4647
"path-to-regexp": "^2.2.0",
4748
"qs": "^6.5.2",

packages/rest/src/keys.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
import {CoreBindings} from '@loopback/core';
77
import {BindingKey, Context} from '@loopback/context';
8-
import {OpenApiSpec} from '@loopback/openapi-v3-types';
8+
9+
/**
10+
* See https://github.com/Microsoft/TypeScript/issues/26985
11+
*/
12+
// import {OpenApiSpec} from '@loopback/openapi-v3-types';
13+
import {OpenAPIObject} from 'openapi3-ts';
914

1015
import {HttpHandler} from './http-handler';
1116
import {SequenceHandler} from './sequence';
@@ -75,7 +80,7 @@ export namespace RestBindings {
7580
/**
7681
* Binding key for setting and injecting an OpenAPI spec
7782
*/
78-
export const API_SPEC = BindingKey.create<OpenApiSpec>('rest.apiSpec');
83+
export const API_SPEC = BindingKey.create<OpenAPIObject>('rest.apiSpec');
7984
/**
8085
* Binding key for setting and injecting a Sequence
8186
*/

0 commit comments

Comments
 (0)