Skip to content
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

[MC-2003] Custom template dictionary swift bool #370

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

nzagorchev
Copy link
Contributor

@nzagorchev nzagorchev commented Aug 30, 2024

JIRA MC-2003

Overview

Defining a boolean inside a dictionary in swift, results in an error when syncing it.
The definition is:

templateBuilder.addArgument("map", dictionary: [
    "int": 0,
    "bool": true
])

Error:

Define Custom Templates error: Variable `map.bool` has value that does not conform to its type.

The default value is sent as true but the type is set as number.

The same definition works in objective-c.
The bool can be defined inside the map using dot notation map.bool successfully.

Implementation

Check the inner type of the NSNumber to find if it is a boolean __NSCFBoolean or a number __NSCFNumber.

Testing

Unit tests and Manual QA

@nzagorchev nzagorchev changed the title Custom template dictionary swift bool [MC-2003] Custom template dictionary swift bool Aug 30, 2024
Copy link
Contributor

@nishant-clevertap nishant-clevertap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nzagorchev nzagorchev merged commit 89cb56c into develop Sep 5, 2024
1 of 5 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.

2 participants