Skip to content

Add type and title properties to Link class #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

tony-kerz
Copy link

@tony-kerz tony-kerz commented Jun 8, 2013

Simple proposal for change to allow type and title properties to Link class, of course, on board with any alternate which allows for same end result. The following example set values for new 'title' property of Link:

[ {
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/widgets/1"
  } ],
  "name" : "widget-0",
  "whatsitLinks" : [ {
    "rel" : "whatsit",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/whatsits/1",
    "title" : "whatsit-0-0"
  }, {
    "rel" : "whatsit",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/whatsits/2",
    "title" : "whatsit-0-1"
  } ]
}, {
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/widgets/2"
  } ],
  "name" : "widget-1",
  "whatsitLinks" : [ {
    "rel" : "whatsit",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/whatsits/3",
    "title" : "whatsit-1-0"
  }, {
    "rel" : "whatsit",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/whatsits/4",
    "title" : "whatsit-1-1"
  } ]
}, {
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/widgets/3"
  } ],
  "name" : "widget-2",
  "whatsitLinks" : [ {
    "rel" : "whatsit",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/whatsits/5",
    "title" : "whatsit-2-0"
  }, {
    "rel" : "whatsit",
    "href" : "http://localhost:8080/acme-widget-hateoas-web-api/whatsits/6",
    "title" : "whatsit-2-1"
  } ]
} ]

@tony-kerz
Copy link
Author

doh! forgot to run tests (and of course a bunch broke). looks like fixing all the tests will be enough work that i'm reluctant to do it if you are going to reject the change, but if this change to the Link class is acceptable, let me know and i'll fix tests. sorry about that 😢

@odrotbohm
Copy link
Member

I think it makes sense to add the properties. However:

  1. Please avoid moving methods around as this unnecessarily pollutes the changeset.
  2. Please keep Link immutable, i.e. no setters, with… methods return new instances.

Thanks!

@ghost ghost assigned odrotbohm Jun 9, 2013
- preserve immutability of link
- adjust tests such that jackson object mapper skips serialization of
nulls
- add relevent tests for new title and type link properties
@odrotbohm odrotbohm force-pushed the master branch 2 times, most recently from 4ebc1be to 266ad50 Compare July 25, 2016 18:32
@gregturn
Copy link
Contributor

Similar to #100

@pivotal-issuemaster
Copy link

@tony-kerz Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

1 similar comment
@pivotal-issuemaster
Copy link

@tony-kerz Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

gregturn added a commit that referenced this pull request Mar 26, 2017
Adds many additional attributes defined in RFC5988 and verifies they work properly in the neutral representation of Link while also being rendered properly in the HAL module.

Related tickets: #100, #417, #235
Previous pull requests: #240, #238, #223, #79
gregturn added a commit that referenced this pull request May 23, 2017
Adds many additional attributes defined in RFC5988 and verifies they work properly in the neutral representation of Link while also being rendered properly in the HAL module.

Related tickets: #100, #417, #235
Previous pull requests: #240, #238, #223, #79
odrotbohm pushed a commit that referenced this pull request Jul 28, 2017
Adds many additional attributes defined in RFC5988 and verifies they work properly in the neutral representation of Link while also being rendered properly in the HAL module.

Related tickets: #100, #417, #235
Previous pull requests: #240, #238, #223, #79
@odrotbohm
Copy link
Member

Fixed with #567.

@odrotbohm odrotbohm closed this Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants