Derive a link's description from its title
Previously, a LinkDescriptor had to be created with both a rel and a description. If a description was not provided a failure would occur. This commit relaxes the above-described restriction by allowing a link's title to be used as its default description. If a descriptor has a description, it will always be used irrespective of whether or not the link has a title. If the descriptor does not have a description and the link does have a title, the link's title will be used. If the descriptor does not have a description and the link does not have a title a failure will occur. Closes gh-105
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"links": [ {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "http://alpha.example.com",
|
||||
"title": "Alpha"
|
||||
}, {
|
||||
"rel": "bravo",
|
||||
"href": "http://bravo.example.com"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"links": [ {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com/one"
|
||||
"href": "http://alpha.example.com/one",
|
||||
"title": "Alpha one"
|
||||
}, {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com/two"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"links": [ {
|
||||
"rel": "alpha",
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "http://alpha.example.com",
|
||||
"title": "Alpha"
|
||||
} ]
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": {
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "http://alpha.example.com",
|
||||
"title": "Alpha"
|
||||
},
|
||||
"bravo": {
|
||||
"href": "http://bravo.example.com"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": [{
|
||||
"href": "http://alpha.example.com/one"
|
||||
"href": "http://alpha.example.com/one",
|
||||
"title": "Alpha one"
|
||||
}, {
|
||||
"href": "http://alpha.example.com/two"
|
||||
}]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"_links": {
|
||||
"alpha": {
|
||||
"href": "http://alpha.example.com"
|
||||
"href": "http://alpha.example.com",
|
||||
"title": "Alpha"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user