-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Gateway support for dag-json and dag-cbor responses #8823
Comments
I think this is a bad idea. It makes sense if user is a developer who you can train, but if user is someone just clicking you won’t train them, you’d just make their experience bad. I would argue that:
I think it is generally worth thinking who’s the gateway audience and who we want it to be. I think for devs we do have HTTP API, gateway should be for everyone and consequently less errors would mean better experience with IPFS |
This would remove a lot of artificial barriers to mainstream adoption of the IPLD stack, i.e.the @bmann My guess is that this is also a challenge with WNFS? |
@lidel I want to note here that Was the idea here to change the API in the dir listing from |
Shouldn't it be |
@IllidanS4 no, "DAG-JSON" and "DAG-CBOR" are not "just json and cbor view of DAG", these are names of specific formats that are subsets of each:
There is no generic "DAG": if you don't know the format of data behind a CID, you can only retrieve it as a single raw block or an opaque bag of blocks in CAR, that is why we have |
@lidel I see, thanks; I wasn't aware it should be synchronized with the multicodec table. Perhaps then it could have been |
TODO
Ability to request dag-json or dag-cbor response with:
?format=dag-json
,Accept: application/vnd.ipld.dag-json
?format=dag-cbor
,Accept: application/vnd.ipld.dag-cbor
Accept: application/json
/Accept: application/cbor
will return IPLD Data Model representation (as DAG-JSON/CBOR) of any IPLD-compatible CID (could be dag-pb, or whatever) withContent-Type: application/json
When we have this, we should also:
ensure– descoped, tracked in: gateway/dir-index-html: switch dir listing sizes to Tsize #9058Size
column in generated HTML Dir Index has the same value asTsize
in dag-jsonWhy
See ipfs/in-web-browsers#182
In short, to unlock the power of IPLD by making IPFS data that follows IPLD Data Model available as dag-json and dag-cbor HTTP gateway response formats .
It is already possible on the CLI:
Gateway support for this was previously attempted in #8037 – we need to refactor/rewrite that PR to follow conventions introduced in #8234 and #8758
Ecosystem impact around UnixFS
DAG-PB has a Logical Format which makes it possible to represent
dag-pb
directory asdag-json
document.This means
?format=dag-json
will provide a way for supporting JSON responses for directory listing, which was also requested by our users.Q&A
?format=dag-json|dag-cbor|raw|car
application/vnd.ipld.dag-json
orappliation/json
?application/json
response is to improve interop with existing tools that speak JSONThe text was updated successfully, but these errors were encountered: