improvement: use string not number for amount type in json schema

This commit is contained in:
Zach Daniel 2024-08-08 14:44:42 -04:00
parent 12361fc487
commit 1ff276dc11

View file

@ -284,9 +284,13 @@ defmodule AshMoney.Types.Money do
%{
type: "object",
properties: %{
amount: %{type: "number"},
amount: %{type: "string", pattern: "^-?\\d+(\\.\\d+)?$"},
currency: %{type: "string"}
},
example: %{
amount: "100.00",
currency: "USD"
},
required: ["amount", "currency"]
}
end