Skip to content

Commit

Permalink
Add spring doc to generate open api doc, open http://127.0.0.1:8080/d…
Browse files Browse the repository at this point in the history
…ddsample/swagger-ui/index.html to see it on browser.
  • Loading branch information
c5ms committed Dec 7, 2024
1 parent ea34aa9 commit dd8085c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ You can use cURL to send the request using an JSON file for the body:
-H 'Content-Type: application/json;charset=UTF-8' \
http://localhost:8080/dddsample/handlingReport

See the [api-docs.yaml](/api-docs.yaml) file for a complete API definition.
open http://127.0.0.1:8080/dddsample/swagger-ui/index.html for a complete API definition.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- doc -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package se.citerus.dddsample.interfaces.handling.ws;

import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -23,6 +24,7 @@
* of incoming data, and in case of a valid registration attempt, sends an asynchronous message
* with the information to the handling event registration system for proper registration.
*/
@Tag(name = "report")
@RestController
public class HandlingReportServiceImpl implements HandlingReportService {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package se.citerus.dddsample.interfaces.tracking.ws;

import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -23,6 +24,7 @@

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

@Tag(name = "track")
@RestController
public class CargoTrackingRestService {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
Expand Down

0 comments on commit dd8085c

Please sign in to comment.