Closed waldheinz closed 10 years ago
i think the driving argument here should be performance issues in the fuse client. i'm reluctant to make any changes at all to the spec unless they come from a real-world impact on user experience. sorry to be such a [insert historict strict person] about this
I did not mean that the directory listings should contain schemas for the listed entries, but I meant that there is (and cannot be) a schema for the directory listing itself. Otherwise I agree that there is no immediate need for action here, but I think it's worth keeping an eye on this because of the limitations of the current format.
So, if for some reason a breaking change has to be done anyway, this could be slipped in with no additional effort.
ah right, yeah that makes more sense. so then it would become something like
{
"@context": '"http://remotestorage.io/2013/directory-listing",
"items": {
"foo": "1",
"bar/": "8"
}
}
good point!
While we're at it, I'd rather go for something like
{ "@context" : "http://remotestorage.io/2013/directory-listing",
"items" :
[ { "name" : "abc", "tag" : "DEADBEEFDEADBEEFDEADBEEF" }
, { "name" : "def/", "tag" : "1337ABCD1337ABCD1337ABCD" }
]
}
But otherwise, yes, that's what I meant.
And possibly also:
{ "@context" : "http://remotestorage.io/2013/directory-listing",
"items" :
[ { "name" : "abc", "tag" : "DEADBEEFDEADBEEFDEADBEEF", "type": "text/plain" }
, { "name" : "def/", "tag" : "1337ABCD1337ABCD1337ABCD", "type": "application/json" }
]
}
The proposed structure looks fine to me, it certainly is more extensible than the current structure. It seems that the purpose is mainly to give more information in the directory listing, instead of using additional HEAD requests. If that's the purpose, IMO, it would be easiest if all property names are the same as the HTTP headers. (Since HTTP headers are case insensitive, requiring property names to be lowercase might be good). For example:
{ "@context" : "http://remotestorage.io/2013/directory-listing",
"items" :
[ { "location" : "abc", "etag" : "DEADBEEFDEADBEEFDEADBEEF", "content-type": "text/plain" }
, { "location" : "def/", "etag" : "1337ABCD1337ABCD1337ABCD", "content-type": "application/json" }
]
}
This makes it very extensible, since any HTTP header can be used. A schema would not really be required, if specified that the meaning of each property is equivalent to that of the HTTP header, but a schema could, for example, specify that both location and etag are required and all other properties are optional.
I would rather not bind the format of the directory listing to the underlying transport (i.e. HTTP right now). This might cause trouble if another transport is used, like local file access or WebSockets or whatever might come.
I don't see why that would be a problem, since the whole protocol is built on top of HTTP, so for another transport, a major revision is required anyway. Besides that, even when another transport is used, names can still be mapped to the ones used by HTTP.
let's do it like https://github.com/remotestorage/spec/issues/26#issuecomment-22315722 in -02, that is the minimal change that makes us able to say we're part of the linked data revolution
oh, and combine it with https://github.com/remotestorage/spec/issues/16
postponing until -03, due to lack of people to who would have time to implement this right now.
I would do it. And I badly need it for 2 apps I'm working on. And I guess I'm not the only one, since basically everybody except you wanted to have it during the unconf, including a core maintainer.
Also, does anybody have any problem with @steventebrinke's proposed format? I think it would be a great solution.
done
I think the JSON format of directory listings can (and should) be improved. From the current spec, a directory is listed like this:
The problems I see with this are, in no particular order:
Therefore I'd like to suggest a response format like this:
The proposed format
HEAD
requests for determining the file size. While I strongly support this proposal, I think issuing numerousHEAD
requests purely for determining the file sizes would, because of the necessary server roundtrips, be slower than it should be.I don't consider my proposal "final", e.g. if it's called
contents
oritems
or whatever is not the scope of this post, it's just about the general structure. Maybe it's a good idea to add aversion
property to the top-level object, I don't really have an opinion about this.