Skip to content

Commit

Permalink
chore: bump to upstream version of openapi (#197)
Browse files Browse the repository at this point in the history
* chore: bump to upstream version of openapi

* chore(lint): biome format
  • Loading branch information
chriswk authored Oct 2, 2024
1 parent 6e9c52d commit 28b0cf4
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 100 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"homepage": "https://github.com/Unleash/unleash-proxy#readme",
"dependencies": {
"@unleash/express-openapi": "^0.3.0",
"@wesleytodd/openapi": "^1.1.0",
"compression": "^1.7.4",
"cors": "^2.8.5",
"express": "^4.21.0",
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference path="./types/openapi.d.ts" />

import { createApp } from './app';
import Client from './client';
import { createProxyConfig } from './config';
Expand Down
4 changes: 2 additions & 2 deletions src/openapi/openapi-service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import openapi, { type IExpressOpenApi } from '@unleash/express-openapi';
import openapi, { type IExpressOpenApi } from '@wesleytodd/openapi';
import type { Application, RequestHandler } from 'express';
import type { OpenAPIV3 } from 'openapi-types';
import { createOpenApiSchema } from '.';
Expand Down Expand Up @@ -30,7 +30,7 @@ export class OpenApiService {
// and the OpenAPI SwaggerUI at `${this.docsPathPath}`.
useDocs(app: Application): void {
app.use(this.api);
app.use(this.docsPath(), this.api.swaggerui);
app.use(this.docsPath(), this.api.swaggerui());
}

// Create request validation middleware
Expand Down
4 changes: 2 additions & 2 deletions src/types/openapi.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Partial types for "@unleash/express-openapi".
declare module '@unleash/express-openapi' {
declare module '@wesleytodd/openapi' {
import type { RequestHandler } from 'express';

export interface IExpressOpenApi extends RequestHandler {
validPath: (operation: OpenAPIV3.OperationObject) => RequestHandler;
schema: (name: string, schema: OpenAPIV3.SchemaObject) => void;
swaggerui: RequestHandler;
swaggerui: () => RequestHandler;
}

export default function openapi(
Expand Down
Loading

0 comments on commit 28b0cf4

Please sign in to comment.