Skip to content

Commit 9291879

Browse files
authored
Merge pull request #4294 from handrews/copy-paste
2 parents 0178e80 + f48940c commit 9291879

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

src/oas.md

+16-20
Original file line numberDiff line numberDiff line change
@@ -1800,17 +1800,17 @@ requestBody:
18001800
schema:
18011801
type: object
18021802
properties:
1803+
# default for a string without `contentEncoding` is `text/plain`
18031804
id:
1804-
# default for primitives without a special format is text/plain
18051805
type: string
18061806
format: uuid
1807-
profileImage:
1808-
# default for string with binary format is `application/octet-stream`
1809-
type: string
1810-
format: binary
1807+
1808+
# default for a schema without `type` is `application/octet-stream`
1809+
profileImage: {}
1810+
1811+
# default for arrays is based on the type in the `items`
1812+
# subschema, which is an object, so `application/json`
18111813
addresses:
1812-
# default for arrays is based on the type in the `items`
1813-
# subschema, which is an object, so `application/json`
18141814
type: array
18151815
items:
18161816
$ref: '#/components/schemas/Address'
@@ -1828,31 +1828,27 @@ requestBody:
18281828
schema:
18291829
type: object
18301830
properties:
1831+
# No Encoding Object, so use default `text/plain`
18311832
id:
1832-
# default is `text/plain`
18331833
type: string
18341834
format: uuid
1835+
1836+
# Encoding Object overrides the default `application/json`
1837+
# for each item in the array with `application/xml; charset=utf-8`
18351838
addresses:
1836-
# default based on the `items` subschema would be
1837-
# `application/json`, but we want these address objects
1838-
# serialized as `application/xml` instead
18391839
description: addresses in XML format
18401840
type: array
18411841
items:
18421842
$ref: '#/components/schemas/Address'
1843-
profileImage:
1844-
# default is application/octet-stream, but we can declare
1845-
# a more specific image type or types
1846-
type: string
1847-
format: binary
1843+
1844+
# Encoding Object accepts only PNG or JPEG, and also describes
1845+
# a custom header for just this part in the multipart format
1846+
profileImage: {}
1847+
18481848
encoding:
18491849
addresses:
1850-
# require XML Content-Type in utf-8 encoding
1851-
# This is applied to each address part corresponding
1852-
# to each address in he array
18531850
contentType: application/xml; charset=utf-8
18541851
profileImage:
1855-
# only accept png or jpeg
18561852
contentType: image/png, image/jpeg
18571853
headers:
18581854
X-Rate-Limit-Limit:

0 commit comments

Comments
 (0)