Commit 83eaa4a
authored
Feature/add expands fields relations to get user by id v2 (#148)
* feat: add fields/relations passthrough to GET /api/v1|v2/users/{id}
Wires SerializerUtils::getExpand()/getFields()/getRelations() into both
by-ID user endpoints (matching the ParametrizedGetAll pattern already
used by list endpoints), and makes PrivateUserSerializer treat `groups`
as a gated relation (mirroring ApiScopeGroupSerializer) instead of
appending it unconditionally.
Unblocks ftn-docsnsklz PR #76 (SDS ftn-attendee-native-realtime-comms.md,
D38): attendee-networking-api's IDP user_updated consumer needs to fetch
exactly fields=public_profile_allow_chat_with_me,first_name,last_name,pic
without pulling the rest of the private profile.
v1 get() also migrated from manual try/catch to the shared
processRequest() wrapper for consistent error handling with getV2().
Also fixes an unrelated pre-existing bug in UserLoginTurnstileTest where
$testEmail/$testPassword being typed as non-nullable string caused a
TypeError before the test's own markTestSkipped() logic could run when
TEST_USER_EMAIL/TEST_USER_PASSWORD are unset.
9 new tests added to OAuth2UserApiTest; full suite green (180 tests,
0 failures, 7 legitimate skips).
* docs(plan): mark spec as VERIFIED
* chore: untrack plan file — plan docs are working artifacts, not committed
* fix: document v1 expand param and add v1 default-shape regression test
Address deep-review findings on PR #148:
- OA\Get annotation for GET /api/v1/users/{id} was missing the `expand`
parameter even though get() already passed SerializerUtils::getExpand()
into serialize() -- the capability was live but undocumented.
- v1 lacked a default-shape regression test symmetric with
testGetUserByIdV2WithNoParamsReturnsSameShapeAsBefore, so the
fields/relations passthrough's backward compatibility on v1 was only
exercised incidentally.1 parent 24c00ca commit 83eaa4a
4 files changed
Lines changed: 346 additions & 21 deletions
File tree
- app
- Http/Controllers/Api/OAuth2
- ModelSerializers/Auth
- tests
Lines changed: 48 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
640 | 641 | | |
641 | 642 | | |
642 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
643 | 665 | | |
644 | 666 | | |
645 | 667 | | |
| |||
663 | 685 | | |
664 | 686 | | |
665 | 687 | | |
666 | | - | |
| 688 | + | |
667 | 689 | | |
668 | 690 | | |
669 | 691 | | |
670 | 692 | | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
682 | 701 | | |
683 | 702 | | |
684 | 703 | | |
| |||
716 | 735 | | |
717 | 736 | | |
718 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
719 | 752 | | |
720 | 753 | | |
721 | 754 | | |
| |||
747 | 780 | | |
748 | 781 | | |
749 | 782 | | |
750 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
751 | 786 | | |
752 | 787 | | |
753 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
106 | 113 | | |
107 | | - | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
0 commit comments