Skip to content

Commit

Permalink
component param refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Jul 4, 2019
1 parent f3b873b commit 618640b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/middlewares/openapi.request.validator.ts
Expand Up @@ -46,6 +46,18 @@ export function validateRequest({ apiDoc, loggingKey, enableObjectCoercion }) {
}).coerce(req);
}

const componentParameters = apiDoc.components
? apiDoc.components.parameters
: undefined;
for (let i=0; i < schema.parameters.length; i++) {
const a = schema.parameters[i];
if (a.$ref) {
const id = a.$ref.replace('#/components/parameters/','');
schema.parameters[i] = componentParameters[id];
console.log()
}
}

const validationResult = new OpenAPIRequestValidator({
// TODO create custom error transformere here as there are a lot of props we can utilize
// errorTransformer,
Expand Down

0 comments on commit 618640b

Please sign in to comment.