How to use openapi-response-validator - 1 common examples

To help you get started, we’ve selected a few openapi-response-validator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kogosoftwarellc / open-api / packages / openapi-framework / index.ts View on Github external
if (operationContext.allowsFeatures) {
            // add features
            if (
              operationDoc.responses &&
              allowsResponseValidationFeature(
                this,
                this.apiDoc,
                pathModule,
                pathDoc,
                operationDoc
              )
            ) {
              // add response validation feature
              // it's invalid for a method doc to not have responses, but the post
              // validation will pick it up, so this is almost always going to be added.
              const responseValidator = new OpenAPIResponseValidator({
                loggingKey: `${this.name}-response-validation`,
                components: this.apiDoc.components,
                definitions: this.apiDoc.definitions,
                externalSchemas: this.externalSchemas,
                errorTransformer: this.errorTransformer,
                responses: resolveResponseRefs(
                  this,
                  operationDoc.responses,
                  this.apiDoc,
                  route
                ),
                customFormats: this.customFormats
              });

              operationContext.features.responseValidator = responseValidator;
            }

openapi-response-validator

Validate a response according to an openapi schema.

MIT
Latest version published 11 months ago

Package Health Score

72 / 100
Full package analysis

Popular openapi-response-validator functions