-
Notifications
You must be signed in to change notification settings - Fork 2
global fields implementation and testcases #59
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
- Implemented GlobalField.h and GlobalField.m to define the GlobalField interface and its methods. - Updated Stack.h and Stack.m to include methods for creating GlobalField instances. - Added API URL methods in CSIOAPIURLs.h and CSIOAPIURLs.m for fetching global fields. - Introduced constants in CSIOConstants.h and CSIOConstants.m for global field properties. - Updated internal headers to include GlobalField.
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 introduces the GlobalField resource into the SDK, wiring up model, API endpoints, and test coverage.
- Adds
GlobalFieldclass with fetch and fetchAll methods and inclusion options. - Updates
Stackto expose globalField initializers and extends internal headers, constants, and URL builders. - Provides unit tests for successful fetches, error handling, and include parameters; cleans up existing debug logs.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Contentstack/GlobalField.h | Declares GlobalField interface and public methods |
| Contentstack/GlobalField.m | Implements GlobalField logic, networking, and parsing |
| Contentstack/Stack.h, Contentstack/Stack.m | Exposes globalField and globalFieldWithName: on Stack |
| ContentstackInternal/CSIOInternalHeaders.h | Adds private GlobalField initializers |
| ContentstackInternal/CSIOConstants.h, .m | Introduces JSON key constants for global fields |
| ContentstackInternal/CSIOAPIURLs.h, .m | Adds URL generation for single and multiple global fields |
| ContentstackTest/GlobalFieldTest.m | Adds unit tests covering fetch, fetchAll, and include options |
| ContentstackTest/ContentstackTest.m | Comments out old NSLog debug statements |
| Contentstack.xcodeproj/project.pbxproj | Registers new source and test files in project |
Comments suppressed due to low confidence (7)
Contentstack/GlobalField.h:39
- Property 'Description' starts with an uppercase letter and conflicts with NSObject's -description; consider renaming (e.g., 'fieldDescription') to avoid collision and follow naming conventions.
@property (nonatomic, copy, readonly) NSString *Description;
Contentstack/GlobalField.h:167
- The doc comment describes fetching an asset rather than a global field; update the description to accurately reflect the GlobalField fetch method.
* Fetches an asset asynchronously provided asset UID
ContentstackInternal/CSIOConstants.m:141
- [nitpick] Constant name 'kCSIO_globalfield' is lowercase and does not match the camelCase pattern used elsewhere; consider renaming to 'kCSIO_GlobalField' or matching the existing style.
NSString *const kCSIO_globalfield = @"global_field";
ContentstackInternal/CSIOAPIURLs.m:86
- The method is declared with '++' instead of '+' which will cause a syntax error. Change '++' to '+'.
++(NSString*)fetchGlobalFieldWithVersion:(NSString*)globalFieldUID withVersion:(NSString*)version {
ContentstackInternal/CSIOAPIURLs.m:90
- The method is declared with '++' instead of '+' which will cause a syntax error. Change '++' to '+'.
++(NSString*)findGlobalFieldsWithVersion:(NSString*)version {
ContentstackInternal/CSIOAPIURLs.h:38
- The declaration has an extra '+' prefix ('++') which will fail to compile. Remove the extra '+'.
++(NSString*)fetchGlobalFieldWithVersion:(NSString*) globalFieldUID withVersion:(NSString*)version;
ContentstackInternal/CSIOAPIURLs.h:40
- The declaration has an extra '+' prefix ('++') which will fail to compile. Remove the extra '+'.
++(NSString*)findGlobalFieldsWithVersion:(NSString*)version;
No description provided.