C# Класс Swashbuckle.Annotations.SwagValidator

Validates the attribute tag validations declared on the class
Показать файл Открыть проект

Открытые методы

Метод Описание
TryValidate ( object input, string &errorMessage, bool outputJsonPayload = false ) : bool

Validates the attribute tag validations declared on the class. Returns false if validation rules are not met and returns the error message in the errorMessage (out) parameter

Validate ( object input, bool outputJsonPayload = false ) : bool

Validates the attribute tag validations declared on the class. Throws an ValidationException if any validation rules are not met

Приватные методы

Метод Описание
CheckDefinedExAttribute ( PropertyInfo property, object input, bool outputJsonPayload ) : void

Checks the Defined attribute.

CheckList ( object input, bool outputJsonPayload = false ) : bool
CheckListProperty ( object input, PropertyInfo prp, bool outputJsonPayload = false ) : void
CheckMaxLengthAttribute ( PropertyInfo property, object input, bool outputJsonPayload ) : void
CheckMinLengthAttribute ( PropertyInfo property, object input, bool outputJsonPayload ) : void
CheckRangeAttribute ( PropertyInfo property, object input, bool outputJsonPayload ) : void
CheckRegularExpressionAttribute ( PropertyInfo property, object input, bool outputJsonPayload ) : void

Checks the Defined attribute.

CheckRequiredAttribute ( PropertyInfo property, object input, bool outputJsonPayload ) : void
CheckStringLengthAttribute ( PropertyInfo property, object input, bool outputJsonPayload ) : void
IsPrimitiveType ( object myObject ) : bool
ObjReqChecker ( object input, PropertyInfo prp, bool outputJsonPayload = false ) : void

Описание методов

TryValidate() публичный статический Метод

Validates the attribute tag validations declared on the class. Returns false if validation rules are not met and returns the error message in the errorMessage (out) parameter
public static TryValidate ( object input, string &errorMessage, bool outputJsonPayload = false ) : bool
input object The object you wish to validate
errorMessage string The error message
outputJsonPayload bool If you want the error message to contain the values in the object we are validating
Результат bool

Validate() публичный статический Метод

Validates the attribute tag validations declared on the class. Throws an ValidationException if any validation rules are not met
public static Validate ( object input, bool outputJsonPayload = false ) : bool
input object The object you wish to validate
outputJsonPayload bool If true will output the contents of input payload in the exception
Результат bool