File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,9 @@ namespace Simplify.Web.Swagger;
1010/// Initializes an instance of <see cref="RequestBodyAttribute" />.
1111/// </remarks>
1212/// <param name="model">The request body model type.</param>
13+ /// <param name="contentType">The content type associated with the request.</param>
1314[ AttributeUsage ( AttributeTargets . Class ) ]
14- public class RequestBodyAttribute ( Type model ) : Attribute
15+ public class RequestBodyAttribute ( Type model , string contentType = "application/json" ) : Attribute
1516{
1617 /// <summary>
1718 /// Request body model type
@@ -20,4 +21,12 @@ public class RequestBodyAttribute(Type model) : Attribute
2021 /// The model.
2122 /// </value>
2223 public Type Model { get ; private set ; } = model ?? throw new ArgumentNullException ( nameof ( model ) ) ;
23- }
24+
25+ /// <summary>
26+ /// Gets the type of the content.
27+ /// </summary>
28+ /// <value>
29+ /// The type of the content.
30+ /// </value>
31+ public string ContentType { get ; private set ; } = contentType ;
32+ }
You can’t perform that action at this time.
0 commit comments