From 83844b867c8e6504f97d267ffedda405161bb181 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 16 Mar 2023 09:43:30 -0400 Subject: [PATCH 1/6] - adds int16 format (#3186) * - adds int16 format * Update registries/_format/int16.md --- registries/_format/int16.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 registries/_format/int16.md diff --git a/registries/_format/int16.md b/registries/_format/int16.md new file mode 100644 index 0000000000..51626b6c41 --- /dev/null +++ b/registries/_format/int16.md @@ -0,0 +1,27 @@ +--- +owner: DarrelMiller +issue: +description: signed 16-bit integer +base_type: number +layout: default +--- + +# {{ page.collection }} + +## {{ page.slug }} - {{ page.description }} + +Base type: `{{ page.base_type }}`. + +The `{{page.slug}}` format represents a signed 16-bit integer, with the range -32768 through +32767. + +{% 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 660331ffb84e8c7ab915e5130aade2946f34c9e4 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 16 Mar 2023 09:44:34 -0400 Subject: [PATCH 2/6] - adds a char format description (#3185) --- registries/_format/char.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 registries/_format/char.md diff --git a/registries/_format/char.md b/registries/_format/char.md new file mode 100644 index 0000000000..4ac98e911d --- /dev/null +++ b/registries/_format/char.md @@ -0,0 +1,27 @@ +--- +owner: baywet +issue: +description: A single character +base_type: string +layout: default +--- + +# {{ page.collection }} + +## {{ page.slug }} - {{ page.description }} + +Base type: `{{ page.base_type }}`. + +The `{{page.slug}}` format is a single character. + +{% 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 94c88210f7fe34e54c5655a67e81cc241e790158 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 16 Mar 2023 09:45:25 -0400 Subject: [PATCH 3/6] - adds a base64url format description (#3184) --- registries/_format/base64url.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 registries/_format/base64url.md diff --git a/registries/_format/base64url.md b/registries/_format/base64url.md new file mode 100644 index 0000000000..0756f637b0 --- /dev/null +++ b/registries/_format/base64url.md @@ -0,0 +1,29 @@ +--- +owner: baywet +issue: +description: Binary data encoded as a url-safe string as defined in [RFC4648](https://www.rfc-editor.org/rfc/rfc4648#section-5) +base_type: string +layout: default +deprecated_note: '3.1' +remarks: "When using OpenAPI 3.1 it's recommended not to use this format and instead use [`contentEncoding` with a value of `base64url`](https://json-schema.org/draft/2020-12/json-schema-validation.html#name-contentencoding)." +--- + +# {{ page.collection }} + +## {{ page.slug }} - {{ page.description }} + +Base type: `{{ page.base_type }}`. + +The `{{page.slug}}` format is binary data encoded as a url-safe string as defined in [RFC4648](https://www.rfc-editor.org/rfc/rfc4648#section-5). + +{% 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 74cd9bb9bdaa41de0b6b26fd37d1a12e08bd17cc Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 6 Mar 2023 09:51:47 -0500 Subject: [PATCH 4/6] - 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 5/6] 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 6/6] - 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