Helper module shared by OzMcp.Structs.EnumSchema and
OzMcp.Structs.MultiSelectEnumSchema.
An option is a string ("red"), a {value, title} tuple, or a map with
the keys :const / "const" and :title / "title". A list where no
option has a title is rendered as enum; as soon as one option has a
title, the list is rendered as {const, title} pairs (a missing title
defaults to the value).
Summary
Functions
Normalizes the options to a list of {value, title | nil}. Raises
ArgumentError when the list is empty, an option is invalid, or a value
is repeated.
Renders normalized options: {:enum, values} or {:titled, [%{const:, title:}]}.
The values of normalized options.
Types
Functions
Normalizes the options to a list of {value, title | nil}. Raises
ArgumentError when the list is empty, an option is invalid, or a value
is repeated.
Renders normalized options: {:enum, values} or {:titled, [%{const:, title:}]}.
The values of normalized options.