Skip to content

Commit

Permalink
fix: return type in openapi for mappings that return strings (closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Aug 1, 2024
1 parent af81fc2 commit 6cec770
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface IApiKeysController {
tags = "API Keys"
)
@ApiResponses({
@ApiResponse(responseCode = "201", description = "Key created", content = @Content(schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "201", description = "Key created", content = @Content(mediaType = MediaType.TEXT_PLAIN_VALUE, schema = @Schema(type = "string"))),
@ApiResponse(responseCode = "401", description = "Api session missing, invalid or expired"),
@ApiResponse(responseCode = "403", description = "Not enough permissions to use this endpoint")})
@PostMapping(path = "/keys", produces = MediaType.TEXT_PLAIN_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import io.papermc.hangar.model.internal.api.requests.StringContent;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
Expand All @@ -27,7 +29,7 @@ public interface IPagesController {
tags = "Pages"
)
@ApiResponses({
@ApiResponse(responseCode = "200", description = "Ok"),
@ApiResponse(responseCode = "200", description = "Ok", content = @Content(mediaType = MediaType.TEXT_PLAIN_VALUE, schema = @Schema(type = "string"))),
@ApiResponse(responseCode = "401", description = "Api session missing, invalid or expired"),
@ApiResponse(responseCode = "403", description = "Not enough permissions to use this endpoint")
})
Expand All @@ -48,7 +50,7 @@ default String getMainPage(@Parameter(description = "The author of the project t
tags = "Pages"
)
@ApiResponses({
@ApiResponse(responseCode = "200", description = "Ok"),
@ApiResponse(responseCode = "200", description = "Ok", content = @Content(mediaType = MediaType.TEXT_PLAIN_VALUE, schema = @Schema(type = "string"))),
@ApiResponse(responseCode = "401", description = "Api session missing, invalid or expired"),
@ApiResponse(responseCode = "403", description = "Not enough permissions to use this endpoint")
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Encoding;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
Expand Down Expand Up @@ -124,7 +125,7 @@ default PaginatedResult<Version> getVersions(@Parameter(description = "The autho
tags = "Versions"
)
@ApiResponses({
@ApiResponse(responseCode = "200", description = "Ok"),
@ApiResponse(responseCode = "200", description = "Ok", content = @Content(mediaType = MediaType.TEXT_PLAIN_VALUE, schema = @Schema(type = "string"))),
@ApiResponse(responseCode = "401", description = "Api session missing, invalid or expired"),
@ApiResponse(responseCode = "403", description = "Not enough permissions to use this endpoint")
})
Expand All @@ -146,7 +147,7 @@ default String getLatestReleaseVersion(@Parameter(description = "The author of t
tags = "Versions"
)
@ApiResponses({
@ApiResponse(responseCode = "200", description = "Ok"),
@ApiResponse(responseCode = "200", description = "Ok", content = @Content(mediaType = MediaType.TEXT_PLAIN_VALUE, schema = @Schema(type = "string"))),
@ApiResponse(responseCode = "401", description = "Api session missing, invalid or expired"),
@ApiResponse(responseCode = "403", description = "Not enough permissions to use this endpoint")
})
Expand Down

0 comments on commit 6cec770

Please sign in to comment.