Shared NimbleOptions custom validators for collection schemas.
YAML frontmatter arrives with string keys and loosely-typed values; these validators normalise into the typed shapes the rest of the pipeline relies on, with error messages that read well after the schema prefixes the source file and field.
Summary
Functions
Validates a cv: curation block (DESIGN.md §4): include, weight,
highlights. Returns a Cherry.Portfolio.Curation struct with defaults.
Accepts a Date or an ISO 8601 string.
Validates a links: list: each entry a map with label and url.
Returns Cherry.Portfolio.Link structs in the given order.
Functions
@spec validate_cv(term()) :: {:ok, Cherry.Portfolio.Curation.t()} | {:error, String.t()}
Validates a cv: curation block (DESIGN.md §4): include, weight,
highlights. Returns a Cherry.Portfolio.Curation struct with defaults.
Accepts a Date or an ISO 8601 string.
@spec validate_links(term()) :: {:ok, [Cherry.Portfolio.Link.t()]} | {:error, String.t()}
Validates a links: list: each entry a map with label and url.
Returns Cherry.Portfolio.Link structs in the given order.