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

Serialization of custom parameters nested in "parameters" field with Jackson and Kotlin

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

Description

### Expected Behavior

```kotlin
throw Problem.builder()
.withType(URI.create("https://example.org/out-of-stock"))
.withTitle("Out of Stock")
.withStatus(HttpStatusType(HttpStatus.BAD_REQUEST))
.withDetail("Item B00027Y5QG is no longer available")
.with("product", "B00027Y5QG")
.build()
```

```json
{
"status": 400,
"title": "Out of Stock",
"detail": "Item B00027Y5QG is no longer available",
"type": "https://example.org/out-of-stock",
"parameters": {"product": "B00027Y5QG"}
}

```

### Actual Behaviour

```json
{
"localized_message": "Out of Stock: Item B00027Y5QG is no longer available",
"type": "https://example.org/out-of-stock",
"parameters": {
"product": "B00027Y5QG"
},
"detail": "Item B00027Y5QG is no longer available",
"status": 400,
"title": "Out of Stock"
}
```

### Steps To Reproduce

_No response_

### Environment Information

_No response_

### Example Application

_No response_

### Version

4.8.0

Contributor guide

Open the contributing guide

Research direction

The issue names no source files, tests, or entry points. Start by reproducing the Kotlin/Jackson serialization described for version 4.8.0 and compare the actual and expected problem JSON. Done means the serialization behavior matches the expected structure without the reported discrepancy.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.