Swifter icon indicating copy to clipboard operation
Swifter copied to clipboard

Data instead of JSON - anyone wanna work on this with me?

Open lk251 opened this issue 4 years ago • 6 comments

Is this because Decodable wasn't available before? I'd like swifter to produce a Data instance which I can use JSONDecoder with. Anyone wanna collaborate on this?

not sure how to decode this JSON so I'm having to stringify with json.description first which seems like a terrible idea

lk251 avatar Feb 09 '21 19:02 lk251

as a result, \t is appearing as tab control character, breaking JSONDecoder decoding

lk251 avatar Mar 09 '21 09:03 lk251

@meteochu @mattdonnelly hi guys! i'm super grateful for your work, if you have a minute, I would appreciate some guidance: Why is decoding done with a bespoke JSON type, when using JSONDecoder with Swift Data type is so easy and convenient? Am I missing something? Perhaps the reason I don't see the advantage is because I didn't build the library. But right now it seems awkward to decode the by applying a set of string keys.

lk251 avatar Mar 10 '21 20:03 lk251

I need this as well and replaced the json with data in my fork.

steipete avatar Apr 17 '21 11:04 steipete

@steipete any chance you can share your fork?

antranapp avatar Jul 25 '21 23:07 antranapp

This is like a 10 minute edit. My fork contains far more changes done specifically for my purpose, makes no sense to open source.

steipete avatar Jul 26 '21 07:07 steipete

I submitted a PR for this back in January. Feel free to take a look at it and see if it works for you: #341

thebrandontyler avatar Aug 20 '21 06:08 thebrandontyler