Require naam when contactpersoonRol is supplied on rol creation (v1.5) - #216
Merged
Merged
Conversation
POST /rollen accepted a contactpersoonRol object without a naam and only failed later on the NOT NULL database column, surfacing as an unhandled 500 instead of a validation error. Add a NotNull check with error code "required" to the naam child rule in the v1.5 base ZaakRolRequestDtoValidator, so the request is rejected with a ValidatieFout naming contactpersoonRol.naam. All five betrokkeneType validators include this base validator, so every type is covered. An empty string stays valid, matching the presence-only "required" semantics of the standard, and the v1 contract has no contactpersoonRol field so it is unaffected. Adds validator unit tests for the base and vestiging validators. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The validation matches the stated presence semantics and is covered through both base and derived validators.
Pull request overview
Adds v1.5 validation to prevent database failures when contactpersoonRol.naam is null.
Changes:
- Returns a
requiredvalidation error for null or omitted names. - Preserves optional
contactpersoonRoland allows empty names. - Adds base and derived-validator coverage.
File summaries
| File | Description |
|---|---|
ZaakRolRequestDtoValidatorTests.cs |
Tests base validation behavior. |
VestigingZaakRolRequestValidatorTests.cs |
Verifies inherited validation. |
ZaakRolRequestDtoValidator.cs |
Adds the required-name rule. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
heuvea
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
POST /rollen accepted a contactpersoonRol object without a naam and only failed later on the NOT NULL database column, surfacing as an unhandled 500 instead of a validation error.
Add a NotNull check with error code "required" to the naam child rule in the v1.5 base ZaakRolRequestDtoValidator, so the request is rejected with a ValidatieFout naming contactpersoonRol.naam. All five betrokkeneType validators include this base validator, so every type is covered. An empty string stays valid, matching the presence-only "required" semantics of the standard, and the v1 contract has no contactpersoonRol field so it is unaffected.
Adds validator unit tests for the base and vestiging validators.
Type of Change
Testing
Checklist