Home MaximumAttribute Class
MaximumAttribute Class
Cancel

MaximumAttribute Class

Namespace: Json.Schema.Generation

Inheritance: MaximumAttribute 🡒 ConditionalAttribute 🡒 Attribute 🡒 object

Implemented interfaces:

  • INestableAttribute
  • IAttributeHandler

Applies a maximum keyword.

Remarks

The value parameter is provided in the constructor 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.

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.
TypeIdobject 
ValuedecimalThe maximum.

Constructors

MaximumAttribute(double value, bool useNet10CompatibleRounding)

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

Declaration

1
public MaximumAttribute(double value, bool useNet10CompatibleRounding)
ParameterTypeDescription
valuedoubleThe value.
useNet10CompatibleRoundingbool(.Net 11 only) >true forces .Net 10 and earlier rounding from >double to >decimal

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.

Contents