-
Notifications
You must be signed in to change notification settings - Fork 7
MSA-15087: 🚑 Get profile by ref #172
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
Conversation
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.
Pull request overview
This PR refactors the profile existence check from a POST-based API call to a GET-based one, updating both the implementation and its corresponding test. The change aligns with RESTful principles where GET requests should be used for read-only operations.
Key changes:
- Changed the
exist()method inProfileclass from using POST (_call_post()) to GET (_call_get()) - Updated the API endpoint from
/profile/v1/exist/{reference}to/profile/ref?extRef={reference} - Modified the return logic to check HTTP status code (200) instead of parsing JSON response
- Added type hints to
MSA_APIclass attributes and methods for better type safety - Added null-safety check in
check_response()method to prevent potential AttributeError
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/test_profie.py | Updated test to mock _call_get instead of _call_post and verify the new API endpoint format |
| msa_sdk/profile.py | Refactored exist() method to use GET request and check status code instead of parsing JSON response |
| msa_sdk/msa_api.py | Added type annotations for better type safety and added null-check in check_response() to handle None responses |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
013b4bc to
9da2bf5
Compare
No description provided.