Home EnumKeyword Class
EnumKeyword Class
Cancel

EnumKeyword Class

Namespace: Json.Schema

Inheritance: EnumKeyword 🡒 object

Implemented interfaces:

  • IJsonSchemaKeyword

Handles enum.

Fields

NameTypeSummary
NamestringThe JSON name of the keyword.

Properties

NameTypeSummary
RequireUniqueValuesboolGets or sets whether the keyword will check for unique values when deserializing.
ValuesIReadOnlyList<JsonNode>The collection of enum values.

Constructors

EnumKeyword(params JsonNode[] values)

Creates a new Json.Schema.EnumKeyword.

Declaration

1
public EnumKeyword(params JsonNode[] values)
ParameterTypeDescription
valuesparams JsonNode[]The collection of enum values.

EnumKeyword(IEnumerable<JsonNode> values)

Creates a new Json.Schema.EnumKeyword.

Declaration

1
public EnumKeyword(IEnumerable<JsonNode> values)
ParameterTypeDescription
valuesIEnumerable<JsonNode>The collection of enum values.

Methods

GetConstraint(SchemaConstraint schemaConstraint, ReadOnlySpan<KeywordConstraint> localConstraints, EvaluationContext context)

Builds a constraint object for a keyword.

Declaration

1
public KeywordConstraint GetConstraint(SchemaConstraint schemaConstraint, ReadOnlySpan<KeywordConstraint> localConstraints, EvaluationContext context)
ParameterTypeDescription
schemaConstraintSchemaConstraintThe Json.Schema.SchemaConstraint for the schema object that houses this keyword.
localConstraintsReadOnlySpan<KeywordConstraint>The set of other Json.Schema.KeywordConstraints that have been processed prior to this one. Will contain the constraints for keyword dependencies.
contextEvaluationContextThe Json.Schema.EvaluationContext.

Returns

A constraint object.

Contents