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

Add support for communicating BigDecimal scale/precision using multipleOf #264

Open
JohannesRudolph opened this issue Mar 19, 2024 · 0 comments

Comments

@JohannesRudolph
Copy link

I'm producing a JSON schema for a service that needs to communicate the precision of BigDecimal numbers.
This allows client generators to pick the right data type (i.e. not pick a float but a decimal data type).

The multipleOf keyword is the right one for this, e.g. https://swagger.io/docs/specification/data-models/data-types/

This is the kind of API spec I want to produce

type: number
multipleOf: 0.01

I have not found any annotation that I can use right now to do this. Maybe making this similar to Bean Validation Constraints would be an option.

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