Home IfMaxAttribute Class
IfMaxAttribute Class
Cancel

IfMaxAttribute Class

Namespace: Json.Schema.Generation

Inheritance: IfMaxAttribute 🡒 ConditionalAttribute 🡒 Attribute 🡒 object

Implemented interfaces:

  • IConditionAttribute

Creates or amends a condition group by defining an expected maximum value in a property.

Remarks

The specific keywords which are added depend on the type of the targeted property.

Properties

NameTypeSummary
ConditionGroupobjectIdentifies the condition group under which this attribute applies.
IsExclusiveboolGets or sets whether the value should be exclusive.
PropertyNamestringThe property name.
TypeIdobject 
ValuedoubleThe expected maximum value.

Constructors

IfMaxAttribute(string propertyName, double value, object group)

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

Declaration

1
public IfMaxAttribute(string propertyName, double value, object group)
ParameterTypeDescription
propertyNamestringThe name of the property.
valuedoubleThe expected maximum value for the property.
groupobjectThe condition group.

Remarks

The parameter is provided as a double but stored as a decimal because decimal is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the decimal range prior to being converted when applied as the maximum or exclusiveMaximum keywords.

Contents