kit-data-manager / kit-data-manager/ro-crate-java

Propagate validation errors instead of boolean return value

Open
#259 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
5
Forks
4
PR merge metrics
No merged PRs in 30d

Description

In order to account for simplification, we often use validation on a true/false basis. But I think that sometimes it may be useful to get a list of error messages. As a first step, we should propagate these errors at least in classes such as `JsonSchemaValidation`. Instead of a boolean, we could return an Optional or so. The boolean style checks can then still performed like `boolean isValid = errors.isEmpty()` or so. We can then consider in each place this is used how to handle this information. In some parts the boolean logic is likely ok and enough, in others it may make sense to have handling code or provide it to the caller (and possibly to the user, especially when it comes to creating crates).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the JsonSchemaValidation class and tracing its boolean validation callers, including the logic used when creating crates. Determine how validation messages should be propagated while preserving callers that only need a boolean; completion requires an agreed scope and handling strategy across those use sites.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.