Skip to content

Resource Not Found Error, Upload Link Provided in Error #18

@mmadson

Description

@mmadson

Hi,

I'm a HAL / vnd.error newbie and I'm just wondering if I have the hang of it.

I've got a resource

/configuration

It supports

PUT - create / overwrite the current configuration file
GET - retrieve the current configuration file

If a user attempts to GET before a PUT, I intend to return 404 NOT FOUND and I'd like to give some guidance in the response body for what the user should do. I was thinking of using vnd.error as my representation but I wanted to add a few helper links, like so:

{
    "_links": {
        "curies": [{
            "name": "term",
            "href": "/about/{term}",
            "templated": true
        }],
        "help": {
            "href": "/errors/configurationNotFound",
            "title": "Configuration Not Found Error Information"
        },
        "term:uploadConfiguration": {
            "href": "/configuration",
            "title": "Upload Configuration"
        },
        "term:errorCodes": {
            "href": "/errors/{errorCode}",          
            "title": "Error Code Detailed Information",
            "templated": true
        }
    },  
    "message": "The configuration was not found, did you forget to upload it?",
    "errorCode": "configurationNotFound"
}

Does this conform to the vnd.error spec? Is it valid HAL? ... or am I completely missing the mark. Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions