Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

[feature] better json deserialization support #120

Open
connectdotz opened this issue May 28, 2019 · 0 comments
Open

[feature] better json deserialization support #120

connectdotz opened this issue May 28, 2019 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@connectdotz
Copy link
Contributor

There didn't seem to be a symmetric way to retrieve an object as written by textile.files.add(anObject, caption, threadId) for 'json' scheme.

  1. it's great that we can pass the original object without stringify, but it is not clear how we can retrieve this object through existing API, I have tried textile.file.content and textile.ipfs.cat, both gave blob instead of the deserialized object.

  2. once we have the new API that can indeed restore the data back to its original form, i.e. calling JSON.stringify() on the json string extracted from internal response blob, it will be great if textile can take an optional reviver like argument so developers can customize the deserialization accordingly, such as creating a Date object when encountering a ISO date string, among others.

@carsonfarmer carsonfarmer self-assigned this Jul 30, 2019
@carsonfarmer carsonfarmer added bug Something isn't working enhancement New feature or request labels Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants