Skip to content

Commit

Permalink
Merge pull request #3390 from mikekistler/structured-fields
Browse files Browse the repository at this point in the history
Add structured fields primitive types to format registry
  • Loading branch information
lornajane authored Feb 29, 2024
2 parents ae1528c + a5fe410 commit 11d0ae5
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 0 deletions.
41 changes: 41 additions & 0 deletions registries/_format/sf-binary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
owner: mikekistler
issue:
description: structured fields byte sequence as defined in [RFC8941]
source: https://www.rfc-editor.org/rfc/rfc8941#name-byte-sequences
source_label: RFC 8941
base_type: string
layout: default
---

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

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

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

The `{{page.slug}}` format represents a structured fields byte sequence as defined in [RFC8941].

```abnf
sf-binary = ":" *(base64) ":"
base64 = ALPHA / DIGIT / "+" / "/" / "="
```

A Byte Sequence is delimited with colons and encoded using base64 ([RFC4648], Section 4).

This format is appropriate for a header value that must conform to the {{page.slug}} structured field definition.

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

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

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

{{ page.remarks }}
{% endif %}

[RFC8941]: https://www.rfc-editor.org/rfc/rfc8941#name-byte-sequences
[RFC4648]: https://www.rfc-editor.org/rfc/rfc4648#section-4
40 changes: 40 additions & 0 deletions registries/_format/sf-boolean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
owner: mikekistler
issue:
description: structured fields boolean as defined in [RFC8941]
source: https://www.rfc-editor.org/rfc/rfc8941#name-booleans
source_label: RFC 8941
base_type: string
layout: default
---

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

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

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

The `{{page.slug}}` format represents a structured fields boolean as defined in [RFC8941].

```abnf
sf-boolean = "?" boolean
boolean = "0" / "1"
```

A Boolean is indicated with a leading "?" character followed by a "1" for a true value or "0" for false.

This format is appropriate for a header value that must conform to the {{page.slug}} structured field definition.

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

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

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

{{ page.remarks }}
{% endif %}

[RFC8941]: https://www.rfc-editor.org/rfc/rfc8941#name-booleans
40 changes: 40 additions & 0 deletions registries/_format/sf-decimal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
owner: mikekistler
issue:
description: structured fields decimal as defined in [RFC8941]
source: https://www.rfc-editor.org/rfc/rfc8941#name-decimals
source_label: RFC 8941
base_type: number
layout: default
---

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

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

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

The `{{page.slug}}` format represents a structured fields decimal as defined in [RFC8941].

```abnf
sf-decimal = ["-"] 1*12DIGIT "." 1*3DIGIT
```

Decimals are numbers with an integer and a fractional component.
The integer component has at most 12 digits; the fractional component has at most three digits.

This format is appropriate for a header value that must conform to the {{page.slug}} structured field definition.

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

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

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

{{ page.remarks }}
{% endif %}

[RFC8941]: https://www.rfc-editor.org/rfc/rfc8941#name-decimals
41 changes: 41 additions & 0 deletions registries/_format/sf-integer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
owner: mikekistler
issue:
description: structured fields integer as defined in [RFC8941]
source: https://www.rfc-editor.org/rfc/rfc8941#name-integers
source_label: RFC 8941
base_type: integer, number
layout: default
---

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

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

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

The `{{page.slug}}` format represents a structured fields integer as defined in [RFC8941].

```abnf
sf-integer = ["-"] 1*15DIGIT
```

Integers have a range of -999,999,999,999,999 to 999,999,999,999,999 inclusive (i.e., up to fifteen digits, signed),
for IEEE 754 compatibility [IEEE754].

This format is appropriate for a header value that must conform to the {{page.slug}} structured field definition.

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

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

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

{{ page.remarks }}
{% endif %}

[RFC8941]: https://www.rfc-editor.org/rfc/rfc8941#name-integers
[IEEE754]: https://ieeexplore.ieee.org/document/8766229
45 changes: 45 additions & 0 deletions registries/_format/sf-string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
owner: mikekistler
issue:
description: structured fields string as defined in [RFC8941]
source: https://www.rfc-editor.org/rfc/rfc8941#name-strings
source_label: RFC 8941
base_type: string
layout: default
---

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

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

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

The `{{page.slug}}` format represents a structured fields string as defined in [RFC8941].

```abnf
sf-string = DQUOTE *chr DQUOTE
chr = unescaped / escaped
unescaped = %x20-21 / %x23-5B / %x5D-7E
escaped = "\" ( DQUOTE / "\" )
```

Strings are zero or more printable ASCII [RFC0020] characters (i.e., the range %x20 to %x7E).
Note that this excludes tabs, newlines, carriage returns, etc.

Strings are delimited with double quotes, using a backslash ("\") to escape double quotes and backslashes.

This format is appropriate for a header value that must conform to the {{page.slug}} structured field definition.

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

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

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

{{ page.remarks }}
{% endif %}

[RFC8941]: https://www.rfc-editor.org/rfc/rfc8941#name-strings
39 changes: 39 additions & 0 deletions registries/_format/sf-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
owner: mikekistler
issue:
description: structured fields token as defined in [RFC8941]
source: https://www.rfc-editor.org/rfc/rfc8941#name-tokens
source_label: RFC 8941
base_type: string
layout: default
---

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

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

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

The `{{page.slug}}` format represents a structured fields token as defined in [RFC8941].

```abnf
sf-token = ( ALPHA / "*" ) *( tchar / ":" / "/" )
```

Tokens are short textual words; their abstract model is identical to their expression in the HTTP field value serialization.

This format is appropriate for a header value that must conform to the {{page.slug}} structured field definition.

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

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

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

{{ page.remarks }}
{% endif %}

[RFC8941]: https://www.rfc-editor.org/rfc/rfc8941#name-tokens

0 comments on commit 11d0ae5

Please sign in to comment.