What Express reads from a catalog: each component's properties in positional order, each function's parameters, and the facts about a property's schema that decide how an argument compiles.
A component's positional order is its own properties in the order its
schema declares them, then the properties it inherits through allOf,
leaving out id, component and catalogId. A component can take
checks when it declares a property holding a list of CheckRules, or
inherits one from a common type such as Checkable; an inherited
check property comes last.
The helper reads the catalog document (A2UICore.Catalog.to_json/2,
in the order it was read) with its local and peer references written
inline, and resolves references to the common types against the common
types of the protocol version it is built for.
Summary
Functions
Whether a property takes an action: its schema refers to the common
Action type, directly or through allOf, oneOf or anyOf.
Whether a value written for schema may be a data binding: the
schema, or one it reaches through $ref, allOf, oneOf or anyOf,
is an object schema with a path or @path property.
The helpers for catalogs, in order, built for protocol version.
The catalogs are first linked to each other
(A2UICore.Catalog.link_catalogs/1), so that references between them
resolve.
The property a component's checks go in, or nil if it takes none.
The name of the common type a $ref points to
(common_types.json#/$defs/<Name>, also as an absolute URL or under
definitions), or nil.
Whether the catalog defines component name.
A component's description, from its schema or the first allOf member that has one.
A component's properties in positional order.
The properties a component requires.
Whether the catalog defines function name.
A function's description, or nil.
A function's parameters in positional order.
The schema of a function parameter, or nil.
The parameters a function requires.
The helper for one catalog, built for protocol version.
Whether a property holds a list of option objects (items with label
and value properties), so that plain strings are written as options.
The values a component property's schema enumerates, or nil.
The schema of a component property, or nil.
The keys that mark a data binding and a function call in version:
@path and @call from v1.0, path and call before.
The schema at key below schema: the item schema for "items",
else the schema of property key (or of any additional property),
found through $ref, allOf, oneOf and anyOf. nil when the
schema declares none.
Types
@type t() :: %A2UIAgent.Express.SchemaHelper{ catalog: A2UICore.Catalog.t(), catalog_id: String.t(), check_properties: %{optional(String.t()) => String.t()}, common_defs: term(), component_names: [String.t()], component_properties: %{optional(String.t()) => [String.t()]}, component_required: %{optional(String.t()) => [String.t()]}, components: %{optional(String.t()) => term()}, document: term(), function_names: [String.t()], function_properties: %{optional(String.t()) => [String.t()]}, function_required: %{optional(String.t()) => [String.t()]}, functions: %{optional(String.t()) => term()}, inherited_check_schemas: %{optional(String.t()) => term()}, keys: %{path: String.t(), call: String.t()}, property_enums: %{optional({String.t(), String.t()}) => list()} }
Functions
Whether a property takes an action: its schema refers to the common
Action type, directly or through allOf, oneOf or anyOf.
Whether a value written for schema may be a data binding: the
schema, or one it reaches through $ref, allOf, oneOf or anyOf,
is an object schema with a path or @path property.
@spec build_all([A2UICore.Catalog.t()], String.t()) :: [t()]
The helpers for catalogs, in order, built for protocol version.
The catalogs are first linked to each other
(A2UICore.Catalog.link_catalogs/1), so that references between them
resolve.
The property a component's checks go in, or nil if it takes none.
The name of the common type a $ref points to
(common_types.json#/$defs/<Name>, also as an absolute URL or under
definitions), or nil.
iex> A2UIAgent.Express.SchemaHelper.common_def_name("common_types.json#/$defs/Action")
"Action"
iex> A2UIAgent.Express.SchemaHelper.common_def_name("#/$defs/Action")
nil
Whether the catalog defines component name.
A component's description, from its schema or the first allOf member that has one.
A component's properties in positional order.
The properties a component requires.
Whether the catalog defines function name.
A function's description, or nil.
A function's parameters in positional order.
The schema of a function parameter, or nil.
The parameters a function requires.
@spec new(A2UICore.Catalog.t(), String.t()) :: t()
The helper for one catalog, built for protocol version.
Whether a property holds a list of option objects (items with label
and value properties), so that plain strings are written as options.
The values a component property's schema enumerates, or nil.
The schema of a component property, or nil.
The keys that mark a data binding and a function call in version:
@path and @call from v1.0, path and call before.
The schema at key below schema: the item schema for "items",
else the schema of property key (or of any additional property),
found through $ref, allOf, oneOf and anyOf. nil when the
schema declares none.