Skip to content

Commit

Permalink
Add strict option to README
Browse files Browse the repository at this point in the history
  • Loading branch information
abelino committed Oct 9, 2024
1 parent 8369a79 commit 24776ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ attribute :metadata do
attribute :commissioned_at, :datetime

attribute :ports do
attribute :rs485, :integer
attribute :rs485, :integer, strict: true
end
end

Expand All @@ -116,6 +116,7 @@ end

- `struct` - Name of the Elixir struct this schema will compile to.
- `name` (optional) - Name of this message or event on the wire.
- `strict` (optional) - Set `true` if enforcing value type for all attributes.
- `attribute` - An attribute in the input payload. These could also be known as fields, properties, keys.

### Attributes
Expand Down Expand Up @@ -143,6 +144,8 @@ Lists:
- Create a list of any type by wrapping the type in square brackets: `[string]`

Options:
- `strict` - Set `true` if enforcing value type instead of best attempt to coerce.
- error - `wrong_type`
- `default` - The default value is used if the value is not present in the input.
- `optional` - Set `true` if a value for the attribute is not required.
- error - `not_present`
Expand Down

0 comments on commit 24776ec

Please sign in to comment.