Skip to content

Bugfix: seperated mixed up V1/V2 endpoints#890

Open
calumbell wants to merge 2 commits intoopen5e:stagingfrom
calumbell:888/split-v1-v2-endpoints
Open

Bugfix: seperated mixed up V1/V2 endpoints#890
calumbell wants to merge 2 commits intoopen5e:stagingfrom
calumbell:888/split-v1-v2-endpoints

Conversation

@calumbell
Copy link
Contributor

@calumbell calumbell commented Mar 7, 2026

Description

This PR fixes a bug on the API where the / and /v1 endpoints were displaying a mix of V1 and V2 Views:

Before (staging branch on the beta API site, note the mix of v1 and v2 endpoints):

Screenshot 2026-03-07 at 14 18 49

After (this branch):

Screenshot 2026-03-07 at 14 17 15

The bug was being caused by DRF getting confused over V1 and V2 having the same name during URL compliation. The issue was addressed by authoring an explicit API root for API V1 so that V1 and V2 endpoints can be easily seperated.

These changes were made in the api/urls.py file, the remaining changes were updates to the V1 tests so that they would work correctly with the new canonical V1 endpoints now living behind the /v1/ subroute.

Related Issue

Closes #888

How was this tested?

  • Spot checked on local Django development server
  • pytest (all tests passing, eventually!)

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.

[BUG] API V2 endpoints listed behind /v1 subroute

1 participant