Skip to content

Commit 81015d9

Browse files
authored
Merge pull request #3830 from Bellangelo/encapsulate-format-page-layout-part1
Encapsulate page layout for formats - Part 1
2 parents 183ddc0 + 7391f99 commit 81015d9

File tree

12 files changed

+52
-187
lines changed

12 files changed

+52
-187
lines changed

_includes/format-entry.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# <a href="..">{{ page.collection }}</a>
2+
3+
## {{ page.slug }} - {{ page.description }}
4+
5+
Base type: `{{ page.base_type }}`.
6+
7+
{{ include.summary }}
8+
9+
{% if page.issue %}
10+
### GitHub Issue
11+
12+
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
13+
{% endif %}
14+
15+
{% if page.remarks %}
16+
### Remarks
17+
18+
{{ page.remarks }}
19+
{% endif %}

registries/_format/base64url.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ deprecated_note: '3.1'
88
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)."
99
---
1010

11-
# <a href="..">{{ page.collection }}</a>
12-
13-
## {{ page.slug }} - {{ page.description }}
14-
15-
Base type: `{{ page.base_type }}`.
16-
11+
{% capture summary %}
1712
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).
13+
{% endcapture %}
1814

19-
{% if page.issue %}
20-
### GitHub Issue
21-
22-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
23-
{% endif %}
24-
25-
{% if page.remarks %}
26-
### Remarks
27-
28-
{{ page.remarks }}
29-
{% endif %}
15+
{% include format-entry.md summary=summary %}

registries/_format/binary.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,8 @@ source: https://spec.openapis.org/oas/v3.0.3.html#data-types
1010
source_label: OAS
1111
---
1212

13-
# <a href="..">{{ page.collection }}</a>
14-
15-
## {{ page.slug }} - {{ page.description }}
16-
17-
Base type: `{{ page.base_type }}`.
18-
13+
{% capture summary %}
1914
The `{{page.slug}}` format represents any sequence of octets. This format entry is to ensure future versions of OpenAPI maintain compatibility with [OpenAPI 3.0.x](https://spec.openapis.org/oas/v3.0.0).
15+
{% endcapture %}
2016

21-
{% if page.issue %}
22-
### GitHub Issue
23-
24-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
25-
{% endif %}
26-
27-
{% if page.remarks %}
28-
### Remarks
29-
30-
{{ page.remarks }}
31-
{% endif %}
17+
{% include format-entry.md summary=summary %}

registries/_format/byte.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,8 @@ source: https://spec.openapis.org/oas/v3.0.3.html#data-types
1010
source_label: OAS
1111
---
1212

13-
# <a href="..">{{ page.collection }}</a>
14-
15-
## {{ page.slug }} - {{ page.description }}
16-
17-
Base type: `{{ page.base_type }}`.
18-
13+
{% capture summary %}
1914
The `{{page.slug}}` format represents any sequence of octets encoded as a base64 string as defined in [RFC4648](https://www.rfc-editor.org/rfc/rfc4648#section-4). This format entry is to ensure future versions of OpenAPI maintain compatibility with [OpenAPI 3.0.x](https://spec.openapis.org/oas/v3.0.0).
15+
{% endcapture %}
2016

21-
{% if page.issue %}
22-
### GitHub Issue
23-
24-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
25-
{% endif %}
26-
27-
{% if page.remarks %}
28-
### Remarks
29-
30-
{{ page.remarks }}
31-
{% endif %}
17+
{% include format-entry.md summary=summary %}

registries/_format/char.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,8 @@ base_type: string
66
layout: default
77
---
88

9-
# <a href="..">{{ page.collection }}</a>
10-
11-
## {{ page.slug }} - {{ page.description }}
12-
13-
Base type: `{{ page.base_type }}`.
14-
9+
{% capture summary %}
1510
The `{{page.slug}}` format is a single character.
11+
{% endcapture %}
1612

17-
{% if page.issue %}
18-
### GitHub Issue
19-
20-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
21-
{% endif %}
22-
23-
{% if page.remarks %}
24-
### Remarks
25-
26-
{{ page.remarks }}
27-
{% endif %}
13+
{% include format-entry.md summary=summary %}

registries/_format/commonmark.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ source: https://spec.openapis.org/oas/latest.html#data-types
88
source_label: OAS
99
---
1010

11-
# <a href="..">{{ page.collection }}</a>
12-
13-
## {{ page.slug }} - {{ page.description }}
14-
15-
Base type: `{{ page.base_type }}`.
16-
11+
{% capture summary %}
1712
The `{{page.slug}}` format represents [CommonMark](https://commonmark.org/) formatted text.
13+
{% endcapture %}
1814

19-
{% if page.issue %}
20-
### GitHub Issue
21-
22-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
23-
{% endif %}
24-
25-
{% if page.remarks %}
26-
### Remarks
27-
28-
{{ page.remarks }}
29-
{% endif %}
15+
{% include format-entry.md summary=summary %}

registries/_format/date-time.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ source_label: JSON Schema
88
source: https://json-schema.org/draft/2020-12/json-schema-validation.html#name-dates-times-and-duration
99
---
1010

11-
# <a href="..">{{ page.collection }}</a>
12-
13-
## {{ page.slug }} - {{ page.description }}
14-
15-
Base type: `{{ page.base_type }}`.
16-
11+
{% capture summary %}
1712
The `{{page.slug}}` format represents a date and time as defined by date-time - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). This format entry is to ensure future versions of OpenAPI maintain compatibility with [OpenAPI 3.0.x](https://spec.openapis.org/oas/v3.0.0).
13+
{% endcapture %}
1814

19-
{% if page.issue %}
20-
### GitHub Issue
21-
22-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
23-
{% endif %}
24-
25-
{% if page.remarks %}
26-
### Remarks
27-
28-
{{ page.remarks }}
29-
{% endif %}
15+
{% include format-entry.md summary=summary %}

registries/_format/date.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ source_label: JSON Schema
88
source: https://json-schema.org/draft/2020-12/json-schema-validation.html#name-dates-times-and-duration
99
---
1010

11-
# <a href="..">{{ page.collection }}</a>
12-
13-
## {{ page.slug }} - {{ page.description }}
14-
15-
Base type: `{{ page.base_type }}`.
16-
11+
{% capture summary %}
1712
The `{{page.slug}}` format represents a date as defined by full-date - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). This format entry is to ensure future versions of OpenAPI maintain compatibility with [OpenAPI 3.0.x](https://spec.openapis.org/oas/v3.0.0).
13+
{% endcapture %}
1814

19-
{% if page.issue %}
20-
### GitHub Issue
21-
22-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
23-
{% endif %}
24-
25-
{% if page.remarks %}
26-
### Remarks
27-
28-
{{ page.remarks }}
29-
{% endif %}
15+
{% include format-entry.md summary=summary %}

registries/_format/decimal.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,8 @@ layout: default
77
remarks: This format is used in a variety of conflicting ways and is not interoperable.
88
---
99

10-
# <a href="..">{{ page.collection }}</a>
11-
12-
## {{ page.slug }} - {{ page.description }}
13-
14-
Base type: `{{ page.base_type }}`.
15-
10+
{% capture summary %}
1611
The `{{page.slug}}` format represents a fixed point decimal number of unspecified precision and range.
12+
{% endcapture %}
1713

18-
{% if page.issue %}
19-
### GitHub Issue
20-
21-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
22-
{% endif %}
23-
24-
{% if page.remarks %}
25-
### Remarks
26-
27-
{{ page.issue }}
28-
{% endif %}
14+
{% include format-entry.md summary=summary %}

registries/_format/decimal128.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,12 @@ base_type: [string, number]
66
layout: default
77
---
88

9-
# <a href="..">{{ page.collection }}</a>
10-
11-
## {{ page.slug }} - {{ page.description }}
12-
13-
Base type: `{{ page.base_type }}`.
14-
9+
{% capture summary %}
1510
The `{{page.slug}}` format represents a [128-bit decimal floating-point number](https://en.wikipedia.org/wiki/Decimal128_floating-point_format) as defined by IEEE 754 2008 and ISO/IEC/IEEE 60559:2011.
1611

1712
Representation as a JSON string is preferred as this avoids problems with recipients that parse JSON numbers into [binary64](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) memory representation.
1813

1914
String representation allows expressing the special values `NaN`, `-INF`, and `INF` that cannot be expressed as JSON numbers.
15+
{% endcapture %}
2016

21-
{% if page.issue %}
22-
### GitHub Issue
23-
24-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
25-
{% endif %}
26-
27-
{% if page.remarks %}
28-
### Remarks
29-
30-
{{ page.issue }}
31-
{% endif %}
17+
{% include format-entry.md summary=summary %}

registries/_format/double-int.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,10 @@ base_type: integer
66
layout: default
77
---
88

9-
# <a href="..">{{ page.collection }}</a>
10-
11-
## {{ page.slug }} - {{ page.description }}
12-
13-
Base type: `{{ page.base_type }}`.
14-
9+
{% capture summary %}
1510
The `{{page.slug}}` format represents an integer that can be stored in an IEEE 754 double-precision number without loss of precision. The range of values is -(2<sup>53</sup>)+1 to (2<sup>53</sup>)-1.
1611

1712
This format is useful for systems that need to support languages (such as JavaScript) that store all numeric values as IEEE 754 double-precision numbers.
13+
{% endcapture %}
1814

19-
{% if page.issue %}
20-
### GitHub Issue
21-
22-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
23-
{% endif %}
24-
25-
{% if page.remarks %}
26-
### Remarks
27-
28-
{{ page.remarks }}
29-
{% endif %}
15+
{% include format-entry.md summary=summary %}

registries/_format/double.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ source: https://spec.openapis.org/oas/latest.html#data-types
88
source_label: OAS
99
---
1010

11-
# <a href="..">{{ page.collection }}</a>
12-
13-
## {{ page.slug }} - {{ page.description }}
14-
15-
Base type: `{{ page.base_type }}`.
16-
11+
{% capture summary %}
1712
The `{{page.slug}}` format represents a double precision (64bit) floating point number as defined by [IEEE Std 754-2019](https://ieeexplore.ieee.org/document/8766229). This format entry is to ensure future versions of OpenAPI maintain compatibility with [OpenAPI 3.0.x](https://spec.openapis.org/oas/v3.0.0).
13+
{% endcapture %}
1814

19-
{% if page.issue %}
20-
### GitHub Issue
21-
22-
* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }})
23-
{% endif %}
24-
25-
{% if page.remarks %}
26-
### Remarks
27-
28-
{{ page.remarks }}
29-
{% endif %}
15+
{% include format-entry.md summary=summary %}

0 commit comments

Comments
 (0)