Adding Swagger to Quarkus

Man working at night coding and pointing on a screen with a pen
Reading Time: 2 minutes


Open API or Swagger specification is the factual standard for creating REST APIs. Almost every developer expects to see some Swagger documentation when working with APIs or doing integration. In this blog, we will go through how to add Swagger to Quarkus application

Add Open API dependency

Here we need to add the quarkus-small rye-open API to the project, It will generate an OpenAPI dynamic schema and also has a built-in Swagger UI.


Add configuration Class

We don’t necessarily need to have this file, but it’s highly recommended. It contains annotations that provide information about the API’s purpose, maintainer, licensing, etc. Note that to make the annotations work, the file should extend Application from

Enable Swagger UI

To change the path, add this configuration


After that, Swagger UI is accessible at /swagger-ui.

Override this parameter to provide a custom path


Document the APIs

We will create a Student bean and a StudentResource REST resource 

Swagger UI

In any project when developers build APIs, developers want to test them easily and fast. So, Swagger UI is a great tool permitting you to visualize and interact with your APIs in a properly documented form. The Swagger UI produces our APIs in a proper documented form which is automatically generated from your OpenAPI specification.


In this blog, we create a straightforward REST application to demonstrate how fast you can expose your API specification and benefit from a user interface to test it. In Quarkus swagger is based on smart defaults and the dependencies available on the classpath. Anyone can adjust all defaults and add their own parameters to the configuration file.


Written by 

Deepak kumar is a Software Intern at Knoldus Inc. He has done Post Graduation from Ajay Kumar Garg Engineering College Ghaziabad. He has the knowledge of various programming languages. He is passionate about Java development and curious to learn Java Technologies. He is a quick learner, problem solver and always enjoy to help others. His hobbies playing Cricket and watching Hollywood movies.