spectra_json_schema (spectra v0.7.0)

View Source

Summary

Types

json_schema/0

-type json_schema() ::
          #{'$schema' => binary(),
            title => binary(),
            description => binary(),
            examples => [json:encode_value()],
            type => binary(),
            format => binary(),
            minLength => pos_integer(),
            minimum => integer(),
            maximum => integer(),
            enum => [null | binary() | integer() | boolean() | []],
            items => json_schema_object(),
            minItems => pos_integer(),
            oneOf => [json_schema_object()],
            properties => #{binary() => json_schema_object()},
            required => [binary()],
            additionalProperties => boolean()}.

json_schema_object/0

-type json_schema_object() ::
          #{type => binary(),
            format => binary(),
            minLength => pos_integer(),
            minimum => integer(),
            maximum => integer(),
            enum => [null | binary() | integer() | boolean() | []],
            items => json_schema_object(),
            minItems => pos_integer(),
            oneOf => [json_schema_object()],
            properties => #{binary() => json_schema_object()},
            required => [binary()],
            additionalProperties => boolean(),
            title => binary(),
            description => binary(),
            examples => [json:encode_value()]}.

Functions

to_schema(Module, Type)