1
+ # including Encoding Object examples
2
+ openapi : 3.1.0
3
+ info :
4
+ title : API
5
+ version : 1.0.0
6
+ paths :
7
+ /something :
8
+ put :
9
+ requestBody :
10
+ content :
11
+ application/json :
12
+ schema :
13
+ $ref : ' #/components/schemas/Pet'
14
+ examples :
15
+ cat :
16
+ summary : An example of a cat
17
+ value :
18
+ name : Fluffy
19
+ petType : Cat
20
+ color : White
21
+ gender : male
22
+ breed : Persian
23
+ dog :
24
+ summary : An example of a dog with a cat's name
25
+ value :
26
+ name : Puma
27
+ petType : Dog
28
+ color : Black
29
+ gender : Female
30
+ breed : Mixed
31
+ frog :
32
+ $ref : ' #/components/examples/frog-example'
33
+ application/x-www-form-urlencoded :
34
+ schema :
35
+ type : object
36
+ properties :
37
+ id :
38
+ type : string
39
+ format : uuid
40
+ address :
41
+ # complex types are stringified to support RFC 1866
42
+ type : object
43
+ properties : {}
44
+ icon :
45
+ # The default with "contentEncoding" is application/octet-stream,
46
+ # so we need to set image media type(s) in the Encoding Object.
47
+ type : string
48
+ contentEncoding : base64url
49
+ encoding :
50
+ icon :
51
+ contentType : image/png, image/jpeg
52
+ multipart/form-data :
53
+ schema :
54
+ type : object
55
+ properties :
56
+ id :
57
+ # default is `text/plain`
58
+ type : string
59
+ format : uuid
60
+ addresses :
61
+ # default based on the `items` subschema would be
62
+ # `application/json`, but we want these address objects
63
+ # serialized as `application/xml` instead
64
+ description : addresses in XML format
65
+ type : array
66
+ items :
67
+ $ref : ' #/components/schemas/Address'
68
+ profileImage :
69
+ # default is application/octet-stream, but we can declare
70
+ # a more specific image type or types
71
+ type : string
72
+ format : binary
73
+ forCoverage :
74
+ type : string
75
+ forCoverage2 :
76
+ type : string
77
+ encoding :
78
+ addresses :
79
+ # require XML Content-Type in utf-8 encoding
80
+ # This is applied to each address part corresponding
81
+ # to each address in he array
82
+ contentType : application/xml; charset=utf-8
83
+ profileImage :
84
+ # only accept png or jpeg
85
+ contentType : image/png, image/jpeg
86
+ headers :
87
+ X-Rate-Limit-Limit :
88
+ description : The number of allowed requests in the current period
89
+ schema :
90
+ type : integer
91
+ forCoverage :
92
+ style : form
93
+ explode : false
94
+ allowReserved : true
95
+ forCoverage2 :
96
+ style : spaceDelimited
97
+ explode : true
0 commit comments