Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Conversation

@narthur
Copy link
Collaborator

@narthur narthur commented Sep 7, 2025

Summary by CodeRabbit

  • Documentation
    • Updated API warning to “in active development.”
    • Enhanced GET /api2/me/tasks docs: added query parameters (page, status, due_before, due_after), detailed response fields, and an example request/response showing pagination and auth.
    • Improved POST /api2/me/tasks docs: fixed header formatting and expanded request body to include optional recurrence with required recurrence.days when recurrence is provided.
    • Corrected POST /api2/me/token wording about authentication/token reset.

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Documentation in src/api-v2.md updated: revised warning phrasing; expanded GET /api2/me/tasks with query params, response format, and example request/response; corrected POST /api2/me/tasks header formatting and extended request body to include optional recurrence object with required recurrence.days when present; typo fixed in token route instructions.

Changes

Cohort / File(s) Summary of changes
API v2 Docs updates
src/api-v2.md
Updated warning phrasing; added GET /api2/me/tasks query parameters (page, status, due_before, due_after) and documented response fields (id, task, due, cents, complete, status) with example request/response; fixed POST /api2/me/tasks header formatting; expanded POST body schema to include optional recurrence object with required recurrence.days when present; corrected spelling in /api2/me/token instructions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • document token routes #12 — Modifies src/api-v2.md with overlapping changes to GET /api2/me/tasks (pagination/response fields) and POST /api2/me/tasks recurrence schema.

Poem

A rabbit reads docs by lantern light,
Tweaks the headers, sets the params right.
Pages hop, due dates in a line,
Recurrence ticks in tidy time.
I nibble errors, then thump: "All fine!" 🐇✨


📜 Recent review details

Configuration used: Repository: TaskRatchet/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2f613 and 05b667a.

📒 Files selected for processing (1)
  • src/api-v2.md (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/api-v2.md
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch api-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Sep 7, 2025

User-Visible Improvements

This PR contains 4 user-visible improvements:

  1. Added a response format section to the API documentation, detailing the fields in the response for a task query. (Users now have a clearer understanding of the response format when querying tasks.)
  2. Added query parameters to the API documentation for filtering tasks by page number, status, and due date. (Users can now more easily filter and navigate tasks.)
  3. Fixed a typo in the API documentation, changing 'authenticted' to 'authenticated'. (This change improves the readability and professionalism of the documentation.)
  4. Updated the warning message about the API being unstable to simply being in active development. (This change may reduce user concerns about the stability of the API.)

Last updated: 2025-09-07T14:34:25.507Z

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the API v2 documentation by adding query parameters documentation for the GET /api2/me/tasks endpoint and fixing a formatting issue in the POST endpoint description.

  • Added comprehensive query parameters table for task filtering and pagination
  • Fixed trailing backslash in POST endpoint description

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/api-v2.md (2)

151-151: Fix typo: “authenticted” → “authenticated”.

User-facing docs; please correct.

-You'll need to be authenticted in order to reset your token. If you don't already have a token, contact support for help.
+You'll need to be authenticated in order to reset your token. If you don't already have a token, contact support for help.

122-131: Make recurrence.days conditionally required and integer-typed

-| recurrence.days | number  | true        | Number of days between recurrences    |
+| recurrence.days | integer | conditional | Number of days between recurrences (required if `recurrence` is provided) |
 
Note: `recurrence.days` must be an integer ≥ 1 when `recurrence` is present.
♻️ Duplicate comments (1)
src/api-v2.md (1)

80-86: Clarify pagination indexing, page size, status enum, and timestamp semantics.

  • Past nit: default page 0 vs 1. If 0-based is intentional, say so; otherwise switch to 1-based default 1. Also document page_size/limit and max. Define status enum/case and timestamp units/boundaries.
-| page       | number | false    | Page number (default: 0)                               |
-| status     | string | false    | Filter by task status (pending, complete, expired)     |
-| due_before | number | false    | Unix timestamp; only return tasks due before this time |
-| due_after  | number | false    | Unix timestamp; only return tasks due after this time  |
+| page       | number | false    | 0-based page number (default: 0). Consider 1-based for UX consistency. |
+| page_size  | number | false    | Number of tasks per page (default: 50, max: 200).                     |
+| status     | string | false    | One of: pending | complete | expired (case-insensitive).              |
+| due_before | number | false    | Unix timestamp in seconds (UTC); returns tasks due at or before this time. |
+| due_after  | number | false    | Unix timestamp in seconds (UTC); returns tasks due at or after this time.  |

Note: If both due_after and due_before are provided, clarify whether due_after <= due_before is required and the error returned otherwise.

🧹 Nitpick comments (3)
src/api-v2.md (3)

4-7: Tighten the warning block; add versioning/deprecation guidance.

Consider adding a brief note on versioning/deprecation policy (e.g., how breaking changes are announced) to set expectations.

 ::: warning
-This version of the API is in active development. The
-API and its associated documentation are likely to be incomplete and/or incorrect,
-and may change without notice.
+This version of the API is in active development. The API and its documentation may change without notice.
+Breaking changes: Announced via release notes and the changelog; no stability guarantees until v2 is marked stable.
 :::

87-97: Document pagination metadata; array-only responses leave clients guessing.

If the endpoint is paginated, expose navigation info (Link header or envelope with total/page/page_size). At minimum, document headers if already implemented.

 Response format:
 
 | Response Field | Type    | Description                                    |
 ...
 | status         | string  | The task's status (pending, complete, expired) |
+
+Pagination:
+
+- If using HTTP Link headers, document rel="next" and rel="prev" examples.
+- If using a response envelope, prefer:
+
+```json
+{
+  "data": [ /* tasks */ ],
+  "pagination": { "page": 0, "page_size": 50, "total": 1234, "total_pages": 25 }
+}
+```

124-129: Tighten numeric types and constraints.

due and cents should be integers if they represent seconds and whole cents. Document minimums (e.g., cents ≥ 0) and any future-time requirement for due.

-| due             | number | true     | Unix timestamp of the task's due date |
-| cents           | number | true     | The task's stakes in cents            |
+| due             | integer| true     | Unix timestamp (seconds, UTC) of the task's due date |
+| cents           | integer| true     | The task's stakes in cents (≥ 0)      |
📜 Review details

Configuration used: Repository: TaskRatchet/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff31870 and 7f2f613.

📒 Files selected for processing (1)
  • src/api-v2.md (3 hunks)

@narthur
Copy link
Collaborator Author

narthur commented Sep 7, 2025

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/api-v2.md (1)

151-151: Fix typo: “authenticted” → “authenticated”.
User-facing typo in security-sensitive section.

Apply:

-You'll need to be authenticted in order to reset your token. If you don't already have a token, contact support for help.
+You'll need to be authenticated in order to reset your token. If you don't already have a token, contact support for help.
♻️ Duplicate comments (1)
src/api-v2.md (1)

78-86: Tighten param specs; clarify paging default and time units.

  • Use integer types for page and timestamps; specify epoch units/timezone.
  • Document whether due_before/after are inclusive/exclusive.
  • For status, explicitly list allowed values and note case sensitivity.
  • Re: default page=0 vs 1, align with product convention or clarify 0-based indexing.

Proposed edits:

-| page       | number | false    | Page number (default: 0)                               |
-| status     | string | false    | Filter by task status (pending, complete, expired)     |
-| due_before | number | false    | Unix timestamp; only return tasks due before this time |
-| due_after  | number | false    | Unix timestamp; only return tasks due after this time  |
+| page       | integer | false   | Page number (0-based; default: 0)                      |
+| status     | string  | false   | One of: pending, complete, expired (case-sensitive)    |
+| due_before | integer | false   | Unix timestamp (seconds, UTC); tasks due before this time |
+| due_after  | integer | false   | Unix timestamp (seconds, UTC); tasks due after this time  |

If you prefer 1-based pages, change the description to “1-based; default: 1” and update examples accordingly.

🧹 Nitpick comments (2)
src/api-v2.md (2)

87-88: Document pagination mechanics in the response.
State page size, max page size, and how to fetch the next page (e.g., page param, Link headers, or cursors).


122-131: Clarify conditional requirement and integer types for POST body.

  • Make recurrence.days “Required if recurrence is provided.”
  • Use integer and specify epoch units/timezone.
  • Consider minimum constraints (e.g., recurrence.days >= 1).

Proposed edits:

-| Field           | Type   | Required | Description                           |
+| Field           | Type    | Required | Description                           |
 ...
-| due             | number | true     | Unix timestamp of the task's due date |
+| due             | integer | true     | Unix timestamp (seconds, UTC) of the task's due date |
 ...
-| recurrence      | object | false    | The task's recurrence settings        |
-| recurrence.days | number | true     | Number of days between recurrences    |
+| recurrence      | object  | false    | The task's recurrence settings        |
+| recurrence.days | integer | conditional | Number of days between recurrences; required if recurrence is provided (min: 1) |
📜 Review details

Configuration used: Repository: TaskRatchet/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff31870 and 7f2f613.

📒 Files selected for processing (1)
  • src/api-v2.md (3 hunks)
🔇 Additional comments (1)
src/api-v2.md (1)

4-4: Concise warning text LGTM.
Wording is clearer while preserving the caution.

@narthur narthur temporarily deployed to api-docs - docs.tr.com PR #14 September 7, 2025 14:34 — with Render Destroyed
@narthur
Copy link
Collaborator Author

narthur commented Sep 7, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@narthur narthur merged commit f8a187d into master Sep 7, 2025
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants