-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow Strings and URIs for the @Link annotation when serializing #27
base: master
Are you sure you want to change the base?
Allow Strings and URIs for the @Link annotation when serializing #27
Conversation
Codecov Report
@@ Coverage Diff @@
## master #27 +/- ##
============================================
+ Coverage 77.27% 77.52% +0.25%
Complexity 63 63
============================================
Files 10 10
Lines 352 356 +4
Branches 67 69 +2
============================================
+ Hits 272 276 +4
Misses 72 72
Partials 8 8
Continue to review full report at Codecov.
|
@langecode: Could you have a look at this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution and it makes sense to be able to annotate an URI as HALLink. I think there is a semantic problem with the string version, though. The Java URI
class does not support template URIs so it obviously must be non-templated. However, the string could both be templated or not templated and it is not possible to distinguish. I guess this could have been solved by adding an attribute to the annotation - however that could cause a conflict with the current us of HALLink
which carries this information.
I will give it some thought if there is a good way to handle the annotated strings.
@@ -75,6 +84,9 @@ public void testSerialization() throws Exception { | |||
|
|||
@EmbeddedResource | |||
public String nullString = null; | |||
|
|||
public TopResource() throws URISyntaxException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add the default constructor?
..and again thanks for the contribution. I had not noticed your PR before the mention, sorry. |
With this PR, it becomes possible to use the
@Link
annotation with Strings and URIs making the library less intrusive and easier to use.Code Example: