mirror of
https://github.com/ash-project/ash_money.git
synced 2024-09-19 21:02:55 +12:00
improvement: use string
not number
for amount type in json schema
This commit is contained in:
parent
12361fc487
commit
1ff276dc11
1 changed files with 5 additions and 1 deletions
|
@ -284,9 +284,13 @@ defmodule AshMoney.Types.Money do
|
||||||
%{
|
%{
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: %{
|
properties: %{
|
||||||
amount: %{type: "number"},
|
amount: %{type: "string", pattern: "^-?\\d+(\\.\\d+)?$"},
|
||||||
currency: %{type: "string"}
|
currency: %{type: "string"}
|
||||||
},
|
},
|
||||||
|
example: %{
|
||||||
|
amount: "100.00",
|
||||||
|
currency: "USD"
|
||||||
|
},
|
||||||
required: ["amount", "currency"]
|
required: ["amount", "currency"]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue