Skip to content

Instantly share code, notes, and snippets.

@subnetmarco
Created December 19, 2011 21:12
Show Gist options
  • Select an option

  • Save subnetmarco/1498896 to your computer and use it in GitHub Desktop.

Select an option

Save subnetmarco/1498896 to your computer and use it in GitHub Desktop.
New Spec
<api format="JSON">
<authentication type="header">
<description><![CDATA[This is a simple header authentication]]></description>
<authenticationParameters>
<authenticationParameter name="X-Pippo-Username">
<description><![CDATA[Please enter here your username]]></description>
</authenticationParameter>
<authenticationParameter name="X-Pippo-Password">
<description><![CDATA[Please enter here your password]]></description>
</authenticationParameter>
</authenticationParameters>
</authentication>
<endpoint http="POST" name="Get User" group="Users" authentication="true">
<description><![CDATA[This is a sample description for the method]]></description>
<route><![CDATA[/url/{id}]]></route>
<parameters type="form">
<parameter name="id" optional="false" type="String" default="12">
<!-- Parameter Documentation -->
<description><![CDATA[This is a sample description for the parameter]]></description>
<values>
<value>1</value>
<value>2</value>
<value>3</value>
</values>
</parameter>
</parameters>
<!-- The type can be a primitive type (String, Number, Boolean) or a custom Model. -->
<response type="List[User]" optional="false" />
<!-- Errors -->
<errors>
<error code="404">
<description><![CDATA[The user was not found]]></description>
</error>
<error code="500" type="FatalError">
<description><![CDATA[System error]]></description>
</error>
</errors>
</endpoint>
<model name="User">
<description>This is a User model</description>
<example>
<![CDATA[
{
“username” : “Marco”
}
]]>
</example>
<fields>
<simple name="username" optional="false" type="String" default="pippo">
<description>This is a sample result field</description>
<example>3</example>
<values>
<value>1</value>
<value>2</value>
<value>3</value>
</values>
</simple>
<complex name="status" optional="false" type="List[Comments]" >
<description>This is a sample result field</description>
</complex>
</fields>
</model>
</api>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment