JsonSchema Class

Implements a JSON schema.

public class JsonSchema : FailsafeSchema

Remarks

The JSON schema is the lowest common denominator of most modern computer languages, and allows parsing JSON files. A YAML processor should therefore support this schema, at least as an option. It is also strongly recommended that other schemas should be based on it. .

Inheritance
FailsafeSchema JsonSchema

Constructors

NameDescription
JsonSchema()Initializes a new instance of the JsonSchema class.

JsonSchema()

JsonSchema.cs

Initializes a new instance of the JsonSchema class.

public JsonSchema()

Methods

NameDescription
DecodeInteger(Match)Decodes a matched integer scalar into an Int32, Int64, or UInt64.
PrepareScalarRules()Registers scalar resolution rules for the JSON schema.

DecodeInteger(Match)

JsonSchema.cs

Decodes a matched integer scalar into an Int32, Int64, or UInt64.

protected static object DecodeInteger(Match m)

Parameters

m Match

Returns

object

Remarks

A scalar too large for any of those types is decoded as a Double: tag resolution classifies a scalar by its spelling, so an unrepresentable value must not fail the surrounding TryParse call.

PrepareScalarRules()

JsonSchema.cs

Registers scalar resolution rules for the JSON schema.

protected override void PrepareScalarRules()

Constants

NameDescription
BoolLongTagThe bool long tag: tag:yaml.org,2002:bool
BoolShortTagThe bool short tag: !!bool
FloatLongTagThe float long tag: tag:yaml.org,2002:float
FloatShortTagThe float short tag: !!float
IntLongTagThe int long tag: tag:yaml.org,2002:int
IntShortTagThe int short tag: !!int
NullLongTagThe null long tag: tag:yaml.org,2002:null
NullShortTagThe null short tag: !!null

BoolLongTag

The bool long tag: tag:yaml.org,2002:bool

public const string BoolLongTag = "tag:yaml.org,2002:bool"

BoolShortTag

The bool short tag: !!bool

public const string BoolShortTag = "!!bool"

FloatLongTag

The float long tag: tag:yaml.org,2002:float

public const string FloatLongTag = "tag:yaml.org,2002:float"

FloatShortTag

The float short tag: !!float

public const string FloatShortTag = "!!float"

IntLongTag

The int long tag: tag:yaml.org,2002:int

public const string IntLongTag = "tag:yaml.org,2002:int"

IntShortTag

The int short tag: !!int

public const string IntShortTag = "!!int"

NullLongTag

The null long tag: tag:yaml.org,2002:null

public const string NullLongTag = "tag:yaml.org,2002:null"

NullShortTag

The null short tag: !!null

public const string NullShortTag = "!!null"