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 number format in DecimalField #906

Open
zuerst opened this issue Nov 25, 2024 · 0 comments
Open

Add number format in DecimalField #906

zuerst opened this issue Nov 25, 2024 · 0 comments

Comments

@zuerst
Copy link

zuerst commented Nov 25, 2024

Feature Request

Description

Django models.DecimalField produces type number, format:decimal but the format decimal is not an officially supported OpenAPI type. Available types are float or double

rate = models.DecimalField(max_digits=6, decimal_places=4, blank=True, null=True)
      rate:
        title: Rate
        type: number
        format: decimal
        default: 0.0
        minimum: 0.0

Describe the solution you'd like

rate = models.DecimalField(max_digits=6, decimal_places=4, blank=True, null=True)

      rate:
        title: Rate
        type: number
        format: decimal
        default: 0.0
        minimum: 0.0
rate = models.DecimalField(max_digits=6, decimal_places=4, blank=True, null=True, number_format='float')

      rate:
        title: Rate
        type: number
        format: float
        default: 0.0
        minimum: 0.0
rate = models.DecimalField(max_digits=6, decimal_places=4, blank=True, null=True, number_format='double')

      rate:
        title: Rate
        type: number
        format: double
        default: 0.0
        minimum: 0.0
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