Skip to content

Commit

Permalink
Display Pageable in Swagger for GetAllArticles operation properly
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-punko committed Jan 19, 2024
1 parent 0605df8 commit d73cb42
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import java.util.List;
import javax.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.SortDefault;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -125,10 +125,10 @@ public void deleteArticle(
defaultValue = "title,ASC")
})
public Slice<ArticleDto> readArticlesPaged(
@PageableDefault(page = 0, size = 50)
@SortDefault.SortDefaults({
@SortDefault(sort = "title", direction = Sort.Direction.ASC)
}) Pageable pageable
@ParameterObject
@PageableDefault(size = 50)
@SortDefault(sort = "title")
Pageable pageable
) {
return articleService.getAll(pageable);
}
Expand Down

0 comments on commit d73cb42

Please sign in to comment.