Skip to content

Commit

Permalink
feat: enabled swagger viewer(open-api) for spring boot 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
pSharpX committed Mar 29, 2024
1 parent 16813c6 commit 9fbca72
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ this is a second description

Lets get started!
changed readme file

## Run Postgres database container in local env:
````bash
docker run -itd -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin -p 5432:5432 --name postgresql postgres
````
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>

<reporting>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/* (C)2021 */
package com.tekton.productsmanagement;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Info;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@OpenAPIDefinition(info = @Info(title = "Services API",
version = "1.0",
description = "It supports all capabilities for ProductsManagement application such as catalog and more."))
@SpringBootApplication
public class ProductsManagementApplication {

Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ tp.api.scheme=http
tp.api.host=run.mocky.io
tp.api.port=
tp.api.services.detail=/v3/70361acb-b94d-4fd6-ab7e-1da5df560768
tp.api.services.master=/v3/70361acb-b94d-4fd6-ab7e-1da5df560768
tp.api.services.master=/v3/70361acb-b94d-4fd6-ab7e-1da5df560768

springdoc.api-docs.path=/api-docs
springdoc.override-with-generic-response=false
springdoc.swagger-ui.defaultModelsExpandDepth=-1

0 comments on commit 9fbca72

Please sign in to comment.