Last active
August 29, 2015 14:02
-
-
Save rushfrisby/ae50712b8a8a21df7485 to your computer and use it in GitHub Desktop.
REST API Contract Spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
BasePath: "http://www.domain.com/", //the url of your application's root | |
Version: 1.0, | |
Types: [{ //includes custom types and not built-in types like "string". Generics supported. | |
Name: "NameOfType", | |
Properties: [{ | |
"NameOfProperty": "TypeOfProperty" | |
}] | |
}], | |
Methods: [{ | |
HttpMethods: ["POST","GET","PUT","DELETE"], //any valid HTTP verbs | |
RelativePath: "api/Values/{id}", //the url parts to call the method, with format placeholders | |
Documentation: "this does that", //a brief description about what the method does | |
ReturnType: "TypeOfResult", | |
RequestContentTypes: ["xml","json","x-www-form-urlencoded"], //valid Content-Type values (part after the /) | |
ResponseContentTypes: ["xml","json"], | |
Parameters: [{ | |
TypeName: "NameOfType", | |
Name: "NameOfParameter", | |
Documentation: "this value is...", | |
Source: "FromUri", //possible choices are FromUri, FromBody, or Unknown | |
IsOptional: false | |
}] | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment