micronaut-projects / micronaut-projects/micronaut-problem-json
Serialization of custom parameters nested in "parameters" field with Jackson and Kotlin
- 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
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