Skip to content

fix: Drop TypeMapper from healthHandler and derive up from dependencies#76

Merged
thced merged 4 commits into
masterfrom
fix/no-typemapper-health
May 20, 2026
Merged

fix: Drop TypeMapper from healthHandler and derive up from dependencies#76
thced merged 4 commits into
masterfrom
fix/no-typemapper-health

Conversation

@thced

@thced thced commented May 20, 2026

Copy link
Copy Markdown
Contributor

healthHandler no longer requires a TypeMapper — the fixed wire shape is rendered by a built-in JSON writer with proper string escaping, so the health endpoint works without a JSON library on the classpath.

HealthOutcome's up flag is now derived: empty dependencies report as up, otherwise up is the conjunction of every dependency's status.

healthHandler no longer requires a TypeMapper — the fixed wire shape is
rendered by a built-in JSON writer with proper string escaping, so the
health endpoint works without a JSON library on the classpath.

HealthOutcome's up flag is now derived: empty dependencies report as up,
otherwise up is the conjunction of every dependency's status.
@thced thced force-pushed the fix/no-typemapper-health branch from d5a98b6 to 087acc3 Compare May 20, 2026 11:55
thced added 2 commits May 20, 2026 13:56
Covers control-char escaping (named and \u####), multi-dependency
ordering, and pass-through of non-ASCII characters — paths the handler
test only exercises indirectly.
@sonarqubecloud

Copy link
Copy Markdown

@thced thced merged commit 6588fd3 into master May 20, 2026
5 checks passed
@thced thced deleted the fix/no-typemapper-health branch May 20, 2026 12:23
thced added a commit that referenced this pull request May 20, 2026
Mirror PR #76's approach (HealthRenderer) for the problem+json wire shape.
The default exception handler and SecurityFilter no longer route ProblemDetail
through a TypeMapper; a hand-rolled ProblemDetailRenderer writes the fixed
RFC 7807 shape directly, so the library emits problem responses without a
JSON library on the classpath and without record-accessor reflection that
GraalVM Native Image would otherwise need configured.

Also replace the reflective GsonJsonMapper newInstance with a direct
constructor call, still gated by the existing Class.forName Gson-presence
probe. Drops the matching reflect-config entry for the constructor.

Extract the shared JSON string-escape into internal/JsonStrings, used by
both HealthRenderer and ProblemDetailRenderer.

BREAKING CHANGE: Handlers.defaultExceptionHandler(TypeMapper) becomes
defaultExceptionHandler(). SecurityFilter constructor drops its
TypeMapper parameter.
thced added a commit that referenced this pull request May 21, 2026
Mirror PR #76's approach (HealthRenderer) for the problem+json wire shape.
The default exception handler and SecurityFilter no longer route ProblemDetail
through a TypeMapper; a hand-rolled ProblemDetailRenderer writes the fixed
RFC 7807 shape directly, so the library emits problem responses without a
JSON library on the classpath and without record-accessor reflection that
GraalVM Native Image would otherwise need configured.

Also replace the reflective GsonJsonMapper newInstance with a direct
constructor call, still gated by the existing Class.forName Gson-presence
probe. Drops the matching reflect-config entry for the constructor.

Extract the shared JSON string-escape into internal/JsonStrings, used by
both HealthRenderer and ProblemDetailRenderer.

BREAKING CHANGE: Handlers.defaultExceptionHandler(TypeMapper) becomes
defaultExceptionHandler(). SecurityFilter constructor drops its
TypeMapper parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants