Strange exception after migrating to Micronaut 4 #10258
-
Hi,
It occurs for all endpoints that have a parameter null, we do annotate nullable parameters with We have a bunch of customization on top of the way the application is created and we use our own classloader, I don't know if it can cause the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
could you provide a reproducer in an issue report? |
Beta Was this translation helpful? Give feedback.
-
I confirm that moving to a POJO for the request body instead of multiple parameters fixes the issue. @ExecuteOn(TaskExecutors.IO)
@Post(uri = "executions/daily")
@Operation(tags = {"Stats"}, summary = "Get daily statistics for executions")
public List<DailyExecutionStatistics> dailyStatistics(@Body @Valid StatisticRequest statisticRequest) {
// @TODO: seems to be converted back to utc by micronaut
return executionRepository.dailyStatistics(
statisticRequest.q(),
tenantService.resolveTenant(),
statisticRequest.namespace(),
statisticRequest.flowId(),
statisticRequest.startDate() != null ? statisticRequest.startDate().withZoneSameInstant(ZoneId.systemDefault()) : null,
statisticRequest.endDate() != null ? statisticRequest.endDate().withZoneSameInstant(ZoneId.systemDefault()) : null,
null,
false
);
}
@Introspected
public record StatisticRequest(
@Parameter(description = "A string filter") @Nullable String q,
@Parameter(description = "A namespace filter prefix") @Nullable String namespace,
@Parameter(description = "A flow id filter") @Nullable String flowId,
@Parameter(description = "A flow id filter") @Nullable @Format("yyyy-MM-dd'T'HH:mm[:ss][.SSS][XXX]") ZonedDateTime startDate,
@Parameter(description = "The end datetime, default to now") @Nullable @Format("yyyy-MM-dd'T'HH:mm[:ss][.SSS][XXX]")ZonedDateTime endDate) {} |
Beta Was this translation helpful? Give feedback.
I confirm that moving to a POJO for the request body instead of multiple parameters fixes the issue.