Skip to content

Commit a134ea8

Browse files
CopilotTuntii
andcommitted
fix: address review comments - validate pagination size and update docs status
Co-authored-by: Tuntii <121901995+Tuntii@users.noreply.github.com>
1 parent 8d74640 commit a134ea8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/.agent/docs_coverage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
| State | `concepts/handlers.md` | `rustapi-core/src/extract.rs` | OK |
99
| Validation | `crates/rustapi_validate.md` | `rustapi-validate` | OK |
1010
| **HATEOAS** | | | |
11-
| Pagination | `recipes/pagination.md` (Planned) | `rustapi-core/src/hateoas.rs` | **Missing** |
12-
| Links | `recipes/pagination.md` (Planned) | `rustapi-core/src/hateoas.rs` | **Missing** |
11+
| Pagination | `recipes/pagination.md` | `rustapi-core/src/hateoas.rs` | OK |
12+
| Links | `recipes/pagination.md` | `rustapi-core/src/hateoas.rs` | OK |
1313
| **Extras** | | | |
1414
| Auth (JWT) | `recipes/jwt_auth.md` | `rustapi-extras/src/jwt` | OK |
1515
| Security | `recipes/csrf_protection.md` | `rustapi-extras/src/security` | OK |
1616
| Observability | `crates/rustapi_extras.md` | `rustapi-extras/src/telemetry` | OK |
1717
| **Jobs** | | | |
1818
| Job Queue | `crates/rustapi_jobs.md` | `rustapi-jobs` | OK |
1919
| **Learning** | | | |
20-
| Structured Path | `learning/curriculum.md` (Planned) | N/A | **Missing** |
20+
| Structured Path | `learning/curriculum.md` | N/A | OK |

docs/.agent/run_report_2025-02-19.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- Includes prerequisites, tasks, and pitfalls for each module.
2424

2525
## ✅ Verification
26-
- Created temporary test `crates/rustapi-rs/tests/doc_check_pagination.rs` to verify the new recipe code compiles.
26+
- Locally created a temporary test in `crates/rustapi-rs/tests/` to verify the new recipe code compiles (not committed to the repo).
2727
- Verified that `rustapi-core` compiles with the new Schema implementations.
2828

2929
## 📝 TODOs for Next Run

docs/cookbook/src/recipes/pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct Pagination {
3636
#[rustapi_rs::get("/users")]
3737
async fn list_users(Query(params): Query<Pagination>) -> Json<ResourceCollection<User>> {
3838
let page = params.page.unwrap_or(0);
39-
let size = params.size.unwrap_or(20);
39+
let size = params.size.unwrap_or(20).max(1); // Ensure size is at least 1 to prevent division by zero
4040

4141
// In a real app, you would fetch this from a database
4242
// let (users, total_elements) = db.fetch_users(page, size).await?;

0 commit comments

Comments
 (0)