-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add Codable Support for Swift 4.x #23
Add Codable Support for Swift 4.x #23
Conversation
TODOs
|
0431808
to
8d3adc3
Compare
I've been testing out Codable support from the sample above in my library for wrapping Swift actions to produce binaries. It's all working great but I made a few changes to improve the developer experience that we'd probably want to include. Here are the things I found....
This just needs the annotation adding and doesn't affect existing code or people who don't use that.
This helps the user understand when there has been problems using the Codable API versus something else.
I'm away on vacation for a week but will attempt to push a PR when I return. |
Thanks @jthomas for the review and starting the work to externalize the epilogue in to it's own library/package.
This just needs the annotation adding and doesn't affect existing code or people who don't use that. Guess what I have in my TODOs? TODOS:
I will add the one for more verbose errors 👍
I thought about this one, will look into this but probably a different PR since it's an improvement to dictionary sync that we have today. Super happy that someone is trying this stuff 🎉 |
Woot !
|
Woot !
|
Woot !
|
Woot !
|
Going to move this to a new issue #30 |
I think I'm ready for review and final merge of this PR |
ed3f602
to
2b04cde
Compare
2b04cde
to
c29147e
Compare
"success": false | ||
} | ||
``` | ||
|
||
### Packaging an action as a Swift executable using Swift 4 |
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.
Hmmmm, can't edit each line individually. Here are some typos:
Line 209: All your source code needs to be copied ...
Line 231: Take into account that starting ...
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.
updated the readme with typos fixes @paulcastro
core/swift40Action/epilogue.swift
Outdated
_whisk_print_error(message: "Error serializing data to JSON, data conversion returns nil string", error: nil) | ||
} | ||
} catch { | ||
_whisk_print_error(message: "JFailed to encode Dictionary type to JSON string:", error: error) |
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.
What's JFailed
? Typo?
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.
yeah Typo
Codable Support with Swift 4.x
Some examples of using Codable In and Out
Codable style function signature
Create file
helloCodableAsync.swift
ok: updated action helloCodableAsync
Codable Error Handling
Create file
helloCodableAsync.swift
ok: updated action helloCodableError