Serialize and deserialize ORGANIZER with params#47
Serialize and deserialize ORGANIZER with params#47ryanwinchester wants to merge 2 commits intolpil:mainfrom
Conversation
2e0f883 to
902df35
Compare
| assert %Event{} = event | ||
| end | ||
|
|
||
| @tag :skip |
There was a problem hiding this comment.
This is to show that it is a breaking change. It no longer deserializes to a string. It deserializes to a map. This is the original test, I added a new test just below this one for the new functionality.
assert event.organizer == "mailto:paul@clockk.com"Will fail, now.
I left this in (but skipped so we have passing tests) so you can compare the old functionality with the new.
There was a problem hiding this comment.
Let's update this test to pass now
I duplicated in the test below with the new functionality.
icalendar/test/icalendar/util/deserialize_test.exs
Lines 107 to 134 in 902df35
So we can just delete this one.
|
Hi @lpil and @ryanwinchester 👋 I see this PR has stagnated, and I'm realising it's something I need. I think the delta is pretty small for a feature change like this, so I think with a small tweak we can maintain backwards compatibility and push this through.
The small tweak I'd suggest is simply using Elixir style function pattern matching So just copying the vanilla Does all that make sense? Or have I misjudged? I'm happy to make these changes and update the PR. At the second I'm lacking the time, but I could contribute to maintenance, if you're wanting to share some of the responsibility @lpil In the meantime I'll make these changes on my own fork. Let me know. |
|
@jarrodmoldrich if you add this test back in, with your changes, does it pass? 79b9159#diff-38283140e12894618fc3e09cccbe6d5aa4bfc35942eb9da277360ede3077e77dL78-L105 |
|
I just ran |
Closes #46
This serializes and desializes
ORGANIZERsimilar to howATTENDEEworks.The only problem is that this is a breaking change for deserializing since it's now a
map(like attendee) and not astring.One way we could make deserializing not a breaking change would be to pass in some "optional options"
opts \\ [], but they'd have to be passed all the way through from:ICalendar.Deserialize.from_ics/1->
ICalendar.Util.Deserialize.build_event/1->
ICalendar.Util.Deserialize.parse_attrs/2What do you think we should do?