Skip to content

Commit

Permalink
type cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Nov 25, 2019
1 parent 5b576de commit d549a2a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/framework/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class OpenAPIFramework {
private readonly validateApiDoc: boolean;
private readonly validator: OpenAPISchemaValidator;
private readonly basePathObs: BasePath[];
private readonly loggingPrefix = 'openapi.validator: ';
private readonly loggingPrefix: string = 'openapi.validator: ';

constructor(args: OpenAPIFrameworkArgs) {
this.apiDoc = this.copy(this.loadSpec(args.apiDoc));
Expand Down
2 changes: 1 addition & 1 deletion src/framework/openapi.schema.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as openapi3Schema from './openapi.v3.schema.json';

export class OpenAPISchemaValidator {
private validator: Ajv.ValidateFunction;
constructor({ version, extensions }: { version: string; extensions?: any }) {
constructor({ version, extensions }: { version: string; extensions?: object }) {
const v = new Ajv({ schemaId: 'auto', allErrors: true });
v.addMetaSchema(draftSchema);

Expand Down
5 changes: 3 additions & 2 deletions src/middlewares/openapi.metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { pathToRegexp } from 'path-to-regexp';
import * as _ from 'lodash';
import { pathToRegexp } from 'path-to-regexp';
import { Response, NextFunction } from 'express';
import { OpenApiContext } from '../framework/openapi.context';
import {
OpenApiRequest,
Expand All @@ -10,7 +11,7 @@ import {
export function applyOpenApiMetadata(
openApiContext: OpenApiContext,
): OpenApiRequestHandler {
return (req: OpenApiRequest, res, next): any => {
return (req: OpenApiRequest, res: Response, next: NextFunction): any => {
const matched = lookupRoute(req);
if (matched) {
const { expressRoute, openApiRoute, pathParams, schema } = matched;
Expand Down

0 comments on commit d549a2a

Please sign in to comment.