annotationProcessor("io.micronaut.jaxrs:micronaut-jaxrs-processor:1.0.2")
Micronaut JAX-RS
JAX-RS Support for Micronaut
Version:
1 Introduction
Micronaut JAX-RS adds support for using JAX-RS annotations and types in a Micronaut application with the aim of helping migrate existing JAX-RS applications or support teams who prefer the JAX-RS annotations.
This project is not an implementation of the JAX-RS specification and is designed to allow users familiar with the JAX-RS API to use the most common parts of the API within the context of a Micronaut application.
2 Release History
For this project, you can find a list of releases (with release notes) here:
3 Quick Start
To use this project you need Micronaut 1.3 or above then add the following annotation processor to any Micronaut project:
<annotationProcessorPaths>
<path>
<groupId>io.micronaut.jaxrs</groupId>
<artifactId>micronaut-jaxrs-processor</artifactId>
<version>1.0.2</version>
</path>
</annotationProcessorPaths>
Then the following compile time dependency:
implementation("io.micronaut.jaxrs:micronaut-jaxrs-server:1.0.2")
<dependency>
<groupId>io.micronaut.jaxrs</groupId>
<artifactId>micronaut-jaxrs-server</artifactId>
<version>1.0.2</version>
</dependency>
4 Supported API
As of this writing Micronaut JAX-RS supports the annotations and types defined within the javax.ws.rs
package and the javax.ws.rs.core
subpackage only.
All interfaces, annotations and types contained within the following packages are not supported:
-
javax.ws.rs.client
-
javax.ws.rs.container
-
javax.ws.rs.ext
Supported Annotations
Micronaut JAX-RS works by converting (at compilation time) a JAX-RS annotation definition into the equivalent Micronaut version.
JAX-RS Annotation | Target Annotation | Example |
---|---|---|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
No equivalent. Injects a bean in to a parameter. |
|
Injectable Parameter Types
In addition to the supported JAX-RS annotations you can use the following JAX-RS types as parameter types to resources or client definitions:
You can also use the @Context annotation to inject any bean into a resource type’s method parameter.
Parameter binding to constructor argument of resource types is not supported at this time. |
Supported Return Types
You can also use the following return types from the JAX-RS API in your resource classes:
5 Repository
You can find the source code of this project in this repository: