![]() |
VOOZH | about |
RangeAttributeHandler Class
Namespace: Json.Schema.Generation.DataAnnotations
Inheritance: RangeAttributeHandler 🡒 object
Implemented interfaces:
Adds minimum and maximum keywords.
Only numeric types are supported.
Processes the type and any attributes (present on the context), and adds intents to the context.
1
public void AddConstraints(SchemaGenerationContextBase context, Attribute attribute)
| Parameter | Type | Description |
|---|---|---|
| context | SchemaGenerationContextBase | The generation context. |
| attribute | Attribute | The attribute. |
A common pattern is to implement Json.Schema.Generation.IAttributeHandler on the attribute itself. In this case, the parameter will be the same instance as the handler and can likely be ignored.
Applies constraints for source generation.
1
public static JsonSchemaBuilder Apply(JsonSchemaBuilder builder, object minimum, object maximum)
| Parameter | Type | Description |
|---|---|---|
| builder | JsonSchemaBuilder | The schema builder. |
| minimum | object | The minimum value. |
| maximum | object | The maximum value. |
The builder for chaining.
A new version of content is available.