Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multipleOfPrecision #760

Open
karolzlot opened this issue May 7, 2022 · 0 comments
Open

Support multipleOfPrecision #760

karolzlot opened this issue May 7, 2022 · 0 comments

Comments

@karolzlot
Copy link

karolzlot commented May 7, 2022

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

@karolzlot karolzlot changed the title Support multipleOfPrecision Support Decimal and multipleOfPrecision May 7, 2022
@karolzlot karolzlot changed the title Support Decimal and multipleOfPrecision Support multipleOfPrecision May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant