annotate

photonforge.typing.annotate(field, **kwargs)[source]

Annotate a type with metadata.

Parameters:
  • field – Type to be annotated.

  • kwargs – Type metadata. See below.

Returns:

Annotated type.

Type metadata closely resembles specifications for JSON Schema DRAFT7 with a few additions. A few commonly used keywords are: label, description, units, maximum, minimum, exclusiveMaximum, exclusiveMinimum, maxItems, minItems, maxLength, and minLength.