Kungfuig.Validator behaviour (Kungfuig v1.1.1)
View SourceGeneric validator encapsulation.
Default implementation is
NimbleOptions
.
Example
defmodule TemperatureValidator do
@moduledoc false
use Kungfuig.Validator, schema: [
city: [type: :string, required: true],
temperature: [type: :integer, required: false]
]
end
Summary
Callbacks
Generates a documentation for expected options
Validates given options with the schema, provided by the implementation of this behaviour