-
Notifications
You must be signed in to change notification settings - Fork 753
Fix issue with Array in the Inline templates #687
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
Hey 👋 I'm Eve, the friendly bot watching over SwiftGen 🤖 Thanks a lot for your contribution! Seems like everything is in order 👍 You did a good job here! 🤝 Generated by 🚫 Danger |
Thanks for the PR! It seems you didn't update the tests accordingly (or didn't add a test to cover this case that we missed). Could you add one please? |
[SwiftGen#687](SwiftGen#687) [@fjtrujy](https://github.com/fjtrujy) Fix issue with Array in the Inline templates
Hello, |
# Conflicts: # CHANGELOG.md # templates/plist/inline-swift4.stencil # templates/plist/inline-swift5.stencil
|
Clarification for these latest changes:
|
Thanks @djbe for progressing with the work. |
# Conflicts: # CHANGELOG.md
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.
The fix for the particular problem looks good to me.
But I think we might have another issue (and likely not just with strings in arrays but with strings in general) when they contain escaped quotes…
(Feel free to decide if it's better to either fix this in this current PR or to split that in a separate one)
Description
This PR fixes issues with
plists/inline-swift4.stencil
orplists/inline-swift5.stencil
templates to generate the content of a list that contains arrays.So far the content of the plist is:
And visually it looks:
Then in the
.swiftgen.yml
I just have somethings as:When I execute it, it generates wrong data:
If you see it misses the
quotes
in every single element in the array, and in the plist, they are declared asString
Digging into the template I found where the issue "could be", I have created a solution, I tried locally and is working fine, but I don't know if this is breaking something else. Besides I see that the same logic is applied in several templates, so not sure if in these templates is broken as well.
The solution that I applied in the
plists/inline-swift4.stencil
was:The new output is:
🎉 🎉 🎉 🎉 🎉 🎉 🎉
Here you have the reference to the specific github issue that I created time ago. #662
Thanks!