Contracthttp://forums.asp.net/t/1799143.aspx/1?ContractSat, 19 May 2012 15:25:57 -040017991434961256http://forums.asp.net/p/1799143/4961256.aspx/1?ContractContract <p>We have a Web Service using the new WEB API which returns domain objects and serializes them using content negotiation. One of our clients wants an XSD contract which they can use in their app. How do you provide a contract for REST services using the Web API? How would I produce a JSON version if at all? I've read a little about WADL but don't know how best to use this if at all - is there anything in VS2010?</p> <p>&nbsp;</p> <p>thanks</p> 2012-05-02T09:00:17-04:004961547http://forums.asp.net/p/1799143/4961547.aspx/1?Re+ContractRe: Contract <p>AFAIK, there is nothing currently in the Web API that produces schemas or contracts. There was an auto-generated schema and help page in Web API Preview 6 which was taken out, but I think is slated to return in the RTM.</p> 2012-05-02T10:38:11-04:004962050http://forums.asp.net/p/1799143/4962050.aspx/1?Re+ContractRe: Contract <p>This is an area which I am currently working on investigating possible solutions. Ideas, solutions, discussions, disputes, co-working... welcomed.</p> <p>Also see my post here,</p> <p><a href="http://byterot.blogspot.co.uk/2012/04/web-api-governance-life-in-schemaless.html">http://byterot.blogspot.co.uk/2012/04/web-api-governance-life-in-schemaless.html</a></p> 2012-05-02T13:51:42-04:004962284http://forums.asp.net/p/1799143/4962284.aspx/1?Re+ContractRe: Contract <p>One common mistake API developers do is writing API's to individual client needs.</p> <p>When you are the publisher of an API, clients are supposed to integrate with you.</p> <p>Otherwise you end up in this overly complicated API and spend all your timing adhering to client needs.</p> <p>There are lots of articles online about people discussing these issues. Imagine if Facebook changed their integration to every single client need.</p> 2012-05-02T15:52:26-04:004963375http://forums.asp.net/p/1799143/4963375.aspx/1?Re+ContractRe: Contract <p>I am not planning on changing our output for each client, simply how do we notify them of the format of response to expect (the contract). We are returning domain objects which are known to us. It should be relatively easy to generate an XSD file and/or some sort of JSON contract based on the domain model I would have thought? Or do we just provide them with a definition of the class and let them work it out?</p> <p>&nbsp;</p> <p>Web API supports content negotiation so it is just a question of how do you&nbsp;publish what the format of the response is going to be?</p> <p>&nbsp;</p> <p>cheers</p> <p>&nbsp;</p> 2012-05-03T09:26:03-04:004988188http://forums.asp.net/p/1799143/4988188.aspx/1?Re+ContractRe: Contract <p>May be <a href="http://blogs.msdn.com/b/yaohuang1/archive/2012/05/13/asp-net-web-api-introducing-iapiexplorer-apiexplorer.aspx"> ApiExplorer </a>will help you.</p> 2012-05-19T15:25:57-04:00