Skip to content

Replace Postman collection with .rest file#494

Merged
nanotaboada merged 2 commits intomasterfrom
chore/rest-client
Feb 21, 2026
Merged

Replace Postman collection with .rest file#494
nanotaboada merged 2 commits intomasterfrom
chore/rest-client

Conversation

@nanotaboada
Copy link
Owner

@nanotaboada nanotaboada commented Feb 20, 2026

  • Add rest/players.rest covering all CRUD operations for VS Code REST Client
  • Add humao.rest-client to .vscode/extensions.json recommendations
  • Add HTTP Requests section to README.md
  • Update .vscode/settings.json, pyproject.toml, codecov.yml to reference rest/ instead of postman_collections/
  • Remove postman_collections/ directory

Closes #493


This change is Reviewable

Summary by CodeRabbit

  • New Features

    • Added a REST API spec for testing with a liveness check and full CRUD for Player resources (lookup by squad number and server-generated IDs).
    • Replaced a legacy test collection with new REST definitions.
    • Editor recommendation added for the REST Client extension.
  • Bug Fixes

    • POST/PUT/DELETE now surface HTTP 500 on database failures.
  • Documentation

    • Added an "HTTP Requests" section explaining how to run and test the API with a REST client.

@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Adds a plain-text rest/players.rest replacing the Postman collection, adds humao.rest-client to VS Code recommendations, and updates Black/flake8/Codecov exclusion patterns and README/CHANGELOG to reference the new HTTP requests workflow.

Changes

Cohort / File(s) Summary
VS Code config
.vscode/extensions.json, .vscode/settings.json
Added humao.rest-client to workspace recommendations; updated flake8 ignore from **/postman_collections/** to **/rest/**.
Tooling excludes
codecov.yml, pyproject.toml
Replaced ignore/exclude patterns referencing postman_collections/ with rest/; minor comment/indentation tweak in codecov.yml.
REST requests file
rest/players.rest
New HTTP file with GET /health and full Player CRUD (POST, GET all, GET by UUID, GET by squad number, PUT, two-step DELETE) plus example payloads and notes about natural vs surrogate keys.
Docs & changelog
README.md, CHANGELOG.md
Added "HTTP Requests" docs referencing rest/players.rest; recorded removal of Postman collection and VS Code REST Client recommendation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title uses a non-standard [FEATURE] prefix instead of Conventional Commits format (feat:), and exceeds the recommended 80-character limit requirement. Change the title to use Conventional Commits format, e.g., 'feat: replace Postman collection with .rest file' to comply with the specified requirements.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements all acceptance criteria from #493: removes postman_collections/, adds rest/players.rest with full CRUD operations, updates configuration files, adds REST Client extension recommendation, and updates documentation.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #493 objectives; no out-of-scope modifications detected. Changes are limited to replacing Postman collection with REST file and updating related configs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/rest-client

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.

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: 2

🧹 Nitpick comments (1)
rest/players.rest (1)

102-104: The {player_id} placeholder won't be resolved by REST Client.

{player_id} uses single braces while REST Client variables require double braces ({{...}}). The comment on line 103 explains the manual substitution, which is fine, but consider using REST Client's @name directive and response body references to automate the two-step delete flow. This would make the file fully executable without manual edits.

Example using REST Client response variables
 ### Step 1 — Look up Almada's UUID by squad number
+# `@name` lookupAlmada
 GET {{baseUrl}}/players/squadnumber/16
 Accept: application/json
 
 ### Step 2 — Delete Almada using the UUID returned above
-# Replace {player_id} with the id field from the response above.
-DELETE {{baseUrl}}/players/{player_id}
+DELETE {{baseUrl}}/players/{{lookupAlmada.response.body.id}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rest/players.rest` around lines 102 - 104, The DELETE request uses a
single-brace placeholder "{player_id}" which REST Client won't resolve; replace
it with REST Client variables and wiring (e.g., use the response naming
directive from the earlier POST/GET and reference the id via the response body)
so the DELETE line references the created player's id using REST Client syntax
(double-brace or response variable like the named-response body reference)
rather than a manual substitution; update the DELETE request line and add/ensure
the prior request has an `@name` and returns the id in its body for reference.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.vscode/extensions.json:
- Line 11: Revert the unrelated change that commented out the SonarLint
recommendation: restore the removed recommendation entry
"sonarsource.sonarlint-vscode" in the .vscode/extensions.json (undo the
commented line) so the PR only covers the Postman→REST Client change, or if
disabling SonarLint is intentional, move that edit into its own commit/PR with
an explanatory justification referencing the "sonarsource.sonarlint-vscode"
entry.

In `@rest/players.rest`:
- Around line 79-90: The PUT request JSON in the players REST test still sets
"middleName" to an empty string which will overwrite the corrected seed value;
update the request body so the middleName field is null (not ""), matching
seed_001_starting_eleven.py and the CHANGELOG fix; ensure any code constructing
this payload (the PUT request in this REST test) serializes middleName as JSON
null rather than an empty string.

---

Nitpick comments:
In `@rest/players.rest`:
- Around line 102-104: The DELETE request uses a single-brace placeholder
"{player_id}" which REST Client won't resolve; replace it with REST Client
variables and wiring (e.g., use the response naming directive from the earlier
POST/GET and reference the id via the response body) so the DELETE line
references the created player's id using REST Client syntax (double-brace or
response variable like the named-response body reference) rather than a manual
substitution; update the DELETE request line and add/ensure the prior request
has an `@name` and returns the id in its body for reference.

- Add rest/players.rest covering all CRUD operations for VS Code REST Client
- Add humao.rest-client to .vscode/extensions.json recommendations
- Add HTTP Requests section to README.md
- Remove postman_collections/ directory

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4242cbb) to head (38815cf).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #494   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          110       110           
=========================================
  Hits           110       110           
Components Coverage Δ
Services 100.00% <ø> (ø)
Routes 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Around line 47-48: The CHANGELOG.md entries for the new items
("rest/players.rest" and "humao.rest-client" recommendation and the entry on
line 74) are missing the issue reference; update those three lines to append the
bracketed issue reference " (`#493`)" so they match the established "[Unreleased]"
style (e.g., change "`rest/players.rest` file covering all CRUD operations,
compatible with the VS Code REST Client extension" to include " (`#493`)" and do
the same for "`humao.rest-client` added to `.vscode/extensions.json`
recommendations" and the entry at line 74).

@nanotaboada nanotaboada changed the title chore(api): replace Postman collection with REST Client file (#493) chore(api): replace Postman collection with REST Client file Feb 21, 2026
@nanotaboada nanotaboada changed the title chore(api): replace Postman collection with REST Client file [FEATURE] Replace Postman collection with .rest file Feb 21, 2026
nanotaboada added a commit that referenced this pull request Feb 21, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…493)

- Correct middleName from empty string to null in PUT request
- Add issue reference to REST client CHANGELOG entries

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

@nanotaboada nanotaboada merged commit c7147b8 into master Feb 21, 2026
14 checks passed
@nanotaboada nanotaboada deleted the chore/rest-client branch February 21, 2026 13:29
@nanotaboada nanotaboada changed the title [FEATURE] Replace Postman collection with .rest file Replace Postman collection with .rest file Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Replace Postman collection with .rest file

1 participant