> (...) This was derived directly
> from HTML FORM element "enctype" attribute. Do you think it would be
> clear if we renamed "encoding" to "enctype"? Or do you think "mediaType"
> would be best?
"enctype" looks less bad ;-) but not good
this attribute name in HTML forms was a design error (IMHO)
Other tags like <a/> <script/> <link/> all use a "type" attribute name
to fix the accepted media type
If you try to fix another media type than "application/x-form-url-
encoded", "text/x-form-url-encoded" or "multipart/form-data", it
won't be interpreted as a Content-Type header field value
(Well, mostly because other media types are not supported)
Reading to this draft another time I would propose "accept" like the
HTTP header used be the client to tell the server which mediatypes it
supports
I'm just reserved because "Accept" is officially a request header (the
server has no easy way to tell which mediatypes it accepts)
So I read again and finally see the "format" property accept MIME
media types
Example
{
"links":[
{
"href": "/rest/Product/",
"rel":"self",
"method": {"enum":["GET", "POST", "PUT", "DELETE","HEAD"]},
"format": {"enum":["application/xml","application/schema
+json; describedby=/rest/$catalog/Product"]}
},
(...)
]
}
(Tell me if its not valid, even if I'm very concerned by it, I have
little experience with JSON Schema)
> It is specified in section 8 (IANA Considerations). It would be better
> if this was spelled out in another section as well? I could do that...
My mistake.
A specific section at the beginning is still often useful to give a
stronger
identity to the format being specified.
It should also specify the official expected file extension for this
format when
stored locally :
- ".json" ?
- ".jsonschema" ?
- ".jsons" ?
Just one thing: the "definedby" parameter surely shouldn't be required
You can be sure that even if define it this way, it will be widely
omitted,
so, its better to prevent miscompatibility between strict and quirk
implementations
All the more if you define a default permanent URL value.
> I was trying to utilize existing registered relations [1], and it seemed
> to fit the description of "describedby" [2]. Do you it would be better
> to register a new link relation anyway?
>
Well, I would have done the same.
I was aware of the link header draft, but not yet about this rel
values
http://www.w3.org/TR/powder-dr/#describedby
(but is really POWDER used ???)
So why not... but...
Using an existing semantic is the best practice when the meaning
match
I just have doubts... In POWDER, describedby reference a description
in a
human language which might not be a functional description at all
The JSON Schema description is not "any description" of a resource.
It doesn't say if the referrer is nice, dangerous, nor old... It
describe
how it works and its restrictions rules