From be88313d52bea1dd73d7f475ee6827093f8f6f47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 26 Oct 2026 12:19:00 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Lakera/Generated/Lakera.Exceptions.g.cs | 26 +++++++++++++++++++ .../Lakera.JsonSerializerContext.g.cs | 1 + .../Lakera.JsonSerializerContextTypes.g.cs | 5 ++++ 3 files changed, 32 insertions(+) diff --git a/src/libs/Lakera/Generated/Lakera.Exceptions.g.cs b/src/libs/Lakera/Generated/Lakera.Exceptions.g.cs index 8343e38..0d66f83 100644 --- a/src/libs/Lakera/Generated/Lakera.Exceptions.g.cs +++ b/src/libs/Lakera/Generated/Lakera.Exceptions.g.cs @@ -20,6 +20,32 @@ public partial class ApiException : global::System.Exception /// public string? ResponseBody { get; set; } + /// + /// Successful HTTP responses that fail during processing put the cause before a bounded body preview. + /// Inspect ResponseBody for the full response; HTTP service-error messages retain their existing format. + /// + public override string Message + { + get + { + if ((int)StatusCode < 200 || (int)StatusCode >= 300 || InnerException == null) + { + return base.Message; + } + + string? path = (InnerException as global::System.Text.Json.JsonException)?.Path; + return "Response processing failed after successful HTTP " + + ((int)StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture) + ": " + + InnerException.GetType().FullName + ": " + BoundDiagnosticText(InnerException.Message) + + (string.IsNullOrEmpty(path) ? string.Empty : " Path: " + BoundDiagnosticText(path, 256)) + + "\nResponse preview: " + BoundDiagnosticText(base.Message); + } + } + + private static string BoundDiagnosticText(string? value, int maximumLength = 512) => + value == null ? string.Empty : + value.Length <= maximumLength ? value : value.Substring(0, maximumLength) + "... [truncated]"; + /// /// The response headers. /// diff --git a/src/libs/Lakera/Generated/Lakera.JsonSerializerContext.g.cs b/src/libs/Lakera/Generated/Lakera.JsonSerializerContext.g.cs index 6fec617..6d361d5 100644 --- a/src/libs/Lakera/Generated/Lakera.JsonSerializerContext.g.cs +++ b/src/libs/Lakera/Generated/Lakera.JsonSerializerContext.g.cs @@ -30,6 +30,7 @@ namespace Lakera #pragma warning restore CS3016 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Lakera.JsonSerializerContextTypes))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Lakera.GuardRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Lakera.GuardMessage))] diff --git a/src/libs/Lakera/Generated/Lakera.JsonSerializerContextTypes.g.cs b/src/libs/Lakera/Generated/Lakera.JsonSerializerContextTypes.g.cs index b611566..391a48a 100644 --- a/src/libs/Lakera/Generated/Lakera.JsonSerializerContextTypes.g.cs +++ b/src/libs/Lakera/Generated/Lakera.JsonSerializerContextTypes.g.cs @@ -25,6 +25,11 @@ public sealed partial class JsonSerializerContextTypes /// public global::System.Collections.Generic.List? ObjectList { get; set; } + /// + /// String arrays used by dynamic JSON option values. + /// + public string[]? StringArray { get; set; } + /// /// ///