<br><br>> A single media type to describe all documents returned by the API<br><br>Interesting question.<br><br>My initial reaction is that the single application/vnd.com.redhat.rhevm.api+xml media type may indeed be better than a proliferation of more fine-grained types, as really what we're trying to capture here is the "application protocol", which could be thought of in a holistic sense as applying to the entire API. <br>
<br>Whereas the individual fine-grained type could be inferred from the entity-body in any case, from say the schema identified in the root xmlns attribute or whatever. So this doesn't need to be necessarily specified in the Content-Type header.<br>
<br>A single media type may well be easier to standardize also, if we ever need to evolve it out of the vendor-private space.<br><br>Cheers,<br>Eoghan<br><br><br><div class="gmail_quote">On 15 April 2010 12:54, Mark McLoughlin <span dir="ltr"><<a href="mailto:markmc@redhat.com">markmc@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hey,<br>
<br>
Okay, I'll take a shot at kicking this off<br>
<br>
We're beginning to work on defining a RESTful API for RHEV-M here:<br>
<br>
  <a href="https://fedorahosted.org/rhevm-api/" target="_blank">https://fedorahosted.org/rhevm-api/</a><br>
<br>
One thing we're considering doing is adding new media types for the<br>
document formats produced and consumed by the API. Some discussion on<br>
that here:<br>
<br>
  <a href="https://fedorahosted.org/pipermail/rhevm-api/2010-April/000069.html" target="_blank">https://fedorahosted.org/pipermail/rhevm-api/2010-April/000069.html</a><br>
<br>
The main motivation is that it gives us room to make an incompatible<br>
change in the document format and allow clients to negotiate which<br>
version they require<br>
<br>
To be clear - we're not planning on making incompatible changes, but<br>
it's best to design for the possibility<br>
<br>
So, the idea is to have e.g.<br>
<br>
  Accept: application/vnd.rht.rhevm.vm+xml;version=1<br>
<br>
We would only bump the version number if we make an incompatible change<br>
to the format. Clients would not be able to negotiate different<br>
compatible format versions<br>
<br>
Anyway, we should discuss:<br>
<br>
  - Whether this is a sound idea to adopt in general<br>
<br>
  - vnd.rht vs. vnd.redhat vs vnd.com.redhat<br>
<br>
  - Do we need to register these types with the IANA<br>
<br>
  - A single media type to describe all documents returned by the API:<br>
<br>
      application/vnd.rht.rhevm+xml;version=1<br>
<br>
    or a media type for each entity type:<br>
<br>
      application/vnd.rht.rhevm.vm+xml;version=1<br>
      application/vnd.rht.rhevm.host+xml;version=1<br>
      application/vnd.rht.rhevm.collection+xml;version=1<br>
<br>
    or also add media types for each collection type:<br>
<br>
      application/vnd.rht.rhevm.vm+xml;version=1<br>
      application/vnd.rht.rhevm.host+xml;version=1<br>
      application/vnd.rht.rhevm.collection.vm+xml;version=1<br>
      application/vnd.rht.rhevm.collection.host+xml;version=1<br>
<br>
  - Are modifiers like '+json' and '+yaml' standardised anywhere?<br>
<br>
Cheers,<br>
Mark.<br>
<br>
_______________________________________________<br>
rest-practices mailing list<br>
<a href="mailto:rest-practices@redhat.com">rest-practices@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/rest-practices" target="_blank">https://www.redhat.com/mailman/listinfo/rest-practices</a><br>
</blockquote></div><br>