Skip to content

Commit 031cd2b

Browse files
HairyMikeMichael Eller
and
Michael Eller
authored
Remove examples from apiDoc when validating requests (#774)
Co-authored-by: Michael Eller <[email protected]>
1 parent 556ea4f commit 031cd2b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/middlewares/openapi.request.validator.ts

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export class RequestValidator {
4242
) {
4343
this.middlewareCache = {};
4444
this.apiDoc = apiDoc;
45+
// Examples not needed for validation
46+
delete this.apiDoc.components.examples;
4547
this.requestOpts.allowUnknownQueryParameters =
4648
options.allowUnknownQueryParameters;
4749
this.ajv = createRequestAjv(apiDoc, { ...options, coerceTypes: true });

0 commit comments

Comments
 (0)