Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump to upstream version of openapi #197

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading