I was thinking alot about REST and service versioning again today. In my previous blog I talked a bit about using the media type and probably XML schema to guarantee a contract between the client and server. The client would ask for “application/vnd1+xml” and be all set for its conversation to begin.
The big problem I see with this is a service maintenance problem. As you rev your service and your schema you’re going to have to support a lot of different media types. What would make things easier is if XML Schema supported polymorphism. That way a client could ask for “application/vnd1+xml” format and still receive and validate a newer version of the schema. Please correct me if I’m wrong, but I don’t think you can do this in XML schema. Yes you could extend various types from the parent to create a newer version of a schema, but a validator would not be able to enforce a polymorphic relationship with its parent AFAIK.
Clients and servers could get around this XSD problem by not doing validation and hoping that the schema developers are disciplined enough to make future versions of the format backward compatible. It just seems incomplete to me to not be able to validate.