Table of Contents

InvalidJsonDocument Method

Definition

Namespace
Codebelt.Extensions.Newtonsoft.Json
Assemblies
Codebelt.Extensions.Newtonsoft.Json.dll
Source
src/Codebelt.Extensions.Newtonsoft.Json/ValidatorExtensions.cs

InvalidJsonDocument(Validator, string, string, string)

Validates and throws an ArgumentException if the specified argument is not a valid JSON representation as specified in RFC 8259.

public static void InvalidJsonDocument(this Validator _, string argument, string message = "Value must be a JSON representation that complies with RFC 8259.", string paramName = null)

Parameters

_ Validator

The Validator to extend.

argument string

The JSON string to be evaluated.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Exceptions

ArgumentException

argument must be a JSON representation that complies with RFC 8259.

InvalidJsonDocument(Validator, ref JsonReader, string, string)

Validates and throws an ArgumentException if the specified argument is not a valid JSON representation as specified in RFC 8259.

public static void InvalidJsonDocument(this Validator _, ref JsonReader argument, string message = "Value must be a JSON representation that complies with RFC 8259.", string paramName = null)

Parameters

_ Validator

The Validator to extend.

argument JsonReader

The Newtonsoft.Json.JsonReader to be evaluated.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Exceptions

ArgumentException

argument must be a JSON representation that complies with RFC 8259.