Skip to content

Commit

Permalink
Added swagger documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Mar 1, 2021
1 parent 828f4df commit 81c5a86
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
6 changes: 6 additions & 0 deletions job-service/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<properties>
<java.version>11</java.version>
<springdoc-ui.version>1.5.4</springdoc-ui.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -53,6 +54,11 @@
<artifactId>flyway-core</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc-ui.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions job-service/server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ verapdf:
listening-queue:
name: ${amqp.server.listening.queue.name}
max-size: ${amqp.server.listening.queue.max.size}

springdoc:
api-docs:
path: /jobs/docs
enabled: true
swagger-ui:
path: /jobs/swagger
operations-sorter: method
enabled: true
6 changes: 6 additions & 0 deletions local-storage-service/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<properties>
<java.version>11</java.version>
<springdoc-ui.version>1.5.4</springdoc-ui.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -51,6 +52,11 @@
<artifactId>flyway-core</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc-ui.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ public FileController(StoredFileService storedFileService) {
this.storedFileService = storedFileService;
}

@PostMapping
@PostMapping(consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, MediaType.APPLICATION_JSON_VALUE})
public ResponseEntity<StoredFileDTO> uploadFile(@RequestPart("file") MultipartFile file,
@RequestPart(required = false) @Pattern(regexp = "^[\\da-fA-F]{32}$") String contentMD5) throws VeraPDFBackendException {
@RequestPart(required = false)
@Pattern(regexp = "^[\\da-fA-F]{32}$") String contentMD5) throws VeraPDFBackendException {
StoredFileDTO storedFileDTO = storedFileService.saveStoredFile(file, contentMD5);
URI uri = MvcUriComponentsBuilder
.fromMethodName(FileController.class,
"getFileData", storedFileDTO.getId())
"getFileData", storedFileDTO.getId())
.build()
.encode()
.toUri();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ verapdf:
files:
min-space-threshold: ${localstorage.disk.min.space.threshold:5GB}
base-dir: /opt/verapdf/localstorageservice/files

springdoc:
api-docs:
path: /files/docs
enabled: true
swagger-ui:
path: /files/swagger
operations-sorter: method
enabled: true

0 comments on commit 81c5a86

Please sign in to comment.