Skip to content

Conversation

@reeshika-h
Copy link
Contributor

No description provided.

- 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.
@harshithad0703 harshithad0703 requested a review from Copilot June 5, 2025 10:32
Copy link

Copilot AI left a 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 GlobalField class with fetch and fetchAll methods and inclusion options.
  • Updates Stack to 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;

vkalta
vkalta previously approved these changes Jun 6, 2025
@harshithad0703 harshithad0703 marked this pull request as ready for review June 12, 2025 07:24
@harshithad0703 harshithad0703 requested a review from a team as a code owner June 12, 2025 07:24
@harshithad0703 harshithad0703 merged commit dce4c55 into development Jun 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants