Skip to content

Commit aacbbc9

Browse files
committed
Add note about RFC6570 type conversions
The spec doesn't address it, but implementations often have their own rules.
1 parent 1cf5b0b commit aacbbc9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

versions/3.0.4.md

+3
Original file line numberDiff line numberDiff line change
@@ -3716,6 +3716,9 @@ Two cases do offer standards-based guidance:
37163716
* [RFC3987 §3.1](https://datatracker.ietf.org/doc/html/rfc3987#section-3.1) provides guidance for converting non-Unicode strings to UTF-8, particularly in the context of URIs (and by extension, the form media types which use the same encoding rules)
37173717
* [RFC6570 §2.3](https://www.rfc-editor.org/rfc/rfc6570#section-2.3) specifies which values, including but not limited to `null`, are considered _undefined_ and therefore treated specially in the expansion process when serializing based on that specification
37183718

3719+
Implementations of RFC6570 often have their own conventions for converting non-string values, but these are implementation-specific and not defined by the RFC itself.
3720+
This is one reason for the OpenAPI Specification to leave these conversions as implementation-defined: It allows using RFC6570 implementations regardless of how they choose to perform the conversions.
3721+
37193722
To control the serialization of numbers, booleans, and `null` (or other values RFC6570 deems to be undefined) more precisely, schemas can be defined as `type: string` and constrained using `pattern`, `enum`, `format`, and other keywords to communicate how applications must pre-convert their data prior to schema validation.
37203723
The resulting strings would not require any further type conversion.
37213724

0 commit comments

Comments
 (0)