jsonschema.attributes

Schema-constraint UDAs for the compile-time generator (jsonSchemaOf). Attach these to struct fields to emit the matching JSON Schema keywords onto the field's property schema.

Members

Functions

schemaDefault
SchemaDefault!T schemaDefault(T value)

Factory producing the @schemaDefault UDA: @schemaDefault(10) int limit;

Structs

SchemaDefault
struct SchemaDefault(T)

The payload struct carrying a @schemaDefault value. Construct it via the schemaDefault(value) factory so the value type is inferred; the generator detects it with isInstanceOf!(SchemaDefault, UDA).

fieldDescription
struct fieldDescription

Emits the JSON Schema description keyword. Named fieldDescription to stay unambiguous at the call site (and clear of std.traits names).

format
struct format

Emits the JSON Schema format keyword (e.g. "email", "uri", "date-time").

maxItems
struct maxItems

Emits the JSON Schema maxItems keyword (maximum array length).

maxLength
struct maxLength

Emits the JSON Schema maxLength keyword (maximum string length).

maximum
struct maximum

Emits the JSON Schema maximum keyword (inclusive numeric upper bound).

minItems
struct minItems

Emits the JSON Schema minItems keyword (minimum array length).

minLength
struct minLength

Emits the JSON Schema minLength keyword (minimum string length).

minimum
struct minimum

Emits the JSON Schema minimum keyword (inclusive numeric lower bound).

pattern
struct pattern

Emits the JSON Schema pattern keyword (ECMA-262 regular expression).

title
struct title

Emits the JSON Schema title keyword.