Skip to content

Instantly share code, notes, and snippets.

@kevinswiber
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save kevinswiber/d56e081e40286b11fd55 to your computer and use it in GitHub Desktop.

Select an option

Save kevinswiber/d56e081e40286b11fd55 to your computer and use it in GitHub Desktop.
vnd.application/siren+xml
<entity class="order">
<properties>
<property name="orderNumber">42</property>
<property name="itemCount">3</property>
<property name="status">pending</property>
</properties>
<entities>
<entity class="items collection"
rel="http://x.io/rels/order-items"
href="http://api.x.io/orders/42/items" />
<entity class="info customer" rel="http://x.io/rels/customer">
<properties>
<property name="customerId">pj123</property>
<property name="name">Peter Joseph</property>
</properties>
<links>
<link rel="self" href="http://api.x.io/customers/pj123"/>
</links>
</entity>
</entities>
<actions>
<action name="add-item"
title="Add Item"
method="POST"
href="http://api.x.io/orders/42/items"
type="application/x-www-form-urlencoded">
<fields>
<field name="orderNumber" type="hidden">42</field>
<field name="productCode" type="text" />
<field name="quantity" type="number" />
</fields>
</action>
</actions>
<links>
<link rel="self" href="http://api.x.io/orders/42" />
<link rel="previous" href="http://api.x.io/orders/41" />
<link rel="next" href="http://api.x.io/orders/43" />
</links>
</entity>
<entity class="order">
<property name="orderNumber">42</property>
<property name="itemCount">3</property>
<property name="status">pending</property>
<entity class="items collection"
rel="http://x.io/rels/order-items"
href="http://api.x.io/orders/42/items" />
<entity class="info customer" rel="http://x.io/rels/customer">
<property name="customerId">pj123</property>
<property name="name">Peter Joseph</property>
<link rel="self" href="http://api.x.io/customers/pj123"/>
</entity>
<action name="add-item"
title="Add Item"
method="POST"
href="http://api.x.io/orders/42/items"
type="application/x-www-form-urlencoded">
<field name="orderNumber" type="hidden">42</field>
<field name="productCode" type="text" />
<field name="quantity" type="number" />
</action>
<link rel="self" href="http://api.x.io/orders/42" />
<link rel="previous" href="http://api.x.io/orders/41" />
<link rel="next" href="http://api.x.io/orders/43" />
</entity>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment