-
Notifications
You must be signed in to change notification settings - Fork 0
Added nested global fields support #95
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 adds support for nested global fields by allowing an api_version
option to be passed through stack/global_fields methods and updating tests and documentation accordingly. Key changes include:
- Introduced
options
parameter toglobal_fields
andGlobalFields
to setapi_version
header per request. - Updated unit and integration tests to cover nested global fields create, update, delete, and fetch operations.
- Bumped SDK version to 1.5.0, updated changelog, and adjusted
.talismanrc
ignores.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/unit/global_fields/test_global_fields_unittest.py | Added nested global_fields unit tests |
tests/api/global_fields/test_global_fields_api.py | Added nested global_fields API tests and placeholder UID |
contentstack_management/stack/stack.py | Updated global_fields signature to accept options |
contentstack_management/global_fields/global_fields.py | Added header logic and cleanup for api_version in CRUD |
contentstack_management/init.py | Bumped version to 1.5.0 |
CHANGELOG.md | Documented v1.5.0 release note |
.talismanrc | Added new test files to ignore list |
Comments suppressed due to low confidence (3)
tests/unit/global_fields/test_global_fields_unittest.py:80
- Missing assertion for
response.request.body
, you should verify that the payload is correctly serialized to JSON to ensure the nested fields data is sent.
response = self.client.stack(api_key).global_fields(options={"api_version": 3.2}).create(read_mock_global_fileds_data)
contentstack_management/global_fields/global_fields.py:181
- The empty-string check is ineffective. To also catch
''
, useif not self.global_field_uid:
or explicitly compareself.global_field_uid == ''
.
if self.global_field_uid is None or '':
contentstack_management/stack/stack.py:296
- The previous API key header validation was removed. Consider re-adding a check to raise an error if
api_key
is missing to prevent silent misconfiguration.
def global_fields(self, global_field_uid=None, options=None):
No description provided.