
Declarative Resources
=====================


Status
------

2026-02-08: Draft
2026-02-08: Accepted
2026-09-14: Reviewed



Context
-------

There are two ways to create resources (controllers) in Micronaut: programmatically or annotated.

Configuring resources can be declared programmatically. Organizing the code might require the *composite root* pattern.

Annotated resources can be declarations with either JAX-RS, or Micronaut own annotations. Since Micronaut has a limited JAX-RS implementation, it's own annotations is preferred.



Decision
--------

We will use declarative resources with Micronaut annotations.



Justification
-------------

A declarative resource is simpler to maintain, it offers all needed annotation to process basic requests, reducing the boilerplate of creating structures.


