Skip to content

Commit 4a898ff

Browse files
committed
updating OpenAPI documentation.
1 parent e862852 commit 4a898ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/fr/fxjavadevblog/aid/api/genre/GenreResource.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@
1616
import org.eclipse.microprofile.metrics.MetricUnits;
1717
import org.eclipse.microprofile.metrics.annotation.Timed;
1818
import org.eclipse.microprofile.openapi.annotations.Operation;
19+
import org.eclipse.microprofile.openapi.annotations.media.Content;
20+
import org.eclipse.microprofile.openapi.annotations.media.Schema;
1921
import org.eclipse.microprofile.openapi.annotations.parameters.Parameter;
2022
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
2123
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
2224

2325
import fr.fxjavadevblog.aid.api.videogame.VideoGame;
2426
import fr.fxjavadevblog.aid.api.videogame.VideoGameRepository;
27+
import fr.fxjavadevblog.aid.utils.jaxrs.media.SpecificMediaType;
2528
import fr.fxjavadevblog.aid.utils.jaxrs.pagination.Pagination;
2629
import fr.fxjavadevblog.aid.utils.jaxrs.pagination.QueryParameterUtils;
2730
import fr.fxjavadevblog.aid.utils.pagination.PagedResponse;
@@ -61,7 +64,8 @@ public Genre[] getAllGenres() {
6164
absolute = true,
6265
description = "A measure of how long it takes to fetch all video games filtered by a given genre.",
6366
unit = MetricUnits.MILLISECONDS)
64-
@APIResponse(responseCode = "206", description = "Partial response. Paged.")
67+
@APIResponse(responseCode = "206", description = "Partial response. Paged.", content= {@Content( schema=@Schema(implementation = VideoGame.class))})
68+
@APIResponse(responseCode = "412", description = "Invalid parameters.", content= { @Content(mediaType=SpecificMediaType.APPLICATION_PROBLEM_JSON) } )
6569
public Response findByGenre(@PathParam("genre")
6670
final Genre genre,
6771

0 commit comments

Comments
 (0)