From 74cd9bb9bdaa41de0b6b26fd37d1a12e08bd17cc Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 6 Mar 2023 09:51:47 -0500 Subject: [PATCH 1/5] - adds decimal format --- registries/_format/decimal.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 registries/_format/decimal.md diff --git a/registries/_format/decimal.md b/registries/_format/decimal.md new file mode 100644 index 0000000000..1140f524a0 --- /dev/null +++ b/registries/_format/decimal.md @@ -0,0 +1,27 @@ +--- +owner: baywet +issue: +description: A fixed or floating point decimal number as defined by ISO/IEC 9075-2 2016 12 15 +base_type: string +layout: default +--- + +# {{ page.collection }} + +## {{ page.slug }} - {{ page.description }} + +Base type: `{{ page.base_type }}`. + +The `{{page.slug}}` format represents a fixed or floating point decimal number as defined by ISO/IEC 9075-2 2016 12 15. + +{% if page.issue %} +### GitHub Issue + +* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }}) +{% endif %} + +{% if page.remarks %} +### Remarks + +{{ page.remarks }} +{% endif %} \ No newline at end of file From 0d9e31b8d4469979faab25bb1ba413c12a9b9482 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 6 Mar 2023 10:45:05 -0500 Subject: [PATCH 2/5] Update registries/_format/decimal.md Co-authored-by: Mike Ralphson --- registries/_format/decimal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registries/_format/decimal.md b/registries/_format/decimal.md index 1140f524a0..fddd9ec59e 100644 --- a/registries/_format/decimal.md +++ b/registries/_format/decimal.md @@ -1,6 +1,6 @@ --- owner: baywet -issue: +issue: 889 description: A fixed or floating point decimal number as defined by ISO/IEC 9075-2 2016 12 15 base_type: string layout: default From 3d2cbf9a377dbe25ea05cb50beefb903fa12c22f Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 16 Mar 2023 13:08:21 -0400 Subject: [PATCH 3/5] - adds warnings about the lack of precision Signed-off-by: Vincent Biret --- registries/_format/decimal.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/registries/_format/decimal.md b/registries/_format/decimal.md index fddd9ec59e..a48196419f 100644 --- a/registries/_format/decimal.md +++ b/registries/_format/decimal.md @@ -1,9 +1,10 @@ --- owner: baywet issue: 889 -description: A fixed or floating point decimal number as defined by ISO/IEC 9075-2 2016 12 15 +description: A fixed point decimal number base_type: string 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. --- # {{ page.collection }} @@ -12,7 +13,7 @@ layout: default Base type: `{{ page.base_type }}`. -The `{{page.slug}}` format represents a fixed or floating point decimal number as defined by ISO/IEC 9075-2 2016 12 15. +The `{{page.slug}}` format represents a fixed point decimal number. {% if page.issue %} ### GitHub Issue @@ -23,5 +24,9 @@ The `{{page.slug}}` format represents a fixed or floating point decimal number a {% 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**. + +This format is not prescriptive enough to enable interoperability and its usage is discouraged. + {{ page.remarks }} {% endif %} \ No newline at end of file From 220ed2219beebcff32e416054d927d6fbd7fe3a3 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 16 Mar 2023 13:11:58 -0400 Subject: [PATCH 4/5] - removes the repetition of the remarks Signed-off-by: Vincent Biret --- registries/_format/decimal.md | 1 - 1 file changed, 1 deletion(-) diff --git a/registries/_format/decimal.md b/registries/_format/decimal.md index a48196419f..0206493b75 100644 --- a/registries/_format/decimal.md +++ b/registries/_format/decimal.md @@ -28,5 +28,4 @@ When the decimal format is used in combination with the number type, unintention This format is not prescriptive enough to enable interoperability and its usage is discouraged. -{{ page.remarks }} {% endif %} \ No newline at end of file From 42993ada43f1b9c18f529f8529c97631e2e11a90 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 17 Mar 2023 08:50:57 -0400 Subject: [PATCH 5/5] - adds PR feedback Signed-off-by: Vincent Biret --- registries/_format/decimal.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/registries/_format/decimal.md b/registries/_format/decimal.md index 0206493b75..3d9e6f257c 100644 --- a/registries/_format/decimal.md +++ b/registries/_format/decimal.md @@ -1,10 +1,10 @@ --- owner: baywet issue: 889 -description: A fixed point decimal number -base_type: string +description: A fixed point decimal number of unspecified precision and range +base_type: string|number 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. +remarks: This format is used in a variety of conflicting ways and is not interoperable. --- # {{ page.collection }} @@ -13,7 +13,7 @@ remarks: Potential loss of precision when used with type number. Not specific en Base type: `{{ page.base_type }}`. -The `{{page.slug}}` format represents a fixed point decimal number. +The `{{page.slug}}` format represents a fixed point decimal number of unspecified precision and range. {% if page.issue %} ### GitHub Issue @@ -24,8 +24,5 @@ The `{{page.slug}}` format represents a fixed point decimal number. {% 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**. - -This format is not prescriptive enough to enable interoperability and its usage is discouraged. - +{{ page.issue }} {% endif %} \ No newline at end of file