-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2097 from microsoft/fix/request-body-reference
fix/request body reference
- Loading branch information
Showing
25 changed files
with
179 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Microsoft.OpenApi/Models/Interfaces/IOpenApiRequestBody.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.OpenApi.Interfaces; | ||
using Microsoft.OpenApi.Writers; | ||
|
||
namespace Microsoft.OpenApi.Models.Interfaces; | ||
|
||
/// <summary> | ||
/// Defines the base properties for the request body object. | ||
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking. | ||
/// </summary> | ||
public interface IOpenApiRequestBody : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible | ||
{ | ||
/// <summary> | ||
/// Determines if the request body is required in the request. Defaults to false. | ||
/// </summary> | ||
public bool Required { get; } | ||
|
||
/// <summary> | ||
/// REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it. | ||
/// For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/* | ||
/// </summary> | ||
public IDictionary<string, OpenApiMediaType> Content { get; } | ||
/// <summary> | ||
/// Converts the request body to a body parameter in preparation for a v2 serialization. | ||
/// </summary> | ||
/// <param name="writer">The writer to use to read settings from.</param> | ||
/// <returns>The converted OpenAPI parameter</returns> | ||
IOpenApiParameter ConvertToBodyParameter(IOpenApiWriter writer); | ||
/// <summary> | ||
/// Converts the request body to a set of form data parameters in preparation for a v2 serialization. | ||
/// </summary> | ||
/// <param name="writer">The writer to use to read settings from</param> | ||
/// <returns>The converted OpenAPI parameters</returns> | ||
IEnumerable<IOpenApiParameter> ConvertToFormDataParameters(IOpenApiWriter writer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.