Skip to contents

Create a model field

Usage

model_field(
  fn,
  default = NA,
  optional = FALSE,
  alias = NULL,
  error_msg = NULL,
  ...
)

Arguments

fn

A type check function.

default

A default value for the field.

optional

Whether the field is optional.

alias

alias that can be used in model_dump()

error_msg

A custom error message.

...

not used at the moment

Value

A model field.