Skip to content

jchannon/Nancy.Siren

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages