From 1becfbd2b9a030bfbcb43cece747d1c452027e99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:08:09 +0000
Subject: [PATCH 01/25] Adding nullable support.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
build/Common.props | 1 +
1 file changed, 1 insertion(+)
diff --git a/build/Common.props b/build/Common.props
index b1857e0d..74031f44 100644
--- a/build/Common.props
+++ b/build/Common.props
@@ -6,6 +6,7 @@
true
EnableGenerateDocumentationFile
+ enable
From 865fa90dba36bcdf13f4ac462c0ec9af8142b3e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:11:45 +0000
Subject: [PATCH 02/25] Fix nullables for Exceptions.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
src/OpenFeature/Error/FeatureProviderException.cs | 2 +-
src/OpenFeature/Error/FlagNotFoundException.cs | 2 +-
src/OpenFeature/Error/GeneralException.cs | 2 +-
src/OpenFeature/Error/InvalidContextException.cs | 2 +-
src/OpenFeature/Error/ParseErrorException.cs | 2 +-
src/OpenFeature/Error/ProviderNotReadyException.cs | 2 +-
src/OpenFeature/Error/TargetingKeyMissingException.cs | 2 +-
src/OpenFeature/Error/TypeMismatchException.cs | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/OpenFeature/Error/FeatureProviderException.cs b/src/OpenFeature/Error/FeatureProviderException.cs
index df74afa4..b2c43dc7 100644
--- a/src/OpenFeature/Error/FeatureProviderException.cs
+++ b/src/OpenFeature/Error/FeatureProviderException.cs
@@ -20,7 +20,7 @@ public class FeatureProviderException : Exception
/// Common error types
/// Exception message
/// Optional inner exception
- public FeatureProviderException(ErrorType errorType, string message = null, Exception innerException = null)
+ public FeatureProviderException(ErrorType errorType, string? message = null, Exception? innerException = null)
: base(message, innerException)
{
this.ErrorType = errorType;
diff --git a/src/OpenFeature/Error/FlagNotFoundException.cs b/src/OpenFeature/Error/FlagNotFoundException.cs
index 6b8fb4bb..b1a5b64a 100644
--- a/src/OpenFeature/Error/FlagNotFoundException.cs
+++ b/src/OpenFeature/Error/FlagNotFoundException.cs
@@ -15,7 +15,7 @@ public class FlagNotFoundException : FeatureProviderException
///
/// Exception message
/// Optional inner exception
- public FlagNotFoundException(string message = null, Exception innerException = null)
+ public FlagNotFoundException(string? message = null, Exception? innerException = null)
: base(ErrorType.FlagNotFound, message, innerException)
{
}
diff --git a/src/OpenFeature/Error/GeneralException.cs b/src/OpenFeature/Error/GeneralException.cs
index 42e0fe73..4580ff31 100644
--- a/src/OpenFeature/Error/GeneralException.cs
+++ b/src/OpenFeature/Error/GeneralException.cs
@@ -15,7 +15,7 @@ public class GeneralException : FeatureProviderException
///
/// Exception message
/// Optional inner exception
- public GeneralException(string message = null, Exception innerException = null)
+ public GeneralException(string? message = null, Exception? innerException = null)
: base(ErrorType.General, message, innerException)
{
}
diff --git a/src/OpenFeature/Error/InvalidContextException.cs b/src/OpenFeature/Error/InvalidContextException.cs
index 6bcc8051..ffea8ab1 100644
--- a/src/OpenFeature/Error/InvalidContextException.cs
+++ b/src/OpenFeature/Error/InvalidContextException.cs
@@ -15,7 +15,7 @@ public class InvalidContextException : FeatureProviderException
///
/// Exception message
/// Optional inner exception
- public InvalidContextException(string message = null, Exception innerException = null)
+ public InvalidContextException(string? message = null, Exception? innerException = null)
: base(ErrorType.InvalidContext, message, innerException)
{
}
diff --git a/src/OpenFeature/Error/ParseErrorException.cs b/src/OpenFeature/Error/ParseErrorException.cs
index 7b3d21e9..81ded456 100644
--- a/src/OpenFeature/Error/ParseErrorException.cs
+++ b/src/OpenFeature/Error/ParseErrorException.cs
@@ -15,7 +15,7 @@ public class ParseErrorException : FeatureProviderException
///
/// Exception message
/// Optional inner exception
- public ParseErrorException(string message = null, Exception innerException = null)
+ public ParseErrorException(string? message = null, Exception? innerException = null)
: base(ErrorType.ParseError, message, innerException)
{
}
diff --git a/src/OpenFeature/Error/ProviderNotReadyException.cs b/src/OpenFeature/Error/ProviderNotReadyException.cs
index c3c8b5d0..ca509692 100644
--- a/src/OpenFeature/Error/ProviderNotReadyException.cs
+++ b/src/OpenFeature/Error/ProviderNotReadyException.cs
@@ -15,7 +15,7 @@ public class ProviderNotReadyException : FeatureProviderException
///
/// Exception message
/// Optional inner exception
- public ProviderNotReadyException(string message = null, Exception innerException = null)
+ public ProviderNotReadyException(string? message = null, Exception? innerException = null)
: base(ErrorType.ProviderNotReady, message, innerException)
{
}
diff --git a/src/OpenFeature/Error/TargetingKeyMissingException.cs b/src/OpenFeature/Error/TargetingKeyMissingException.cs
index 632cc791..71742413 100644
--- a/src/OpenFeature/Error/TargetingKeyMissingException.cs
+++ b/src/OpenFeature/Error/TargetingKeyMissingException.cs
@@ -15,7 +15,7 @@ public class TargetingKeyMissingException : FeatureProviderException
///
/// Exception message
/// Optional inner exception
- public TargetingKeyMissingException(string message = null, Exception innerException = null)
+ public TargetingKeyMissingException(string? message = null, Exception? innerException = null)
: base(ErrorType.TargetingKeyMissing, message, innerException)
{
}
diff --git a/src/OpenFeature/Error/TypeMismatchException.cs b/src/OpenFeature/Error/TypeMismatchException.cs
index 96c23872..83ff0cf3 100644
--- a/src/OpenFeature/Error/TypeMismatchException.cs
+++ b/src/OpenFeature/Error/TypeMismatchException.cs
@@ -15,7 +15,7 @@ public class TypeMismatchException : FeatureProviderException
///
/// Exception message
/// Optional inner exception
- public TypeMismatchException(string message = null, Exception innerException = null)
+ public TypeMismatchException(string? message = null, Exception? innerException = null)
: base(ErrorType.TypeMismatch, message, innerException)
{
}
From f709fc4ce25356128d8bbcc5bf50c6efe17207a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:12:21 +0000
Subject: [PATCH 03/25] Fix Extensions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
src/OpenFeature/Extension/EnumExtensions.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/OpenFeature/Extension/EnumExtensions.cs b/src/OpenFeature/Extension/EnumExtensions.cs
index 155bfd3e..fe10afb5 100644
--- a/src/OpenFeature/Extension/EnumExtensions.cs
+++ b/src/OpenFeature/Extension/EnumExtensions.cs
@@ -9,7 +9,7 @@ internal static class EnumExtensions
public static string GetDescription(this Enum value)
{
var field = value.GetType().GetField(value.ToString());
- var attribute = field.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute;
+ var attribute = field?.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute;
return attribute?.Description ?? value.ToString();
}
}
From dda1e5661bd13ac805b774a2ce0ab3ac612a4d37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:13:30 +0000
Subject: [PATCH 04/25] Adding Warning as error.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
build/Common.props | 1 +
1 file changed, 1 insertion(+)
diff --git a/build/Common.props b/build/Common.props
index 74031f44..9f807b2c 100644
--- a/build/Common.props
+++ b/build/Common.props
@@ -7,6 +7,7 @@
EnableGenerateDocumentationFile
enable
+ true
From 211f8cae146bf32d4325acf20d00e73eb979fc1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:14:30 +0000
Subject: [PATCH 05/25] Removed redundant compiler nullable.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
src/OpenFeature/Model/BaseMetadata.cs | 1 -
src/OpenFeature/Model/FlagMetadata.cs | 1 -
src/OpenFeature/Providers/Memory/Flag.cs | 1 -
src/OpenFeature/Providers/Memory/InMemoryProvider.cs | 1 -
test/OpenFeature.Tests/FlagMetadataTest.cs | 1 -
5 files changed, 5 deletions(-)
diff --git a/src/OpenFeature/Model/BaseMetadata.cs b/src/OpenFeature/Model/BaseMetadata.cs
index 81f1bc50..876247df 100644
--- a/src/OpenFeature/Model/BaseMetadata.cs
+++ b/src/OpenFeature/Model/BaseMetadata.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Collections.Immutable;
-#nullable enable
namespace OpenFeature.Model;
///
diff --git a/src/OpenFeature/Model/FlagMetadata.cs b/src/OpenFeature/Model/FlagMetadata.cs
index 586a46bf..0fddbdd3 100644
--- a/src/OpenFeature/Model/FlagMetadata.cs
+++ b/src/OpenFeature/Model/FlagMetadata.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
-#nullable enable
namespace OpenFeature.Model;
///
diff --git a/src/OpenFeature/Providers/Memory/Flag.cs b/src/OpenFeature/Providers/Memory/Flag.cs
index 99975de3..1a16bfe3 100644
--- a/src/OpenFeature/Providers/Memory/Flag.cs
+++ b/src/OpenFeature/Providers/Memory/Flag.cs
@@ -4,7 +4,6 @@
using OpenFeature.Error;
using OpenFeature.Model;
-#nullable enable
namespace OpenFeature.Providers.Memory
{
///
diff --git a/src/OpenFeature/Providers/Memory/InMemoryProvider.cs b/src/OpenFeature/Providers/Memory/InMemoryProvider.cs
index e463023a..766e4f3c 100644
--- a/src/OpenFeature/Providers/Memory/InMemoryProvider.cs
+++ b/src/OpenFeature/Providers/Memory/InMemoryProvider.cs
@@ -5,7 +5,6 @@
using OpenFeature.Error;
using OpenFeature.Model;
-#nullable enable
namespace OpenFeature.Providers.Memory
{
///
diff --git a/test/OpenFeature.Tests/FlagMetadataTest.cs b/test/OpenFeature.Tests/FlagMetadataTest.cs
index 2bb33b0d..d716d91e 100644
--- a/test/OpenFeature.Tests/FlagMetadataTest.cs
+++ b/test/OpenFeature.Tests/FlagMetadataTest.cs
@@ -3,7 +3,6 @@
using OpenFeature.Tests.Internal;
using Xunit;
-#nullable enable
namespace OpenFeature.Tests;
public class FlagMetadataTest
From 46de1a486ddb798de0f1a0c1c34f89054d31a255 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:21:38 +0000
Subject: [PATCH 06/25] Fixes for Model.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
src/OpenFeature/Model/EvaluationContext.cs | 6 +++---
src/OpenFeature/Model/EvaluationContextBuilder.cs | 4 ++--
src/OpenFeature/Model/FlagEvaluationDetails.cs | 6 +++---
src/OpenFeature/Model/FlagEvaluationOptions.cs | 4 ++--
src/OpenFeature/Model/ProviderEvents.cs | 8 ++++----
src/OpenFeature/Model/ResolutionDetails.cs | 12 ++++++------
src/OpenFeature/Model/Structure.cs | 2 +-
src/OpenFeature/Model/Value.cs | 10 +++++-----
8 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/src/OpenFeature/Model/EvaluationContext.cs b/src/OpenFeature/Model/EvaluationContext.cs
index 6db585a1..59b1fe20 100644
--- a/src/OpenFeature/Model/EvaluationContext.cs
+++ b/src/OpenFeature/Model/EvaluationContext.cs
@@ -18,7 +18,7 @@ public sealed class EvaluationContext
///
/// The targeting key
/// The content of the context.
- internal EvaluationContext(string targetingKey, Structure content)
+ internal EvaluationContext(string? targetingKey, Structure content)
{
this.TargetingKey = targetingKey;
this._structure = content;
@@ -70,7 +70,7 @@ private EvaluationContext()
///
/// Thrown when the key is
///
- public bool TryGetValue(string key, out Value value) => this._structure.TryGetValue(key, out value);
+ public bool TryGetValue(string key, out Value? value) => this._structure.TryGetValue(key, out value);
///
/// Gets all values as a Dictionary
@@ -89,7 +89,7 @@ public IImmutableDictionary AsDictionary()
///
/// Returns the targeting key for the context.
///
- public string TargetingKey { get; }
+ public string? TargetingKey { get; }
///
/// Return an enumerator for all values
diff --git a/src/OpenFeature/Model/EvaluationContextBuilder.cs b/src/OpenFeature/Model/EvaluationContextBuilder.cs
index 89174cf6..1afb02fc 100644
--- a/src/OpenFeature/Model/EvaluationContextBuilder.cs
+++ b/src/OpenFeature/Model/EvaluationContextBuilder.cs
@@ -14,7 +14,7 @@ public sealed class EvaluationContextBuilder
{
private readonly StructureBuilder _attributes = Structure.Builder();
- internal string TargetingKey { get; private set; }
+ internal string? TargetingKey { get; private set; }
///
/// Internal to only allow direct creation by .
@@ -138,7 +138,7 @@ public EvaluationContextBuilder Set(string key, DateTime value)
/// This builder
public EvaluationContextBuilder Merge(EvaluationContext context)
{
- string newTargetingKey = "";
+ string? newTargetingKey = "";
if (!string.IsNullOrWhiteSpace(TargetingKey))
{
diff --git a/src/OpenFeature/Model/FlagEvaluationDetails.cs b/src/OpenFeature/Model/FlagEvaluationDetails.cs
index cff22a8b..f7769085 100644
--- a/src/OpenFeature/Model/FlagEvaluationDetails.cs
+++ b/src/OpenFeature/Model/FlagEvaluationDetails.cs
@@ -31,7 +31,7 @@ public sealed class FlagEvaluationDetails
/// details.
///
///
- public string ErrorMessage { get; }
+ public string? ErrorMessage { get; }
///
/// Describes the reason for the outcome of the evaluation process
@@ -48,7 +48,7 @@ public sealed class FlagEvaluationDetails
///
/// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number.
///
- public FlagMetadata FlagMetadata { get; }
+ public FlagMetadata? FlagMetadata { get; }
///
/// Initializes a new instance of the class.
@@ -61,7 +61,7 @@ public sealed class FlagEvaluationDetails
/// Error message
/// Flag metadata
public FlagEvaluationDetails(string flagKey, T value, ErrorType errorType, string reason, string variant,
- string errorMessage = null, FlagMetadata flagMetadata = null)
+ string? errorMessage = null, FlagMetadata? flagMetadata = null)
{
this.Value = value;
this.FlagKey = flagKey;
diff --git a/src/OpenFeature/Model/FlagEvaluationOptions.cs b/src/OpenFeature/Model/FlagEvaluationOptions.cs
index 6cf7478d..7bde600c 100644
--- a/src/OpenFeature/Model/FlagEvaluationOptions.cs
+++ b/src/OpenFeature/Model/FlagEvaluationOptions.cs
@@ -24,7 +24,7 @@ public sealed class FlagEvaluationOptions
///
/// An immutable list of hooks to use during evaluation
/// Optional - a list of hints that are passed through the hook lifecycle
- public FlagEvaluationOptions(IImmutableList hooks, IImmutableDictionary hookHints = null)
+ public FlagEvaluationOptions(IImmutableList hooks, IImmutableDictionary? hookHints = null)
{
this.Hooks = hooks;
this.HookHints = hookHints ?? ImmutableDictionary.Empty;
@@ -35,7 +35,7 @@ public FlagEvaluationOptions(IImmutableList hooks, IImmutableDictionary
/// A hook to use during the evaluation
/// Optional - a list of hints that are passed through the hook lifecycle
- public FlagEvaluationOptions(Hook hook, ImmutableDictionary hookHints = null)
+ public FlagEvaluationOptions(Hook hook, ImmutableDictionary? hookHints = null)
{
this.Hooks = ImmutableList.Create(hook);
this.HookHints = hookHints ?? ImmutableDictionary.Empty;
diff --git a/src/OpenFeature/Model/ProviderEvents.cs b/src/OpenFeature/Model/ProviderEvents.cs
index ca7c7e1a..9aee265c 100644
--- a/src/OpenFeature/Model/ProviderEvents.cs
+++ b/src/OpenFeature/Model/ProviderEvents.cs
@@ -16,7 +16,7 @@ public class ProviderEventPayload
///
/// Name of the provider.
///
- public string ProviderName { get; set; }
+ public string? ProviderName { get; set; }
///
/// Type of the event
@@ -26,17 +26,17 @@ public class ProviderEventPayload
///
/// A message providing more information about the event.
///
- public string Message { get; set; }
+ public string? Message { get; set; }
///
/// A List of flags that have been changed.
///
- public List FlagsChanged { get; set; }
+ public List? FlagsChanged { get; set; }
///
/// Metadata information for the event.
///
// TODO: This needs to be changed to a EventMetadata object
- public Dictionary EventMetadata { get; set; }
+ public Dictionary? EventMetadata { get; set; }
}
}
diff --git a/src/OpenFeature/Model/ResolutionDetails.cs b/src/OpenFeature/Model/ResolutionDetails.cs
index 9319096f..5f686d47 100644
--- a/src/OpenFeature/Model/ResolutionDetails.cs
+++ b/src/OpenFeature/Model/ResolutionDetails.cs
@@ -29,25 +29,25 @@ public sealed class ResolutionDetails
///
/// Message containing additional details about an error.
///
- public string ErrorMessage { get; }
+ public string? ErrorMessage { get; }
///
/// Describes the reason for the outcome of the evaluation process
///
///
- public string Reason { get; }
+ public string? Reason { get; }
///
/// A variant is a semantic identifier for a value. This allows for referral to particular values without
/// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable
/// in some cases.
///
- public string Variant { get; }
+ public string? Variant { get; }
///
/// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number.
///
- public FlagMetadata FlagMetadata { get; }
+ public FlagMetadata? FlagMetadata { get; }
///
/// Initializes a new instance of the class.
@@ -59,8 +59,8 @@ public sealed class ResolutionDetails
/// Variant
/// Error message
/// Flag metadata
- public ResolutionDetails(string flagKey, T value, ErrorType errorType = ErrorType.None, string reason = null,
- string variant = null, string errorMessage = null, FlagMetadata flagMetadata = null)
+ public ResolutionDetails(string flagKey, T value, ErrorType errorType = ErrorType.None, string? reason = null,
+ string? variant = null, string? errorMessage = null, FlagMetadata? flagMetadata = null)
{
this.Value = value;
this.FlagKey = flagKey;
diff --git a/src/OpenFeature/Model/Structure.cs b/src/OpenFeature/Model/Structure.cs
index 8bf4b4c8..47c66923 100644
--- a/src/OpenFeature/Model/Structure.cs
+++ b/src/OpenFeature/Model/Structure.cs
@@ -62,7 +62,7 @@ public Structure(IDictionary attributes)
/// The key of the value to be retrieved
/// value to be mutated
/// indicating the presence of the key.
- public bool TryGetValue(string key, out Value value) => this._attributes.TryGetValue(key, out value);
+ public bool TryGetValue(string key, out Value? value) => this._attributes.TryGetValue(key, out value);
///
/// Gets all values as a Dictionary
diff --git a/src/OpenFeature/Model/Value.cs b/src/OpenFeature/Model/Value.cs
index c7f60c44..5af3b8b3 100644
--- a/src/OpenFeature/Model/Value.cs
+++ b/src/OpenFeature/Model/Value.cs
@@ -10,7 +10,7 @@ namespace OpenFeature.Model
///
public sealed class Value
{
- private readonly object _innerValue;
+ private readonly object? _innerValue;
///
/// Creates a Value with the inner value set to null
@@ -136,7 +136,7 @@ public Value(Object value)
/// Returns the underlying inner value as an object. Returns null if the inner value is null.
///
/// Value as object
- public object AsObject => this._innerValue;
+ public object? AsObject => this._innerValue;
///
/// Returns the underlying int value
@@ -164,21 +164,21 @@ public Value(Object value)
/// Value will be null if it isn't a string
///
/// Value as string
- public string AsString => this.IsString ? (string)this._innerValue : null;
+ public string? AsString => this.IsString ? (string?)this._innerValue : null;
///
/// Returns the underlying Structure value
/// Value will be null if it isn't a Structure
///
/// Value as Structure
- public Structure AsStructure => this.IsStructure ? (Structure)this._innerValue : null;
+ public Structure? AsStructure => this.IsStructure ? (Structure?)this._innerValue : null;
///
/// Returns the underlying List value
/// Value will be null if it isn't a List
///
/// Value as List
- public IImmutableList AsList => this.IsList ? (IImmutableList)this._innerValue : null;
+ public IImmutableList? AsList => this.IsList ? (IImmutableList?)this._innerValue : null;
///
/// Returns the underlying DateTime value
From 09636111493eb7ac7ca9932a12f635f05325de8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:24:13 +0000
Subject: [PATCH 07/25] More fixes for Model
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
src/OpenFeature/Model/FlagEvaluationDetails.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/OpenFeature/Model/FlagEvaluationDetails.cs b/src/OpenFeature/Model/FlagEvaluationDetails.cs
index f7769085..9af2f4bf 100644
--- a/src/OpenFeature/Model/FlagEvaluationDetails.cs
+++ b/src/OpenFeature/Model/FlagEvaluationDetails.cs
@@ -36,14 +36,14 @@ public sealed class FlagEvaluationDetails
///
/// Describes the reason for the outcome of the evaluation process
///
- public string Reason { get; }
+ public string? Reason { get; }
///
/// A variant is a semantic identifier for a value. This allows for referral to particular values without
/// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable
/// in some cases.
///
- public string Variant { get; }
+ public string? Variant { get; }
///
/// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number.
@@ -60,7 +60,7 @@ public sealed class FlagEvaluationDetails
/// Variant
/// Error message
/// Flag metadata
- public FlagEvaluationDetails(string flagKey, T value, ErrorType errorType, string reason, string variant,
+ public FlagEvaluationDetails(string flagKey, T value, ErrorType errorType, string? reason, string? variant,
string? errorMessage = null, FlagMetadata? flagMetadata = null)
{
this.Value = value;
From 63e696147e7225be139543afcfa0fb20b7475f2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Silva?=
<2493377+askpt@users.noreply.github.com>
Date: Thu, 28 Mar 2024 09:28:50 +0000
Subject: [PATCH 08/25] Added more nullable fixes.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
---
src/OpenFeature/Api.cs | 4 ++--
src/OpenFeature/EventExecutor.cs | 8 +++----
src/OpenFeature/FeatureProvider.cs | 10 ++++----
src/OpenFeature/Hook.cs | 8 +++----
src/OpenFeature/IFeatureClient.cs | 20 ++++++++--------
src/OpenFeature/OpenFeatureClient.cs | 36 ++++++++++++++--------------
6 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/src/OpenFeature/Api.cs b/src/OpenFeature/Api.cs
index af302e7e..72dc1b86 100644
--- a/src/OpenFeature/Api.cs
+++ b/src/OpenFeature/Api.cs
@@ -138,8 +138,8 @@ public FeatureProvider GetProvider(string clientName)
/// Logger instance used by client
/// Context given to this client
///
- public FeatureClient GetClient(string name = null, string version = null, ILogger logger = null,
- EvaluationContext context = null) =>
+ public FeatureClient GetClient(string? name = null, string? version = null, ILogger? logger = null,
+ EvaluationContext? context = null) =>
new FeatureClient(name, version, logger, context);
///
diff --git a/src/OpenFeature/EventExecutor.cs b/src/OpenFeature/EventExecutor.cs
index 7bdfeb6e..a930dc26 100644
--- a/src/OpenFeature/EventExecutor.cs
+++ b/src/OpenFeature/EventExecutor.cs
@@ -14,7 +14,7 @@ internal class EventExecutor : IAsyncDisposable
{
private readonly object _lockObj = new object();
public readonly Channel