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
/// <summary> | |
/// This class is a wrapped to read text from existing buffers. | |
/// </summary> | |
/// <seealso cref="System.IO.TextReader" /> | |
public class BufferTextReader : TextReader | |
{ | |
private const int CharBufferLength = 16; | |
private byte[] _buffer; | |
private readonly char[] _charBuffer = ArrayPool<char>.Shared.Rent(CharBufferLength); | |
private int _charPosition; |
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
public class FileUploadOperation : IOperationFilter | |
{ | |
public void Apply(OpenApiOperation operation, OperationFilterContext context) | |
{ | |
// Check FileUploadOperationAttribute exists on the action. | |
var fileUploadAttribute = context.MethodInfo.GetCustomAttribute(typeof(FileUploadOperationAttribute), true) as FileUploadOperationAttribute; | |
if (fileUploadAttribute != null) | |
{ | |
var requestBody = operation.RequestBody; | |
// Optional: Clearing other parameters from the documentation. |