Swagger

Introduction

  • Swagger is one of the popular type of documentation to show the api end point and test the result of end point which is just like a postman

Configuration

<dependency>
		<groupId>org.springdoc</groupId>
		<artifactId>springdoc-openapi-ui</artifactId>
		<version>1.5.2</version>
</dependency>
<dependency>
		<groupId>org.springdoc</groupId>
		<artifactId>springdoc-openapi-data-rest</artifactId>
		<version>1.5.2</version>
</dependency>
// application.properties
// To define the uri of swagger
// To define the scope of getting controller information
springdoc.api-docs.path= /api-docs
springdoc.swagger-ui.path=/docs/index.html

springdoc.api-docs.enabled= true
springdoc.swagger-ui.enabled=true
springdoc.packages-to-scan= com.luv2code.demo.demo.controllers

Controller

  • Define a interface that need to be secured

Result

Last updated

Was this helpful?