Skip to content

Commit dce24e4

Browse files
committed
Be more clear about correlations.
It's not an error if you have more encoding objects than instances.
1 parent 62d56f0 commit dce24e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/oas.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ Each field has its own set of media types with which it can be used; for all oth
13301330

13311331
The behavior of the `encoding` field is designed to support web forms, and is therefore only defined for media types structured as name-value pairs that allow repeat values, most notably `application/x-www-form-urlencoded` and `multipart/form-data`.
13321332

1333-
To use the `encoding` field, each key under the field MUST exist in the `schema` as a property.
1333+
To use the `encoding` field, each key under the field MUST exist as a property; `encoding` entries with no corresponding property SHALL be ignored.
13341334
Array properties MUST be handled by applying the given Encoding Object to produce one encoded value per array item, each with the same `name`, as is recommended by [[?RFC7578]] [Section 4.3](https://www.rfc-editor.org/rfc/rfc7578.html#section-4.3) for supplying multiple values per form field.
13351335
For all other value types for both top-level non-array properties and for values, including array values, within a top-level array, the Encoding Object MUST be applied to the entire value.
13361336
The order of these name-value pairs in the target media type is implementation-defined.
@@ -1350,6 +1350,7 @@ Data for these media types are modeled as an array, with one item per part, in o
13501350

13511351
To use the `prefixEncoding` and/or `itemEncoding` fields, either `itemSchema` or an array `schema` MUST be present.
13521352
These fields are analogous to the `prefixItems` and `items` JSON Schema keywords, with `prefixEncoding` (if present) providing an array of Encoding Objects that are each applied to the value at the same position in the data array, and `itemEncoding` applying its single Encoding Object to all remaining items in the array.
1353+
As with `prefixItems`, it is _not_ an error if the instance array is shorter than the `prefixEncoding` array; the additional Encoding Objects SHALL be ignored.
13531354

13541355
The `itemEncoding` field can also be used with `itemSchema` to support streaming `multipart` content.
13551356

0 commit comments

Comments
 (0)