Skip to content

Conversation

RuthTurk
Copy link
Member

@RuthTurk RuthTurk commented Oct 2, 2025

📣 Summary

Update the drf-spectacular api documentation to use a consistent uid_<object_name> naming convention.

👀 Preview steps

  1. ℹ️ checkout api/v2/docs
  2. 🟢 [on PR] make sure that all parent_lookup_ have been changed to uid_ and that all nested uids are correct.
    Example:
    /api/v2/assets/{parent_lookup_asset}/hooks/{parent_lookup_hook}/logs/{uid}/
    Should be
    /api/v2/assets/{uid_asset}/hooks/{uid_hook}/logs/{uid_log}/
  3. Test the endpoints to make sure they are still working

@RuthTurk RuthTurk self-assigned this Oct 2, 2025
@RuthTurk RuthTurk added the API Changes related to API endpoints label Oct 2, 2025
Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

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

You may need to update the mapping in here

urls_pattern_mapping = {

Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

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

First of all, congrats to have tackling this. It was indeed more complex than expected.

I found few tiny mistakes though 😇

  • /api/v2/project-ownership/invites/{uid_invite_uid}/transfers/{uid_transfer}/
    uid_invite_uid should be only uid_invite
  • /api/v2/assets/{uid_asset}/data/{uid_data}/attachments/ . The documentation (inside the markdown) still refers to parent_lookup_data.
  • /api/v2/assets/{uid_asset}/paired-data/{paired_data_uid}/ . For consistency, It would also change paired_data_uid to uid_paired_data
  • /api/v2/organizations/{organization_id}/invites/, some other endpoints for organizations are using {id}. Let's use uid_organization everywhere if we can.

@RuthTurk RuthTurk requested a review from noliveleger October 6, 2025 13:32
Comment on lines 183 to 201
# organization_routes = router_api_v2.register(
# r'organizations',
# OrganizationViewSet,
# basename='organizations',
# )

# organization_routes.register(
# r'members',
# OrganizationMemberViewSet,
# basename='organization-members',
# parents_query_lookups=['organization'],
# )

# organization_routes.register(
# r'invites',
# OrgMembershipInviteViewSet,
# basename='organization-invites',
# parents_query_lookups=['organization'],
# )
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you can remove those lines ;-)

@RuthTurk RuthTurk requested a review from noliveleger October 6, 2025 17:31
Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

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

I found some issues:

All methods for endpoint:

  • /api/v2/assets/{uid_asset}/export-settings/{uid_export_setting}/

The doc still exposes uid (for uid_export_settings)

Image

Same case (all methods):

  • /api/v2/assets/{uid_asset}/exports/{uid_export}/
  • /api/v2/assets/{uid_asset}/hooks/{uid_hook}/
  • /api/v2/assets/{uid_asset}/permission-assignments/{uid_permission_assignment}/

As per our discussion,
please change /api/v2/organizations/{uid_organization}/members/{user__username}/ to /api/v2/organizations/{uid_organization}/members/{username}/


@RuthTurk RuthTurk requested a review from noliveleger October 7, 2025 15:16
Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

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

LGTM! Congrats!

@RuthTurk RuthTurk merged commit 58097b5 into release/2.025.37 Oct 7, 2025
13 checks passed
@RuthTurk RuthTurk deleted the dev-1049-show-uid-instead-of-parent-lookup branch October 7, 2025 16:05
RuthTurk added a commit that referenced this pull request Oct 9, 2025
…V-1144 (#6351)

### 📣 Summary
Fix `uid` value that was missed in #6323 resulting in form previews and
submission edits failures.

### 💭 Notes
Also fixed the asset snapshot documentation where GET and POST to
`/api/v2/asset_snapshots/` were requiring an `uid_asset_snapshot`
parameter.

### 👀 Preview steps
1. ℹ️ have an account and a project
2. Click the preview button 
3. 🔴 [on main] Server responds with 500 and shows error modal
4. 🟢 [on PR] Form preview works 
5. 🟢 [on PR] verify that submission edits succeed
6. Checkout the documentation: `api/v2/docs`
7. 🟢 verify that GET and POST to `/api/v2/asset_snapshots/` doesn't
require an `uid_asset_snapshot` parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes related to API endpoints

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants