OpenApiValidator Class

Definition

Class containing dispatchers to execute validation rules on for Open API document.

public class OpenApiValidator : Microsoft.OpenApi.Services.OpenApiVisitorBase, Microsoft.OpenApi.Validations.IValidationContext
type OpenApiValidator = class
    inherit OpenApiVisitorBase
    interface IValidationContext
Public Class OpenApiValidator
Inherits OpenApiVisitorBase
Implements IValidationContext
Inheritance
OpenApiValidator
Implements

Constructors

OpenApiValidator(ValidationRuleSet)

Create a visitor that will validate an OpenAPIDocument

Properties

CurrentKeys

Properties available to identify context of where an object is within OpenAPI Document

(Inherited from OpenApiVisitorBase)
Errors

Gets the validation errors.

PathString

Pointer to source of validation error in document

(Inherited from OpenApiVisitorBase)
Warnings

Gets the validation warnings.

Methods

AddError(OpenApiValidatorError)

Register an error with the validation context.

AddWarning(OpenApiValidatorWarning)

Register an error with the validation context.

Enter(String)

Allow Rule to indicate validation error occured at a deeper context level.

(Inherited from OpenApiVisitorBase)
Exit()

Exit from path context elevel. Enter and Exit calls should be matched.

(Inherited from OpenApiVisitorBase)
Visit(IDictionary<OperationType,OpenApiOperation>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IDictionary<String,OpenApiCallback>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IDictionary<String,OpenApiEncoding>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IDictionary<String,OpenApiExample>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IDictionary<String,OpenApiHeader>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IDictionary<String,OpenApiLink>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IDictionary<String,OpenApiMediaType>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IDictionary<String,OpenApiServerVariable>)

Execute validation rules against a IDictionary<TKey,TValue>

Visit(IList<OpenApiExample>)

Execute validation rules against a list of OpenApiExample

Visit(IList<OpenApiParameter>)

Visits list of OpenApiParameter

(Inherited from OpenApiVisitorBase)
Visit(IList<OpenApiSecurityRequirement>)

Visits list of OpenApiSecurityRequirement

(Inherited from OpenApiVisitorBase)
Visit(IList<OpenApiServer>)

Visits list of OpenApiServer

(Inherited from OpenApiVisitorBase)
Visit(IList<OpenApiTag>)

Visits list of OpenApiTag

(Inherited from OpenApiVisitorBase)
Visit(IOpenApiExtensible)

Execute validation rules against an IOpenApiExtensible

Visit(IOpenApiExtension)

Execute validation rules against an IOpenApiExtension

Visit(IOpenApiReferenceable)

Visits IOpenApiReferenceable instances that are references and not in components

(Inherited from OpenApiVisitorBase)
Visit(OpenApiCallback)

Execute validation rules against an OpenApiCallback

Visit(OpenApiComponents)

Execute validation rules against an OpenApiComponents

Visit(OpenApiContact)

Execute validation rules against an OpenApiContact

Visit(OpenApiDocument)

Execute validation rules against an OpenApiDocument

Visit(OpenApiEncoding)

Execute validation rules against an OpenApiEncoding

Visit(OpenApiExample)

Execute validation rules against a OpenApiExample

Visit(OpenApiExternalDocs)

Execute validation rules against an OpenApiExternalDocs

Visit(OpenApiHeader)

Execute validation rules against an OpenApiHeader

Visit(OpenApiInfo)

Execute validation rules against an OpenApiInfo

Visit(OpenApiLicense)

Execute validation rules against an OpenApiLicense

Visit(OpenApiLink)

Execute validation rules against a OpenApiLink

Visit(OpenApiMediaType)

Execute validation rules against an OpenApiMediaType

Visit(OpenApiOAuthFlow)

Execute validation rules against an OpenApiOAuthFlow

Visit(OpenApiOperation)

Execute validation rules against a OpenApiOperation

Visit(OpenApiParameter)

Execute validation rules against an OpenApiParameter

Visit(OpenApiPathItem)

Execute validation rules against a OpenApiPathItem

Visit(OpenApiPaths)

Execute validation rules against a OpenApiPaths

Visit(OpenApiRequestBody)

Execute validation rules against a OpenApiRequestBody

Visit(OpenApiResponse)

Execute validation rules against an OpenApiResponse

Visit(OpenApiResponses)

Execute validation rules against an OpenApiResponses

Visit(OpenApiSchema)

Execute validation rules against an OpenApiSchema

Visit(OpenApiSecurityRequirement)

Execute validation rules against a OpenApiSecurityRequirement

Visit(OpenApiSecurityScheme)

Execute validation rules against a OpenApiSecurityScheme

Visit(OpenApiServer)

Execute validation rules against an OpenApiServer

Visit(OpenApiServerVariable)

Execute validation rules against a OpenApiServerVariable

Visit(OpenApiTag)

Execute validation rules against an OpenApiTag

Extension Methods

CreateError(IValidationContext, String, String)

Helper method to simplify validation rules

CreateWarning(IValidationContext, String, String)

Helper method to simplify validation rules

Applies to