Skip to content

JSON

JSON

href for json

This feature allows to control presence of URL references in the output. Query string href overrides INI settings json_sdb.href.

Usage:
URL

?href=[true_or_false]

INI settings

json_sdb.href = [true_or_false]

Value type: boolean (True or False)

Default: True

Applicable to: list of resources, list of arrays, vectors, single resource, single array, scalar

Examples:
/Chinook/Artist/ArtistId/1.json?href=false - URL references don't appear in output.

{
"ArtistId": 1,
"Name": "AC/DC"
}

/Chinook/Artist/ArtistId/1.json?href=true - URL references appear in output.

{
"Album": {
"__href": "/db/Chinook/Artist/ArtistId/1/Album.json"
},
"ArtistId": 1,
"Name": "AC/DC",
"__href": "/db/Chinook/Artist/ArtistId/1.json"
}