Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
# swagger-ui custom path
springdoc.swagger-ui.path=/swagger-ui.html
# /api-docs endpoint custom path
springdoc.api-docs.path=/api-docs


5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
<version>2.2.224</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.13</version>
</dependency>
</dependencies>

<build>
Expand Down
15 changes: 3 additions & 12 deletions src/main/java/com/mrxgrc/inventory/controller/RootController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,15 @@

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.view.RedirectView;

import java.util.Map;

@RestController
public class RootController {

@GetMapping("/")
public Map<String, Object> getRoot() {
return Map.of(
"message", "Hello World! Welcome to the Inventory API",
"endpoints", Map.of(
"items", "/items",
"getItemById", "/items/{id}",
"createItem", "POST /items",
"updateItem", "PUT /items/{id}",
"deleteItem", "DELETE /items/{id}",
"health", "/health"
)
);
public RedirectView redirectToSwagger() {
return new RedirectView("/swagger-ui/index.html");
}
}