Skip to content

Commit 950d429

Browse files
HairyMikeMichael Eller
and
Michael Eller
authored
Remove examples from apiDoc when validating requests (#774)
Co-authored-by: Michael Eller <michael.eller@rakuten.com>
1 parent 01950b7 commit 950d429

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)