From 74f8a8813c7e9ba3d35b7092f49061099ea8a335 Mon Sep 17 00:00:00 2001 From: Sin-Kang Date: Wed, 3 Jun 2026 19:26:00 +0900 Subject: [PATCH] fix(admin): serialize audit-log search via PagedModel (0.4.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GET /admin/api/v1/audit-logs returned a raw PageImpl, which Spring Data 4 warns is not a stable serialization ("Serializing PageImpl instances as-is is not supported"). Wrap it in PagedModel for a stable { content, page: { size, number, totalElements, totalPages } } contract. Contained to this endpoint — no global @EnableSpringDataWebSupport, so a consumer's own pagination is unaffected. The admin-ui already consumes this shape (content + page). Docs/CHANGELOG + install coordinates bumped to 0.4.1. Full suite green: 54 tests, 0 failures/0 errors. --- CHANGELOG.ko.md | 9 +++++++++ CHANGELOG.md | 9 +++++++++ README.ko.md | 4 ++-- README.md | 4 ++-- .../kit/admin/audit/AuditLogAdminController.java | 7 ++++--- docs/getting-started/installation.ko.md | 12 ++++++------ docs/getting-started/installation.md | 12 ++++++------ docs/reference/configuration.ko.md | 4 ++-- docs/reference/configuration.md | 4 ++-- 9 files changed, 42 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.ko.md b/CHANGELOG.ko.md index 5999217..c3bc66e 100644 --- a/CHANGELOG.ko.md +++ b/CHANGELOG.ko.md @@ -11,6 +11,15 @@ English: [CHANGELOG.md](CHANGELOG.md) ## [Unreleased] +## [0.4.1] — 2026-06-03 + +### Fixed +- **감사 로그 검색이 안정적인 페이지 구조를 반환.** `GET /admin/api/v1/audit-logs` 가 raw + `PageImpl` 대신 Spring Data `PagedModel`(`{ content, page: { size, number, totalElements, + totalPages } }`)로 직렬화됩니다. "Serializing PageImpl instances as-is is not supported" 경고가 + 사라지고 JSON 계약이 안정화됩니다. kit 자체 엔드포인트에만 적용(전역 `@EnableSpringDataWebSupport` + 없음)이라 소비자 앱의 자체 페이징엔 영향이 없습니다. + ## [0.4.0] — 2026-06-03 ### Added diff --git a/CHANGELOG.md b/CHANGELOG.md index 9458522..117432b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,15 @@ The library major aligns with the Spring Boot major: `4.x.y` targets Spring Boot ## [Unreleased] +## [0.4.1] — 2026-06-03 + +### Fixed +- **Audit log search returns a stable paged structure.** `GET /admin/api/v1/audit-logs` now + serializes via Spring Data's `PagedModel` (`{ content, page: { size, number, totalElements, + totalPages } }`) instead of a raw `PageImpl`, removing the "Serializing PageImpl instances + as-is is not supported" warning and giving a stable JSON contract. Contained to the kit's own + endpoint — no global `@EnableSpringDataWebSupport`, so a consumer's own pagination is unaffected. + ## [0.4.0] — 2026-06-03 ### Added diff --git a/README.ko.md b/README.ko.md index cff6762..7df6d45 100644 --- a/README.ko.md +++ b/README.ko.md @@ -63,7 +63,7 @@ **Gradle (Kotlin DSL)** ```kotlin -implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") +implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.1") ``` **Maven** @@ -72,7 +72,7 @@ implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") kr.devslab devslab-kit-spring-boot-starter - 0.4.0 + 0.4.1 ``` diff --git a/README.md b/README.md index 296ece0..aa0c237 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ specific product's domain. **Gradle (Kotlin DSL)** ```kotlin -implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") +implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.1") ``` **Maven** @@ -74,7 +74,7 @@ implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") kr.devslab devslab-kit-spring-boot-starter - 0.4.0 + 0.4.1 ``` diff --git a/devslab-kit-admin-api/src/main/java/kr/devslab/kit/admin/audit/AuditLogAdminController.java b/devslab-kit-admin-api/src/main/java/kr/devslab/kit/admin/audit/AuditLogAdminController.java index 96b2058..ea78c6a 100644 --- a/devslab-kit-admin-api/src/main/java/kr/devslab/kit/admin/audit/AuditLogAdminController.java +++ b/devslab-kit-admin-api/src/main/java/kr/devslab/kit/admin/audit/AuditLogAdminController.java @@ -7,10 +7,10 @@ import kr.devslab.kit.admin.AdminApiPaths; import kr.devslab.kit.audit.core.service.AuditLogQueryService; import kr.devslab.kit.audit.core.service.AuditLogQueryService.AuditLogSearchCriteria; -import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; +import org.springframework.data.web.PagedModel; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -38,7 +38,7 @@ public AuditLogAdminController(AuditLogQueryService service, ObjectMapper object * by {@code occurredAt DESC}. {@code page} is 0-based. */ @GetMapping - public Page search( + public PagedModel search( @RequestParam(required = false) String tenantId, @RequestParam(required = false) String actorLogin, @RequestParam(required = false) String action, @@ -55,7 +55,8 @@ public Page search( Math.max(0, page), Math.clamp(size == 0 ? DEFAULT_PAGE_SIZE : size, 1, MAX_PAGE_SIZE), Sort.by(Sort.Direction.DESC, "occurredAt")); - return service.search(criteria, pageable).map(entity -> AuditLogResponse.from(entity, objectMapper)); + return new PagedModel<>( + service.search(criteria, pageable).map(entity -> AuditLogResponse.from(entity, objectMapper))); } /** diff --git a/docs/getting-started/installation.ko.md b/docs/getting-started/installation.ko.md index 34269c2..6d818aa 100644 --- a/docs/getting-started/installation.ko.md +++ b/docs/getting-started/installation.ko.md @@ -17,13 +17,13 @@ === "Gradle (Kotlin DSL)" ```kotlin - implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") + implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.1") ``` === "Gradle (Groovy)" ```groovy - implementation 'kr.devslab:devslab-kit-spring-boot-starter:0.4.0' + implementation 'kr.devslab:devslab-kit-spring-boot-starter:0.4.1' ``` === "Maven" @@ -32,7 +32,7 @@ kr.devslab devslab-kit-spring-boot-starter - 0.4.0 + 0.4.1 ``` @@ -43,10 +43,10 @@ 물러납니다(`@ConditionalOnMissingBean`). ```kotlin -implementation("kr.devslab:devslab-kit-access-core:0.4.0") // RBAC + 그룹 + ABAC -implementation("kr.devslab:devslab-kit-cache-core:0.4.0") // 플러그형 캐시 +implementation("kr.devslab:devslab-kit-access-core:0.4.1") // RBAC + 그룹 + ABAC +implementation("kr.devslab:devslab-kit-cache-core:0.4.1") // 플러그형 캐시 // …또는 계약만: -implementation("kr.devslab:devslab-kit-access-api:0.4.0") +implementation("kr.devslab:devslab-kit-access-api:0.4.1") ``` 동작하는 앱을 부팅하려면 [빠른 시작](quick-start.md)을 참고하세요. diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 8349a4c..634eb52 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -17,13 +17,13 @@ whole platform; depend on individual modules only if you want à la carte. === "Gradle (Kotlin DSL)" ```kotlin - implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") + implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.1") ``` === "Gradle (Groovy)" ```groovy - implementation 'kr.devslab:devslab-kit-spring-boot-starter:0.4.0' + implementation 'kr.devslab:devslab-kit-spring-boot-starter:0.4.1' ``` === "Maven" @@ -32,7 +32,7 @@ whole platform; depend on individual modules only if you want à la carte. kr.devslab devslab-kit-spring-boot-starter - 0.4.0 + 0.4.1 ``` @@ -44,10 +44,10 @@ your own — the auto-configuration backs off (`@ConditionalOnMissingBean`) when do. ```kotlin -implementation("kr.devslab:devslab-kit-access-core:0.4.0") // RBAC + groups + ABAC -implementation("kr.devslab:devslab-kit-cache-core:0.4.0") // pluggable cache +implementation("kr.devslab:devslab-kit-access-core:0.4.1") // RBAC + groups + ABAC +implementation("kr.devslab:devslab-kit-cache-core:0.4.1") // pluggable cache // …or just the contract: -implementation("kr.devslab:devslab-kit-access-api:0.4.0") +implementation("kr.devslab:devslab-kit-access-api:0.4.1") ``` See [Quick Start](quick-start.md) to boot a working app. diff --git a/docs/reference/configuration.ko.md b/docs/reference/configuration.ko.md index 83f533e..7b91d6f 100644 --- a/docs/reference/configuration.ko.md +++ b/docs/reference/configuration.ko.md @@ -121,7 +121,7 @@ === "Gradle (Kotlin DSL)" ```kotlin - implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") { + implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.1") { exclude(group = "org.springdoc") } ``` @@ -132,7 +132,7 @@ kr.devslab devslab-kit-spring-boot-starter - 0.4.0 + 0.4.1 org.springdoc diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 3abbbae..8056cc7 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -128,7 +128,7 @@ Two ways to turn it off: === "Gradle (Kotlin DSL)" ```kotlin - implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.0") { + implementation("kr.devslab:devslab-kit-spring-boot-starter:0.4.1") { exclude(group = "org.springdoc") } ``` @@ -139,7 +139,7 @@ Two ways to turn it off: kr.devslab devslab-kit-spring-boot-starter - 0.4.0 + 0.4.1 org.springdoc