-
-
Notifications
You must be signed in to change notification settings - Fork 202
refactor(api)!: show uid
instead of parent_lookup
DEV-1049
#6323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(api)!: show uid
instead of parent_lookup
DEV-1049
#6323
Conversation
…v-1049-show-uid-instead-of-parent-lookup
There was a problem hiding this 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 = { |
There was a problem hiding this 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 onlyuid_invite
/api/v2/assets/{uid_asset}/data/{uid_data}/attachments/
. The documentation (inside the markdown) still refers toparent_lookup_data
.- /api/v2/assets/{uid_asset}/paired-data/{paired_data_uid}/ . For consistency, It would also change
paired_data_uid
touid_paired_data
/api/v2/organizations/{organization_id}/invites/
, some other endpoints for organizations are using{id}
. Let's useuid_organization
everywhere if we can.
…v-1049-show-uid-instead-of-parent-lookup
kpi/urls/router_api_v2.py
Outdated
# 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'], | ||
# ) |
There was a problem hiding this comment.
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 ;-)
There was a problem hiding this 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
)

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}/
…v-1049-show-uid-instead-of-parent-lookup
…e username in the organization members api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Congrats!
…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
📣 Summary
Update the drf-spectacular api documentation to use a consistent
uid_<object_name>
naming convention.👀 Preview steps
api/v2/docs
parent_lookup_
have been changed touid_
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}/