Guys, Is there anyway to read a json file in the c...
# kotlin-native
b
Guys, Is there anyway to read a json file in the common code ? let say, I want to read a dummy json file to be parsed later using kotlin serialization
k
From the local file system? On mobile? You'd definitely need to expect/actual that. There's no local i/o in common code.
b
hmn, yeah there is no local i/o in common code. so we have to manually expect/actual ? coz, I need to test my repository and mocking my json file there
k
Yeah, you'd definitely need to do that then. Generally pretty simple process, though.
Did that for mobile but using assets and bundles, not local files.
b
ic, so like a tricky :)
o
alternative is to have JSON in string literal
b
yeah, currently I'm doing like that #lol
n
Could do it as a string literal but then you would have a stringly typed ( http://wiki.c2.com/?StringlyTyped ) situation to deal with 😆 .