Normandy.Components.BaseIOSchema protocol (normandy v2.2.0)

View Source

How a value goes to the model: to_json/1 encodes it (a string, or a list of content blocks), and get_schema/1 returns its schema. Implemented for strings, maps, lists, content blocks and every io_schema struct.

Summary

Types

t()

All the types that implement this protocol.

Functions

Returns the schema definition for the struct

Converts the struct to a JSON string

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

get_schema(struct)

@spec get_schema(t()) :: term()

Returns the schema definition for the struct

to_json(struct)

@spec to_json(t()) :: String.t() | list()

Converts the struct to a JSON string