From af83194e7935719828741ad32d17a3066645f385 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Tue, 21 Jul 2026 13:52:34 +0200 Subject: [PATCH] fix(acl): use camelCase indicatieGebruiksrecht so OpenZaak honours it (refs #103) The ZGW Documenten API property is indicatieGebruiksrecht (camelCase); the all-lowercase key was silently dropped on write (DRF camel-case mapping), leaving the field null so the zaak still could not close. Correct the JSON name on the DTO and both assertions to match the ZGW spec. Co-Authored-By: Claude Opus 4.8 (1M context) --- services/acl/Acl.Infrastructure/OpenZaakGateway.cs | 2 +- .../acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs | 2 +- services/acl/Acl.Tests/OpenZaakGatewayTests.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/acl/Acl.Infrastructure/OpenZaakGateway.cs b/services/acl/Acl.Infrastructure/OpenZaakGateway.cs index fca6cb2..18907ab 100644 --- a/services/acl/Acl.Infrastructure/OpenZaakGateway.cs +++ b/services/acl/Acl.Infrastructure/OpenZaakGateway.cs @@ -252,7 +252,7 @@ public sealed class OpenZaakGateway(HttpClient http, OpenZaakOptions options) : [property: JsonPropertyName("vertrouwelijkheidaanduiding")] string Vertrouwelijkheidaanduiding, [property: JsonPropertyName("formaat")] string Formaat, [property: JsonPropertyName("status")] string Status, - [property: JsonPropertyName("indicatiegebruiksrecht")] bool Indicatiegebruiksrecht); + [property: JsonPropertyName("indicatieGebruiksrecht")] bool IndicatieGebruiksrecht); private sealed record ZaakInformatieobjectDto( [property: JsonPropertyName("zaak")] string Zaak, diff --git a/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs b/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs index 4dbd24b..f9c4c13 100644 --- a/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs +++ b/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs @@ -120,7 +120,7 @@ public sealed class OpenZaakGatewayIntegrationTests(OpenZaakFixture stack) Assert.Equal(content.Length, doc.GetProperty("bestandsomvang").GetInt32()); // indicatieGebruiksrecht is recorded as "no restrictions"; left null, OpenZaak would refuse to // close the zaak this document is related to (the S-10b regression that broke the e2e flow). - Assert.False(doc.GetProperty("indicatiegebruiksrecht").GetBoolean()); + Assert.False(doc.GetProperty("indicatieGebruiksrecht").GetBoolean()); // ...and it is related to the zaak (a zaakinformatieobject links the two). var relations = await stack.GetJsonAsync(new Uri(stack.BaseUrl, diff --git a/services/acl/Acl.Tests/OpenZaakGatewayTests.cs b/services/acl/Acl.Tests/OpenZaakGatewayTests.cs index a66a3fe..e58c050 100644 --- a/services/acl/Acl.Tests/OpenZaakGatewayTests.cs +++ b/services/acl/Acl.Tests/OpenZaakGatewayTests.cs @@ -491,7 +491,7 @@ public class OpenZaakGatewayTests Assert.Contains("\"status\":\"definitief\"", create.Body); // indicatieGebruiksrecht must be set explicitly (false = no usage restrictions); left null, // OpenZaak refuses to close the zaak this document is related to ("indicatiegebruiksrecht-unset"). - Assert.Contains("\"indicatiegebruiksrecht\":false", create.Body); + Assert.Contains("\"indicatieGebruiksrecht\":false", create.Body); // The file content is base64-encoded into `inhoud`, with its byte length in `bestandsomvang`. Assert.Contains($"\"inhoud\":\"{Convert.ToBase64String([10, 20, 30])}\"", create.Body); Assert.Contains("\"bestandsomvang\":3", create.Body);