@@ -10,18 +10,15 @@ namespace Microsoft.OpenApi
1010 /// <summary>
1111 /// Request Body Object
1212 /// </summary>
13- public class OpenApiRequestBody : IOpenApiExtensible , IOpenApiRequestBody , IOpenApiContentElement
13+ public class OpenApiRequestBody : IOpenApiExtensible , IOpenApiRequestBody
1414 {
1515 /// <inheritdoc />
1616 public string ? Description { get ; set ; }
1717
1818 /// <inheritdoc />
1919 public bool Required { get ; set ; }
2020
21- /// <summary>
22- /// REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it.
23- /// For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
24- /// </summary>
21+ /// <inheritdoc />
2522 public IDictionary < string , OpenApiMediaType > ? Content { get ; set ; }
2623
2724 /// <inheritdoc />
@@ -59,7 +56,7 @@ public virtual void SerializeAsV3(IOpenApiWriter writer)
5956 {
6057 SerializeInternal ( writer , OpenApiSpecVersion . OpenApi3_0 , ( writer , element ) => element . SerializeAsV3 ( writer ) ) ;
6158 }
62-
59+
6360 internal void SerializeInternal ( IOpenApiWriter writer , OpenApiSpecVersion version ,
6461 Action < IOpenApiWriter , IOpenApiSerializable > callback )
6562 {
@@ -105,7 +102,7 @@ public IOpenApiParameter ConvertToBodyParameter(IOpenApiWriter writer)
105102 Extensions = Extensions ? . ToDictionary ( static k => k . Key , static v => v . Value )
106103 } ;
107104 // Clone extensions so we can remove the x-bodyName extensions from the output V2 model.
108- if ( bodyParameter . Extensions is not null &&
105+ if ( bodyParameter . Extensions is not null &&
109106 bodyParameter . Extensions . TryGetValue ( OpenApiConstants . BodyName , out var bodyNameExtension ) &&
110107 bodyNameExtension is JsonNodeExtension bodyName )
111108 {
@@ -121,7 +118,7 @@ public IEnumerable<IOpenApiParameter> ConvertToFormDataParameters(IOpenApiWriter
121118 if ( Content == null || ! Content . Any ( ) )
122119 yield break ;
123120 var properties = Content . First ( ) . Value . Schema ? . Properties ;
124- if ( properties != null )
121+ if ( properties != null )
125122 {
126123 foreach ( var property in properties )
127124 {
@@ -139,11 +136,11 @@ public IEnumerable<IOpenApiParameter> ConvertToFormDataParameters(IOpenApiWriter
139136 OpenApiSchemaReference => throw new InvalidOperationException ( "Unresolved reference target" ) ,
140137 _ => throw new InvalidOperationException ( "Unexpected schema type" )
141138 } ;
142-
139+
143140 updatedSchema . Type = "file" . ToJsonSchemaType ( ) ;
144141 updatedSchema . Format = null ;
145142 paramSchema = updatedSchema ;
146-
143+
147144 }
148145 yield return new OpenApiFormDataParameter ( )
149146 {
@@ -154,7 +151,7 @@ public IEnumerable<IOpenApiParameter> ConvertToFormDataParameters(IOpenApiWriter
154151 Required = Content . First ( ) . Value . Schema ? . Required ? . Contains ( property . Key ) ?? false
155152 } ;
156153 }
157- }
154+ }
158155 }
159156
160157 /// <inheritdoc/>
0 commit comments