datamodel-code-generator
datamodel-code-generator copied to clipboard
Support `multipleOfPrecision`
Is your feature request related to a problem? Please describe.
Sometimes there is a need to have some way of representing money. JSON Schema offers multipleOfPrecision which could be used to limit possible values.
Describe the solution you'd like
I think if JSON Schema contains multipleOfPrecision, then such number should be converted to ConstrainedDecimal offered by Pydantic. Currently datamodel-code-generator ignores multipleOfPrecision.
Describe alternatives you've considered n/d
Additional context https://stackoverflow.com/questions/27260587/decimal-precision-in-json-schema
https://stackoverflow.com/questions/54961638/what-are-some-ways-to-restrict-the-decimal-places-in-json-schema
https://stackoverflow.com/questions/40886252/defining-a-json-schema-currency-type