From 3e3f15ae2fdbd43f7739d85a5a5c0936c8f1dbec Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 26 Mar 2025 13:56:20 +0100 Subject: [PATCH] Change default initialization values to null in SendHttpRequestBase Updated the class properties' default initializers from `default!` to `null!` for better clarity and null handling. This ensures consistency in initialization and aligns with modern C# practices. --- .../Activities/SendHttpRequestBase.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs b/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs index f46d7ee9c..5140e8c2b 100644 --- a/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs +++ b/src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs @@ -16,12 +16,12 @@ namespace Elsa.Http; /// Base class for activities that send HTTP requests. /// [Output(IsSerializable = false)] -public abstract class SendHttpRequestBase(string? source = default, int? line = default) : Activity(source, line) +public abstract class SendHttpRequestBase(string? source = null, int? line = null) : Activity(source, line) { /// /// The URL to send the request to. /// - [Input(Order = 0)] public Input Url { get; set; } = default!; + [Input(Order = 0)] public Input Url { get; set; } = null!; /// /// The HTTP method to use when sending the request. @@ -45,7 +45,7 @@ public abstract class SendHttpRequestBase(string? source = default, int? line = Description = "The content to send with the request. Can be a string, an object, a byte array or a stream.", Order = 2 )] - public Input Content { get; set; } = default!; + public Input Content { get; set; } = null!; /// /// The content type to use when sending the request. @@ -56,7 +56,7 @@ public abstract class SendHttpRequestBase(string? source = default, int? line = UIHint = InputUIHints.DropDown, Order = 3 )] - public Input ContentType { get; set; } = default!; + public Input ContentType { get; set; } = null!; /// /// The Authorization header value to send with the request. @@ -68,7 +68,7 @@ public abstract class SendHttpRequestBase(string? source = default, int? line = CanContainSecrets = true, Order = 4 )] - public Input Authorization { get; set; } = default!; + public Input Authorization { get; set; } = null!; /// /// A value that allows to add the Authorization header without validation. @@ -78,7 +78,7 @@ public abstract class SendHttpRequestBase(string? source = default, int? line = Category = "Security", Order = 5 )] - public Input DisableAuthorizationHeaderValidation { get; set; } = default!; + public Input DisableAuthorizationHeaderValidation { get; set; } = null!; /// /// The headers to send along with the request. @@ -94,25 +94,25 @@ public abstract class SendHttpRequestBase(string? source = default, int? line = /// /// Indicates whether resiliency mechanisms should be enabled for the HTTP request. /// - public Input EnableResiliency { get; set; } = default!; + public Input EnableResiliency { get; set; } = null!; /// /// The HTTP response status code /// [Output(Description = "The HTTP response status code")] - public Output StatusCode { get; set; } = default!; + public Output StatusCode { get; set; } = null!; /// /// The parsed content, if any. /// [Output(Description = "The parsed content, if any.")] - public Output ParsedContent { get; set; } = default!; + public Output ParsedContent { get; set; } = null!; /// /// The response headers that were received. /// [Output(Description = "The response headers that were received.")] - public Output ResponseHeaders { get; set; } = default!; + public Output ResponseHeaders { get; set; } = null!; /// protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)