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

Encoding Obj contentType takes a media range (3.0.4) #3813

Closed
wants to merge 1 commit into from

Conversation

handrews
Copy link
Member

@handrews handrews commented May 16, 2024

Fixes:

The "the two types" appears to have come from an example involving two types, and the TSC agrees that there was no intention to limit it to two. The syntax described also matches media type ranges, which is what is used for keys under content keywords that take objects of Media Type Objects. As that is analogous to the use of contentType in the Encoding Object, this change aligns the wording.

The guidance on default values was difficult to format in a readable way inside of the fixed fields table, so this change also moves it to its own table.

The "the two types" appears to have come from an example involving
two types, and the TSC agrees that there was no intention to limit
it to two.  The syntax described also matches media type ranges,
which is what is used for keys under `content` keywords that take
objects of Media Type Objects.  As that is analogous to the use
of `contentType` in the Encoding Object, this change aligns the wording.

The guidance on default values was difficult to format in a readable
way inside of the fixed fields table, so this change also moves it
to its own table.
@handrews handrews added clarification requests to clarify, but not change, part of the spec media and encoding Issues regarding media type support and how to encode data (outside of query/path params) labels May 16, 2024
@handrews handrews added this to the v3.0.4 milestone May 16, 2024
@handrews handrews requested a review from a team May 16, 2024 19:16
@@ -1601,14 +1601,25 @@ A single encoding definition applied to a single schema property.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
<a name="encodingContentType"></a>contentType | `string` | The Content-Type for encoding a specific property. Default value depends on the property type: for `string` with `format` being `binary` – `application/octet-stream`; for other primitive types – `text/plain`; for `object` - `application/json`; for `array` – the default is defined based on the inner type. The value can be a specific media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`), or a comma-separated list of the two types.
<a name="encodingContentType"></a>contentType | `string` | The Content-Type for encoding a specific property. The value is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D). Default value depends on the property type as shown in the table below.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<a name="encodingContentType"></a>contentType | `string` | The Content-Type for encoding a specific property. The value is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D). Default value depends on the property type as shown in the table below.
<a name="encodingContentType"></a>contentType | `string` | The Content-Type for encoding a specific property. The value is a comma-separated list of [media type ranges](https://tools.ietf.org/html/rfc7231#appendix-D). Default value depends on the property type as shown in the table below.

Note: rule media-range is only a single thingy, and it includes non-wildcard type "/" subtype as an alternative.

We can't take away the "list of" in a patch version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ralfhandl there is no intention to take away anything. This is what we thought made sense in a TDC call, so either it was supposed to be "list of media-ranges" or something else.

I think perhaps what we want is list of media-ranges-without-parameters, because that's what the previous awkward wording (aside from the "the two types" part) described.

@handrews handrews marked this pull request as draft May 18, 2024 00:51
@handrews
Copy link
Member Author

Converting to draft because I did some deeper digging and this is murkier than expected.

@handrews
Copy link
Member Author

OK on second thought I'm closing this and starting over. @ralfhandl thanks for catching the un-intended removal of list-ness, sadly there's more complex history here as well.

@handrews handrews closed this May 18, 2024
@handrews handrews deleted the media-range-304 branch May 19, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification requests to clarify, but not change, part of the spec media and encoding Issues regarding media type support and how to encode data (outside of query/path params)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants