File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
backend/src/main/java/net/onelitefeather/otis/controller Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 88import io .micronaut .http .annotation .Post ;
99import io .micronaut .validation .Validated ;
1010import io .swagger .v3 .oas .annotations .Operation ;
11+ import io .swagger .v3 .oas .annotations .media .ArraySchema ;
1112import io .swagger .v3 .oas .annotations .media .Content ;
1213import io .swagger .v3 .oas .annotations .media .Schema ;
1314import io .swagger .v3 .oas .annotations .responses .ApiResponse ;
@@ -231,7 +232,9 @@ public HttpResponse<OtisPlayerDTO> delete(@Valid UUID owner) {
231232 description = "Players retrieved successfully" ,
232233 content = @ Content (
233234 mediaType = "application/json" ,
234- schema = @ Schema (implementation = OtisPlayerDTO .class )
235+ array = @ ArraySchema (schema = @ Schema (implementation = OtisPlayerDTO .class ),
236+ arraySchema = @ Schema (implementation = Page .class )
237+ )
235238 )
236239 )
237240 @ ApiResponse (
@@ -243,10 +246,10 @@ public HttpResponse<OtisPlayerDTO> delete(@Valid UUID owner) {
243246 )
244247 )
245248 @ Get (uris = {"/all" })
246- public HttpResponse <Iterable <OtisPlayerDTO >> getAll (Pageable pageable ) {
249+ public HttpResponse <Page <OtisPlayerDTO >> getAll (Pageable pageable ) {
247250 Page <OtisPlayer > entities = this .repository .findAll (pageable );
248251 if (entities .isEmpty ()) {
249- return HttpResponse .ok (List . of ());
252+ return HttpResponse .ok (Page . empty ());
250253 }
251254 return HttpResponse .ok (entities .map (OtisPlayer ::toDto ));
252255 }
You can’t perform that action at this time.
0 commit comments