Home IfEnumAttribute Class
IfEnumAttribute Class
Cancel

IfEnumAttribute Class

Namespace: Json.Schema.Generation

Inheritance: IfEnumAttribute 🡒 ConditionalAttribute 🡒 Attribute 🡒 object

Implemented interfaces:

  • INestableAttribute
  • IConditionalAttribute

Creates multiple condition groups based on the value of an enum property, one group for each defined enum value.

Remarks

The enum type is inferred from the property.

Properties

NameTypeSummary
ConditionGroupobjectIdentifies the condition group under which this attribute applies.
GenericParameterintThe index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
PropertyNamestringThe property name.
TypeIdobject 
UseNumbersboolGets or sets whether to use numbers or names in the condition. Default is to use names.

Constructors

IfEnumAttribute(string propertyName, bool useNumbers)

Creates a new Json.Schema.Generation.IfEnumAttribute instance.

Declaration

1
public IfEnumAttribute(string propertyName, bool useNumbers)
ParameterTypeDescription
propertyNamestringThe property name.
useNumbersbool(optional) Whether to use numbers or names in the condition. Default is to use names.
Contents