diff --git a/plugins/catalog-backend/src/service/createRouter.ts b/plugins/catalog-backend/src/service/createRouter.ts index 99e9c6b0df..9750272fae 100644 --- a/plugins/catalog-backend/src/service/createRouter.ts +++ b/plugins/catalog-backend/src/service/createRouter.ts @@ -24,7 +24,8 @@ import { } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; import { NotFoundError, serializeError } from '@backstage/errors'; -import express, { Router } from 'express'; +import express from 'express'; +import Router from 'express-promise-router'; import { Logger } from 'winston'; import yn from 'yn'; import { z } from 'zod'; diff --git a/plugins/openapi-router-common/package.json b/plugins/openapi-router-common/package.json index c121084abc..9607f39bfa 100644 --- a/plugins/openapi-router-common/package.json +++ b/plugins/openapi-router-common/package.json @@ -32,6 +32,7 @@ "dependencies": { "@backstage/backend-common": "workspace:^", "express": "^4.17.1", + "express-promise-router": "^4.1.0", "json-schema-to-ts": "^2.6.2", "openapi-types": "^12.1.0", "openapi3-ts": "^3.1.2", diff --git a/plugins/openapi-router-common/src/example.ts b/plugins/openapi-router-common/src/example.ts index f89fe17e3f..798e5ea3b8 100644 --- a/plugins/openapi-router-common/src/example.ts +++ b/plugins/openapi-router-common/src/example.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import express, { Router } from 'express'; +import express from 'express'; +import Router from 'express-promise-router'; import { ApiRouter, DeepWriteable } from './router'; import doc from './schema/petstore'; diff --git a/plugins/openapi-router-common/src/index.ts b/plugins/openapi-router-common/src/index.ts index 3aab4ab1d1..8ca7bd3c5b 100644 --- a/plugins/openapi-router-common/src/index.ts +++ b/plugins/openapi-router-common/src/index.ts @@ -20,5 +20,5 @@ * @packageDocumentation */ -export type { ApiRouter } from './router'; +export type { ApiRouter, DeepWriteable } from './router'; export * from './types'; diff --git a/yarn.lock b/yarn.lock index 5d2931cc57..8c689e4ae9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7801,6 +7801,7 @@ __metadata: "@backstage/backend-common": "workspace:^" "@backstage/cli": "workspace:^" express: ^4.17.1 + express-promise-router: ^4.1.0 json-schema-to-ts: ^2.6.2 openapi-types: ^12.1.0 openapi3-ts: ^3.1.2