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

- adds decimal format #3190

Merged
merged 5 commits into from
Mar 21, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions registries/_format/decimal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
owner: baywet
issue: 889
description: A fixed point decimal number
baywet marked this conversation as resolved.
Show resolved Hide resolved
base_type: string
baywet marked this conversation as resolved.
Show resolved Hide resolved
layout: default
remarks: Potential loss of precision when used with type number. Not specific enough about the size of the integral and fraction parts without the use of extensions.
baywet marked this conversation as resolved.
Show resolved Hide resolved
---

# <a href="..">{{ page.collection }}</a>

## {{ page.slug }} - {{ page.description }}

Base type: `{{ page.base_type }}`.

The `{{page.slug}}` format represents a fixed point decimal number.

{% if page.issue %}
### GitHub Issue

* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
{% endif %}

{% if page.remarks %}
### Remarks

When the decimal format is used in combination with the number type, unintentional loss of precision can happen during serialization as most JSON serializers will serialize the value **1.10** to **1.1**.
baywet marked this conversation as resolved.
Show resolved Hide resolved

This format is not prescriptive enough to enable interoperability and its usage is discouraged.

{% endif %}