JsonMessageHandler does not handle other +json media types

Author: dstepanovCreated Sep 22, 2026Updated Sep 22, 2026

JsonMessageHandler is registered, through @ProducesJson / @ConsumesJson, for a fixed list of JSON media types (application/json, application/hal+json, application/problem+json, ...). A route that produces another +json media type, such as

  • application/prs.hal-forms+json (HAL-FORMS)
  • application/vnd.collection+json (Collection+JSON)
  • application/vnd.amundsen-uber+json (UBER)
  • application/alps+json (ALPS)

fails with CodecException: Cannot encode value of argument [...]. No possible encoders found for media type, although JsonMessageHandler.isReadable / isWriteable already accept any media type with the json extension.

Suggestion: select the JSON handler for any media type with the +json structured suffix when no more specific handler exists, or document an extension point to add types.

Workaround: micronaut-hateoas registers its own MessageBodyHandler with @Produces / @Consumes for those types, delegating to new JsonMessageHandler<>(jsonMapper).

Source: micronaut-projects/micronaut-core