You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix $ref serialization errors for requestBodies and responses (#1033)
* Do not add empty consumes array if RequestBody content contains no elements
* Add requestbody references as parameter references in v2 serialization
* Add consumes and produces properties when we have reference request bodies and responses respectively during v2 serialization
* Update src/Microsoft.OpenApi/Models/OpenApiOperation.cs
Co-authored-by: Vincent Biret <[email protected]>
* Apply suggestions from code review
Co-authored-by: Vincent Biret <[email protected]>
* Address code review comments
Co-authored-by: Vincent Biret <[email protected]>
// V2 spec actually allows the body to have custom name.
283
-
// To allow round-tripping we use an extension to hold the name
284
-
Name="body",
285
-
Schema=content?.Schema??newOpenApiSchema(),
286
-
Required=RequestBody.Required,
287
-
Extensions=RequestBody.Extensions.ToDictionary(k =>k.Key, v =>v.Value)// Clone extensions so we can remove the x-bodyName extensions from the output V2 model.
Extensions=Extensions.ToDictionary(static k =>k.Key,static v =>v.Value)// Clone extensions so we can remove the x-bodyName extensions from the output V2 model.
0 commit comments