Lightning.Credentials.Schema (Lightning v2.13.5-pre)

View Source

Structure that can parse JsonSchemas (using ExJsonSchema) and validate changesets for a given schema.

Summary

Types

t()

@type t() :: %Lightning.Credentials.Schema{
  fields: [String.t()],
  name: String.t() | nil,
  root: ExJsonSchema.Schema.Root.t(),
  types: Ecto.Changeset.types()
}

Functions

new(body, name \\ nil)

@spec new(
  json_schema :: %{required(String.t()) => any()} | binary(),
  name :: String.t() | nil
) :: t()

properties(schema, field)

required?(schema, field)

validate(changeset, schema)

@spec validate(changeset :: Ecto.Changeset.t(), schema :: t()) :: Ecto.Changeset.t()