diff --git a/backend/src/Designer/Exceptions/Options/InvalidOptionsFormatException.cs b/backend/src/Designer/Exceptions/Options/InvalidOptionsFormatException.cs
new file mode 100644
index 00000000000..0dc69bc495d
--- /dev/null
+++ b/backend/src/Designer/Exceptions/Options/InvalidOptionsFormatException.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace Altinn.Studio.Designer.Exceptions.Options;
+
+///
+/// Indicates that an error occurred during json serialization of options.
+///
+[Serializable]
+public class InvalidOptionsFormatException : Exception
+{
+ ///
+ public InvalidOptionsFormatException()
+ {
+ }
+
+ ///
+ public InvalidOptionsFormatException(string message) : base(message)
+ {
+ }
+
+ ///
+ public InvalidOptionsFormatException(string message, Exception innerException) : base(message, innerException)
+ {
+ }
+}
diff --git a/backend/src/Designer/Filters/Options/OptionsErrorCodes.cs b/backend/src/Designer/Filters/Options/OptionsErrorCodes.cs
new file mode 100644
index 00000000000..9053087b1b5
--- /dev/null
+++ b/backend/src/Designer/Filters/Options/OptionsErrorCodes.cs
@@ -0,0 +1,6 @@
+namespace Altinn.Studio.Designer.Filters.Options;
+
+public class OptionsErrorCodes
+{
+ public const string InvalidOptionsFormat = nameof(InvalidOptionsFormat);
+}
diff --git a/backend/src/Designer/Filters/Options/OptionsExceptionFilterAttribute.cs b/backend/src/Designer/Filters/Options/OptionsExceptionFilterAttribute.cs
new file mode 100644
index 00000000000..ead5e0a589a
--- /dev/null
+++ b/backend/src/Designer/Filters/Options/OptionsExceptionFilterAttribute.cs
@@ -0,0 +1,26 @@
+using System.Net;
+using Altinn.Studio.Designer.Exceptions.Options;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Controllers;
+using Microsoft.AspNetCore.Mvc.Filters;
+
+namespace Altinn.Studio.Designer.Filters.Options;
+
+public class OptionsExceptionFilterAttribute : ExceptionFilterAttribute
+{
+ public override void OnException(ExceptionContext context)
+ {
+ base.OnException(context);
+
+ if (context.ActionDescriptor is not ControllerActionDescriptor)
+ {
+ return;
+ }
+
+ if (context.Exception is InvalidOptionsFormatException)
+ {
+ context.Result = new ObjectResult(ProblemDetailsUtils.GenerateProblemDetails(context.Exception, OptionsErrorCodes.InvalidOptionsFormat, HttpStatusCode.BadRequest)) { StatusCode = (int)HttpStatusCode.BadRequest };
+ }
+ }
+
+}
diff --git a/backend/src/Designer/Filters/ProblemDetailsExtensionsCodes.cs b/backend/src/Designer/Filters/ProblemDetailsExtensionsCodes.cs
index 4064393c200..a70c0f6f152 100644
--- a/backend/src/Designer/Filters/ProblemDetailsExtensionsCodes.cs
+++ b/backend/src/Designer/Filters/ProblemDetailsExtensionsCodes.cs
@@ -3,5 +3,5 @@ namespace Altinn.Studio.Designer.Filters;
public static class ProblemDetailsExtensionsCodes
{
public const string ErrorCode = "errorCode";
-
+ public const string Detail = "detail";
}
diff --git a/backend/src/Designer/Helpers/JsonConverterHelpers/NotNullableAttribute.cs b/backend/src/Designer/Helpers/JsonConverterHelpers/NotNullableAttribute.cs
new file mode 100644
index 00000000000..c4a556f977c
--- /dev/null
+++ b/backend/src/Designer/Helpers/JsonConverterHelpers/NotNullableAttribute.cs
@@ -0,0 +1,15 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Altinn.Studio.Designer.Helpers.JsonConverterHelpers;
+
+public class NotNullableAttribute : ValidationAttribute
+{
+ protected override ValidationResult IsValid(object value, ValidationContext validationContext)
+ {
+ if (value == null)
+ {
+ return new ValidationResult("The field is required.");
+ }
+ return ValidationResult.Success;
+ }
+}
diff --git a/backend/src/Designer/Helpers/JsonConverterHelpers/OptionConverterHelper.cs b/backend/src/Designer/Helpers/JsonConverterHelpers/OptionConverterHelper.cs
index a15ad94deeb..824ec4f0727 100644
--- a/backend/src/Designer/Helpers/JsonConverterHelpers/OptionConverterHelper.cs
+++ b/backend/src/Designer/Helpers/JsonConverterHelpers/OptionConverterHelper.cs
@@ -1,10 +1,11 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
+using Altinn.Studio.Designer.Exceptions.Options;
namespace Altinn.Studio.Designer.Helpers.JsonConverterHelpers;
-public class OptionConverter : JsonConverter