Skip to content

Commit

Permalink
I18N-1322 - Generate & document OpenAPI Specification
Browse files Browse the repository at this point in the history
Removed unnecessary @ApiResponses annotations
  • Loading branch information
DarKhaos committed Nov 18, 2024
1 parent a29de8e commit 12e2b0d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 32 deletions.
3 changes: 2 additions & 1 deletion webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<frontend.maven.plugin.version>1.11.0</frontend.maven.plugin.version>
<node.version>v20.18.0</node.version>
<npm.version>8.2.0</npm.version>
<springdoc.version>2.6.0</springdoc.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -143,7 +144,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.6.0</version>
<version>${springdoc.version}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfiguration {
@Value("${build.version}")
private String buildVersion;

@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.info(
new Info()
.title("Mojito API")
.version("0.111-SNAPSHOT")
.version(buildVersion)
.description("Mojito API Documentation"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import com.box.l10n.mojito.service.asset.VirutalAssetMissingTextUnitException;
import com.box.l10n.mojito.service.pollableTask.PollableFuture;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -47,10 +45,6 @@ public VirtualAsset createOrUpdateVirtualAsset(@RequestBody VirtualAsset virtual
}

@Operation(summary = "Create Text Units for a specific Virtual Asset asynchronously")
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", description = "Successfully created a Pollable Task")
})
@RequestMapping(
value = "/api/virtualAssets/{assetId}/textUnits",
method = RequestMethod.POST,
Expand All @@ -67,10 +61,6 @@ public PollableTask addTextUnits(
}

@Operation(summary = "Update Text Units for a specific Virtual Asset asynchronously")
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", description = "Successfully created a Pollable Task")
})
@RequestMapping(
value = "/api/virtualAssets/{assetId}/textUnits",
method = RequestMethod.PUT,
Expand All @@ -97,10 +87,6 @@ public void deleteTextUnit(
}

@Operation(summary = "Create Text Units for a specific Virtual Asset asynchronously")
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", description = "Successfully created a Pollable Task")
})
@RequestMapping(
value = "/api/virtualAssets/{assetId}/locale/{localeId}/textUnits",
method = RequestMethod.POST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import com.box.l10n.mojito.service.branch.SparseBranchStatisticRepository;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -60,12 +58,6 @@ public class BranchStatisticWS {
@Autowired BranchTextUnitStatisticRepository branchTextUnitStatisticRepository;

@Operation(summary = "Get paginated Branch Statistics for a given set of parameters")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "Successfully retrieved paginated Branch Statistics")
})
@JsonView(View.BranchStatistic.class)
@RequestMapping(
value = "/api/branchStatistics",
Expand Down Expand Up @@ -136,12 +128,6 @@ public Page<BranchStatistic> getBranchesOfRepository(
}

@Operation(summary = "Get Branch Text Unit Statistics paginated for a specific Branch Statistic")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "Successfully retrieved paginated Branch Text Unit Statistics")
})
@JsonView(View.BranchTextUnitStatistic.class)
@RequestMapping(
value = "/api/branchStatistics/{id}/branchTextUnitStatistics",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import com.box.l10n.mojito.service.tm.search.SearchType;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
Expand Down

0 comments on commit 12e2b0d

Please sign in to comment.