Skip to content

Commit

Permalink
Remove examples from apiDoc when validating requests (#774)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Eller <[email protected]>
  • Loading branch information
HairyMike and Michael Eller authored Aug 16, 2023
1 parent 01950b7 commit 950d429
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/middlewares/openapi.request.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export class RequestValidator {
) {
this.middlewareCache = {};
this.apiDoc = apiDoc;
// Examples not needed for validation
delete this.apiDoc.components.examples;
this.requestOpts.allowUnknownQueryParameters =
options.allowUnknownQueryParameters;
this.ajv = createRequestAjv(apiDoc, { ...options, coerceTypes: true });
Expand Down

0 comments on commit 950d429

Please sign in to comment.