I've spend many hours reading about DataContact and ServiceContract versioning techniques:
Best practices for API versioning?
My take away from all of these are the following
1) REST Uri's needs to be versioned.
[http://example.com/v1/car]
[http://example.com/v2/car]
2) Each REST resource operation that involves XML needs to contain XML namespace
<SampleItemCol xmlns="http://api.sample.com/2011/04/05">
<Items>
<SampleItem xmlns="http://api.sample.com/2011/04/01">
<Test xmlns="http://schemas.datacontract.org/2004/07/WcfRestService2">String content</Test>
<Id>2147483647</Id>
<StringValue>String content</StringValue>
<TestGuid>1627aea5-8e0a-4371-9022-9b504344e724</TestGuid>
</SampleItem>
<SampleItem xmlns="http://api.sample.com/2011/04/01">
<Test xmlns="http://schemas.datacontract.org/2004/07/WcfRestService2">String content</Test>
<Id>2147483647</Id>
<StringValue>String content</StringValue>
<TestGuid>1627aea5-8e0a-4371-9022-9b504344e724</TestGuid>
</SampleItem>
</Items>
</SampleItemCol>
So here are my questions:
1) Assuming there are hundreds of data contracts and many ServiceContracts, what would be the best class library structure to maintain different versions and namespaces?
2) If Uri's are versionined, do we even need to specify namespace for ServiceContracts?
3) Suppose there are 50 data contracts. All of them have namespace http://example.com/2011/04/01/. If 10 of these change and new namespace is created, http://example.com/2011/04/05/. Should the other 40 be copied to new namespace as well?
My biggest concern about REST namespaces and URI versions is the maintainability and class redundancy.
Thanks in advance for you suggestions and answers!