A2UICore.Catalog.Component (A2UICore v0.1.1)

Copy Markdown View Source

A component a catalog declares: the name a message uses and its JSON Schema as the catalog document writes it (with its allOf mixins and references), plus the v1.0 composition constraints (allowedParents, allowedChildren).

:from_document says the schema was read from a catalog document, so A2UICore.Catalog.to_json/1 writes it back exactly; for a component defined in code, local references to common types point at the common types document instead.

Summary

Functions

Builds a component from a catalog document entry.

Types

t()

(since 0.1.0)
@type t() :: %A2UICore.Catalog.Component{
  allowed_children: [String.t()] | nil,
  allowed_parents: [String.t()] | nil,
  from_document: boolean(),
  name: String.t(),
  schema: map()
}

Functions

from_schema(name, schema, options \\ [])

(since 0.1.0)
@spec from_schema(String.t(), map(), keyword()) :: t()

Builds a component from a catalog document entry.

Options: from_document: true marks a schema read from a document.