@@ -13,47 +13,25 @@ namespace Microsoft.OpenApi
13
13
/// </summary>
14
14
public class OpenApiMediaType : IOpenApiSerializable , IOpenApiExtensible , IOpenApiMediaType
15
15
{
16
- /// <summary>
17
- /// The schema defining the type used for the request body.
18
- /// </summary>
16
+ /// <inheritdoc />
19
17
public IOpenApiSchema ? Schema { get ; set ; }
20
18
21
- /// <summary>
22
- /// The schema defining the type used for the items in an array media type.
23
- /// This property is only applicable for OAS 3.2.0 and later.
24
- /// </summary>
19
+ /// <inheritdoc />
25
20
public IOpenApiSchema ? ItemSchema { get ; set ; }
26
21
27
- /// <summary>
28
- /// Example of the media type.
29
- /// The example object SHOULD be in the correct format as specified by the media type.
30
- /// </summary>
22
+ /// <inheritdoc />
31
23
public JsonNode ? Example { get ; set ; }
32
24
33
- /// <summary>
34
- /// Examples of the media type.
35
- /// Each example object SHOULD match the media type and specified schema if present.
36
- /// </summary>
25
+ /// <inheritdoc />
37
26
public IDictionary < string , IOpenApiExample > ? Examples { get ; set ; }
38
27
39
- /// <summary>
40
- /// A map between a property name and its encoding information.
41
- /// The key, being the property name, MUST exist in the schema as a property.
42
- /// The encoding object SHALL only apply to requestBody objects
43
- /// when the media type is multipart or application/x-www-form-urlencoded.
44
- /// </summary>
28
+ /// <inheritdoc />
45
29
public IDictionary < string , OpenApiEncoding > ? Encoding { get ; set ; }
46
30
47
- /// <summary>
48
- /// An encoding object for items in an array schema.
49
- /// Only applies when the schema is of type array.
50
- /// </summary>
31
+ /// <inheritdoc />
51
32
public OpenApiEncoding ? ItemEncoding { get ; set ; }
52
33
53
- /// <summary>
54
- /// An array of encoding objects for prefixItems in an array schema.
55
- /// Each element corresponds to a prefixItem in the schema.
56
- /// </summary>
34
+ /// <inheritdoc />
57
35
public IList < OpenApiEncoding > ? PrefixEncoding { get ; set ; }
58
36
59
37
/// <summary>
@@ -74,11 +52,11 @@ public OpenApiMediaType(OpenApiMediaType? mediaType)
74
52
Schema = mediaType ? . Schema ? . CreateShallowCopy ( ) ;
75
53
ItemSchema = mediaType ? . ItemSchema ? . CreateShallowCopy ( ) ;
76
54
Example = mediaType ? . Example != null ? JsonNodeCloneHelper . Clone ( mediaType . Example ) : null ;
77
- Examples = mediaType ? . Examples != null ? new Dictionary < string , IOpenApiExample > ( mediaType . Examples ) : null ;
78
- Encoding = mediaType ? . Encoding != null ? new Dictionary < string , OpenApiEncoding > ( mediaType . Encoding ) : null ;
55
+ Examples = mediaType ? . Examples != null ? new Dictionary < string , IOpenApiExample > ( mediaType . Examples , StringComparer . Ordinal ) : null ;
56
+ Encoding = mediaType ? . Encoding != null ? new Dictionary < string , OpenApiEncoding > ( mediaType . Encoding , StringComparer . Ordinal ) : null ;
79
57
ItemEncoding = mediaType ? . ItemEncoding != null ? new OpenApiEncoding ( mediaType . ItemEncoding ) : null ;
80
58
PrefixEncoding = mediaType ? . PrefixEncoding != null ? new List < OpenApiEncoding > ( mediaType . PrefixEncoding . Select ( e => new OpenApiEncoding ( e ) ) ) : null ;
81
- Extensions = mediaType ? . Extensions != null ? new Dictionary < string , IOpenApiExtension > ( mediaType . Extensions ) : null ;
59
+ Extensions = mediaType ? . Extensions != null ? new Dictionary < string , IOpenApiExtension > ( mediaType . Extensions , StringComparer . Ordinal ) : null ;
82
60
}
83
61
84
62
/// <summary>
@@ -89,16 +67,14 @@ internal OpenApiMediaType(IOpenApiMediaType mediaType)
89
67
Schema = mediaType ? . Schema ? . CreateShallowCopy ( ) ;
90
68
ItemSchema = mediaType ? . ItemSchema ? . CreateShallowCopy ( ) ;
91
69
Example = mediaType ? . Example != null ? JsonNodeCloneHelper . Clone ( mediaType . Example ) : null ;
92
- Examples = mediaType ? . Examples != null ? new Dictionary < string , IOpenApiExample > ( mediaType . Examples ) : null ;
93
- Encoding = mediaType ? . Encoding != null ? new Dictionary < string , OpenApiEncoding > ( mediaType . Encoding ) : null ;
70
+ Examples = mediaType ? . Examples != null ? new Dictionary < string , IOpenApiExample > ( mediaType . Examples , StringComparer . Ordinal ) : null ;
71
+ Encoding = mediaType ? . Encoding != null ? new Dictionary < string , OpenApiEncoding > ( mediaType . Encoding , StringComparer . Ordinal ) : null ;
94
72
ItemEncoding = mediaType ? . ItemEncoding != null ? new OpenApiEncoding ( mediaType . ItemEncoding ) : null ;
95
73
PrefixEncoding = mediaType ? . PrefixEncoding != null ? new List < OpenApiEncoding > ( mediaType . PrefixEncoding . Select ( e => new OpenApiEncoding ( e ) ) ) : null ;
96
- Extensions = mediaType ? . Extensions != null ? new Dictionary < string , IOpenApiExtension > ( mediaType . Extensions ) : null ;
74
+ Extensions = mediaType ? . Extensions != null ? new Dictionary < string , IOpenApiExtension > ( mediaType . Extensions , StringComparer . Ordinal ) : null ;
97
75
}
98
76
99
- /// <summary>
100
- /// Creates a shallow copy of this <see cref="OpenApiMediaType"/> object
101
- /// </summary>
77
+ /// <inheritdoc />
102
78
public IOpenApiMediaType CreateShallowCopy ( )
103
79
{
104
80
return new OpenApiMediaType ( this ) ;
0 commit comments