-
On micronaut version 3, it worked fine, while migrating to micronaut 4, stopped working In a endpoint annotated with
When I call it (eg. postman) micronaut gives me an error on console
here's a piece of my controller @Validated
@Controller("/something")
class SomethingController(@Inject val service: SomeService) {
@Secured(SecurityRule.IS_AUTHENTICATED)
@Get("/{someId}/someAction",
produces = ["application/some.v1+json"],
consumes = ["application/some.v1+json"])
fun getSomething(
someId: UUID,
principal: Principal
): List<SomeResource> {
principal as MyIdentity
return service.findAll(someId, principal)
} My service has more endpoints, is there a way to write one codec that handle with all those customs produces and consumes? I posted first on StackOverflow |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
try adding your type to additional-types as described here: https://docs.micronaut.io/latest/guide/index.html#consumesAnnotation |
Beta Was this translation helpful? Give feedback.
try adding your type to additional-types as described here: https://docs.micronaut.io/latest/guide/index.html#consumesAnnotation