ritasker / Nancy.Siren

Allows you to return Siren hypermedia payloads when using the correct Accept header in your Nancy application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Nancy.Siren

A library to extend your response payload with the Siren hypermedia media type

{
    "class": [
        "order"
    ],
    "properties": {
        "orderNumber": 6534,
        "itemCount": 6,
        "status": "Completed"
    },
    "entities": [
        {
            "class": [
                "collection"
            ],
            "rel": [
                "http://localhost:8080/rels/order-items/"
            ],
            "href": "http://localhost:8080/orders/6534/items"
        }
    ],
    "actions": [
        {
            "name": "delete-order",
            "title": "Delete Order",
            "method": "DELETE",
            "href": "http://localhost:8080/orders/6534/"
        },
        {
            "name": "add-to-order",
            "title": "Add Item To Order",
            "method": "POST",
            "href": "http://localhost:8080/orders/6534/",
            "type": "application/json",
            "fields": [
                {
                    "name": "productCode",
                    "type": "text"
                },
                {
                    "name": "quantity",
                    "type": "number"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "http://localhost:8080/orders/6534"
        }
    ]
}

About

Allows you to return Siren hypermedia payloads when using the correct Accept header in your Nancy application

License:MIT License


Languages

Language:C# 100.0%