errors/1 problems helper - #93
Merged
Merged
Conversation
JosteinGj
added this pull request to stack #99
September 15, 2026 09:17
olavgg
force-pushed
the
errors/1-problems-helper
branch
from
September 15, 2026 13:26
e361530 to
e27d577
Compare
Adds Problems, the conventions for RFC 9457 problem responses. Nothing uses it
yet; the advices and controllers follow.
Errors were rendered four ways: ten advices returned ProblemDetail, two returned
a ResponseError<T> wrapper, controllers hand-rolled bare strings in 27 places,
and BuildErrorResponse returned a DataWrapper — a success-shaped envelope, so a
validation failure came back as {"items":[{"externalId":"must not be blank"}]}
and a client could not tell it from a successful listing by shape.
Three things the class settles:
type is the contract, and there is one host. Prose changes, a URI does not.
UserInfoRejectedExceptionHandler currently mints datahub.intellistream.ai while
everything else uses intellistream.ai — a second host for one scheme, which is
what declaring the types as constants is meant to stop.
fields keeps what the old shape threw away. FieldValidationError carries an
i18n key and its arguments — resource.source.max.length.error with the offending
length — and BuildErrorResponse collapsed each into Map.of(path, message),
dropping both. Callers got English prose they could neither localise nor read
the limit from. The extension carries all four parts, so the response is more
useful than the one it replaces.
Extensions are RFC 9457's own mechanism (§3.2) and consumers must ignore
unrecognised ones, so adding a member later cannot break a conforming client —
unlike adding a field to a bespoke wrapper a strict deserializer may reject.
ProblemWireShapeTest renders one through MVC rather than a plain mapper: the
mixin that flattens extensions to the top level is applied by the message
converter, not the type, so a unit test alone would have suggested callers
should read $.properties.fields.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
JosteinGj
force-pushed
the
errors/1-problems-helper
branch
from
September 16, 2026 07:40
e27d577 to
652d3ee
Compare
JosteinGj
marked this pull request as ready for review
September 16, 2026 07:40
olavgg
approved these changes
Sep 16, 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.
What this changes
How it was verified
Checklist
git commit -s), per CONTRIBUTING.md./gradlew buildpasses(see AGENTS.md for which of the two documentation sites it belongs in)