micronaut-projects / micronaut-projects/micronaut-problem-json

Regression: debug mode causes passing test to fail

Open
#573 3 comments 0 reactions 0 assignees View on GitHub
status: example attached status: pr submitted type: bug
Dominant language
Java
Stars
14
Forks
9
Avg merge
7h 59m
Merged PRs (30d)
5

Description

### Expected Behavior

Test that pass in normal mode also pass in debug mode

### Actual Behaviour

After upgrading Micronaut from 4.7.6 to 4.8.2 running a test in debug mode fails with SerdeException: No serializable introspection present for type OnAssemblyException

### Steps To Reproduce

Add suspend method in controller that throws a Problem. Call that endpoint in a test and run test in Debug mode. A different response is given depending if tests are run in debug or normal mode.

```Kotlin
@Get
@Produces(MediaType.APPLICATION_JSON_PROBLEM)
open suspend fun index(): String {
throw Problem.builder().withTitle("Validation errors").withStatus(HttpStatusType(HttpStatus.BAD_REQUEST)).build()
}
```

### Environment Information

M1 MacOS 15.5
Java 21
Intellij IdeaIntelliJ IDEA 2025.1.1.1 (Ultimate Edition) Build #IU-251.25410.129, built on May 9, 2025 Kotlin: 251.25410.129-IJ

### Example Application

https://github.com/erkieh/micronaut-debug-error

### Version

4.8.3-SNAPSHOT

Contributor guide

Open the contributing guide

Research direction

Start with the example application at github.com/erkieh/micronaut-debug-error and the suspend controller endpoint shown in the issue. Reproduce the request in normal and IntelliJ debug modes on the stated environment, then trace the SerdeException involving OnAssemblyException; done means the endpoint returns the same response in both modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.