diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache index e24d0a237a1..12c2b04f170 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace {{packageName}}.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace {{packageName}}.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs index 9c437b1919a..8285e7d6a0b 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -5,15 +5,23 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Org.OpenAPITools.Formatters { - // Input Type Formatter to allow model binding to Streams + /// public class InputFormatterStream : InputFormatter { + /// public InputFormatterStream() { SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// protected override bool CanReadType(Type type) { if (type == typeof(Stream)) @@ -23,10 +31,5 @@ namespace Org.OpenAPITools.Formatters return false; } - - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } } } \ No newline at end of file