Skip to content

Commit

Permalink
type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Dec 1, 2019
1 parent 7464364 commit 9267dca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/middlewares/openapi.request.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ import {
augmentAjvErrors,
} from './util';
import ono from 'ono';
import { NextFunction, Response } from 'express';
import { NextFunction, RequestHandler, Response } from 'express';
import {
OpenAPIV3,
OpenApiRequest,
RequestValidatorOptions,
ValidateRequestOpts,
OpenApiRequestMetadata,
} from '../framework/types';
import { HandleFunction } from 'connect';

const TYPE_JSON = 'application/json';

export class RequestValidator {
private _middlewareCache: { string?: (string) => HandleFunction } = {};
private _middlewareCache: { [key: string]: RequestHandler } = {};
private _apiDocs: OpenAPIV3.Document;
private ajv: Ajv;
private _requestOpts: ValidateRequestOpts = {};
Expand Down Expand Up @@ -81,7 +80,7 @@ export class RequestValidator {
path: string,
pathSchema: OpenAPIV3.OperationObject,
contentType: ContentType,
): HandleFunction {
): RequestHandler {
const parameters = this.parametersToSchema(path, pathSchema.parameters);

let usedSecuritySchema: OpenAPIV3.SecurityRequirementObject[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/openapi.security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class AuthValidator {
}

class Util {
static isEmptyObject(o: {}) {
static isEmptyObject(o: {}): boolean {
return (
typeof o === 'object' &&
Object.entries(o).length === 0 &&
Expand Down

0 comments on commit 9267dca

Please sign in to comment.