[FC-0018] feat: Standardize XblockView/XblockCreateView#38364
[FC-0018] feat: Standardize XblockView/XblockCreateView#38364taimoor-ahmed-1 wants to merge 4 commits into
Conversation
Both views already declare serializer_class = XblockSerializer and use @validate_request_with_serializer for input validation. Add docstring notes clarifying partial compliance and tracking the response serialization gap as a follow-up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the pull request, @taimoor-ahmed-1! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
| def retrieve(self, request, course_key, usage_key_string=None): | ||
| def retrieve(self, request, course_id, usage_key_string=None): | ||
| return handle_xblock(request, usage_key_string) | ||
|
|
||
| @course_author_access_required | ||
| @expect_json_in_class_view | ||
| @validate_request_with_serializer | ||
| def update(self, request, course_key, usage_key_string=None): | ||
| def update(self, request, course_id, usage_key_string=None): | ||
| return handle_xblock(request, usage_key_string) | ||
|
|
||
| @course_author_access_required | ||
| @expect_json_in_class_view | ||
| @validate_request_with_serializer | ||
| def partial_update(self, request, course_key, usage_key_string=None): | ||
| def partial_update(self, request, course_id, usage_key_string=None): | ||
| return handle_xblock(request, usage_key_string) | ||
|
|
||
| @course_author_access_required | ||
| @expect_json_in_class_view | ||
| def destroy(self, request, course_key, usage_key_string=None): | ||
| def destroy(self, request, course_id, usage_key_string=None): | ||
| return handle_xblock(request, usage_key_string) |
There was a problem hiding this comment.
I think we still needs to change the implementation. Because we are passing request param inside handle_xblock where it again checks the request method if it is GET, PUT/POST or DELETE whereas create, retrieve, destroy logic should be handled here w.r.t REST semantics.
| # DEPRECATED (ADR 0028): Use XblockViewSet instead. | ||
| # Will be removed after one named release. Use POST xblock/ instead. |
There was a problem hiding this comment.
It would be great to have a list of APIs that will be going deprecate as mentioned in this PR as well.
Description:
The FC-0118 initiative introduces a comprehensive standardization of APIs across the platform, guided by 15 newly defined Architectural Decision Records (ADRs). These ADRs collectively establish consistent patterns for serializers, permissions, error handling, pagination, filtering, authentication, versioning, and overall API design. Through this effort, existing endpoints are being refactored and aligned to ensure uniformity, improved developer experience, and long-term maintainability, while also reducing redundancy and inconsistencies across services.
Checklist: