Skip to content

Task 1: Unify endpoint URL handling#20

Merged
godely merged 1 commit intomainfrom
task-1-unify-url-handling
Jun 8, 2025
Merged

Task 1: Unify endpoint URL handling#20
godely merged 1 commit intomainfrom
task-1-unify-url-handling

Conversation

@godely
Copy link
Copy Markdown
Owner

@godely godely commented Jun 8, 2025

Summary

  • Fixes issue Task 1: Unify endpoint URL handling #8: Remove duplicate /v2 prefixes in endpoint definitions
  • Consolidates URL construction in OuraClient._make_request
  • Updates all endpoint modules to use relative paths

Changes

  1. Updated OuraClient._make_request to handle URL construction centrally:

    • Added logic to ensure endpoints start with /
    • Added logic to remove duplicate /v2 prefixes if present
    • Ensures backward compatibility while fixing the issue
  2. Removed /v2 prefixes from all endpoint modules:

    • Updated 17 endpoint files to use relative paths (e.g., /usercollection/... instead of /v2/usercollection/...)
    • Maintained consistency across all endpoints
  3. Updated all tests to reflect the URL changes:

    • Modified test expectations to match the new URL construction
    • All 101 tests are now passing

Test plan

  • Run existing test suite: python -m pytest tests/test_client.py
  • Verify all 101 tests pass
  • Manual testing with actual API calls to ensure URLs resolve correctly

Closes #8

🤖 Generated with Claude Code

- Refactor OuraClient._make_request to handle URL construction centrally
- Add logic to ensure endpoints start with / and remove duplicate /v2 prefixes
- Update all endpoint modules to use relative paths without /v2 prefix
- Update all tests to match new URL construction pattern
- All 101 tests passing

This fixes issue #8 where URLs were constructed as:
https://api.ouraring.com/v2/v2/usercollection/...

Now they correctly resolve to:
https://api.ouraring.com/v2/usercollection/...

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@godely godely merged commit 5e646c7 into main Jun 8, 2025
1 check passed
@godely godely deleted the task-1-unify-url-handling branch June 21, 2025 11:37
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.

Task 1: Unify endpoint URL handling

1 participant