liveBook · Manning

Quarkus-rest

As explained in Quarkus in Action

quarkus-rest is a Quarkus extension that integrates RESTful web-service support into a Quarkus application.

quarkus-rest integrates RESTful web-service support into Quarkus. It provides the default REST layer and implements the Jakarta RESTful Web Services (JAX-RS) specification, allowing applications to expose REST resources through an annotation-based model. section 2.1.1 section 4.1

Use quarkus-rest to:

  • Add REST support as the io.quarkus:quarkus-rest Maven dependency. section 2.7.1
  • Generate a Quarkus application with the quarkus-rest extension selected. section 2.1.1
  • Define resources with JAX-RS annotations such as @Path, @GET, @POST, @Consumes, and @Produces. section 4.1
  • Combine REST support with separate JSON serialization extensions when REST endpoints need JSON. section 2.7.1

Generate a REST-enabled application

Run the Quarkus Maven plugin with -Dextensions="quarkus-rest" to create a project. Pin -DplatformVersion=3.15.1 when reproducing the stated platform version; otherwise, the latest available platform version is used. section 2.1.1

Listing 2.18 Quarkus REST extension Maven dependency
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-rest</artifactId>
</dependency>

Inspect the Maven dependency that adds quarkus-rest to an existing Quarkus project. section 2.7.1

How Quarkus in Action covers it

How deep it goes
Defines the extension, dependency, specification, generation path, and core annotations, but defers endpoint implementation details.
Examples
Uses Maven generation commands, a Maven dependency declaration, and annotations including @Path, @GET, and @POST.
What you can do after
Build REST endpoints by adding the extension and mapping resource classes or methods with JAX-RS annotations.
How it connects
Connects REST resources with Jakarta RESTful Web Services, JAX-RS annotations, Quarkus extensions, and JSON serialization libraries.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.