Since Spring Boot 4 et al, adopted JSpecify, we've been trying to null-safe our code. However, at the boundaries, nulls sneak in, and in MongoDB projections in-particular, we can end up with a null value in a non-null field JSpecify @NullMarked class or record.
Could the mapping infrastructure help us out here, rather than having a big debug session on our hands, by asserting nullness (configurable as assert x != null; (for those that want to use -ea in dev/CI/QA but not prod) or Objects.requireNonNull(x)?
Since Spring Boot 4 et al, adopted JSpecify, we've been trying to null-safe our code. However, at the boundaries, nulls sneak in, and in MongoDB projections in-particular, we can end up with a null value in a non-null field JSpecify
@NullMarkedclass or record.Could the mapping infrastructure help us out here, rather than having a big debug session on our hands, by asserting nullness (configurable as
assert x != null;(for those that want to use-eain dev/CI/QA but not prod) orObjects.requireNonNull(x)?