Mentor.Ecto.Type behaviour (mentor v0.2.2)
View SourceMentor.Ecto.Type
is a behaviour that lets your implement your own custom Ecto.Type
that works natively with Instructor.
Example
defmodule MyCustomType do
use Ecto.Type
use Mentor.Ecto.Type
# ... See `Ecto.Type` for implementation details
def to_json_schema do
%{
type: "string",
format: "email"
}
end
end
Summary
Callbacks
@callback to_json_schema() :: map()