yhknight / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

Create entity with link fails if the "type" attribute is missing #215

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to create an entity, passing a link to another entity, which does not 
contain "type" attribuite. The related entity is already existing in the 
database and is not passed inline, but deferred - just the link to it.

<link 
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/dictionary" 
href="..." />

What is the expected output? What do you see instead?
A NullPointerException is thrown when the atom is parsed:
org.odata4j.format.xml.AtomFeedFormatParser.toOLinks() on line 469

Looking at the odata documentation the type attribute seems not to be required, 
so I would expect that it works without it.

What version of the product are you using? On what operating system?
0.7.0

Please provide any additional information below.

Original issue reported on code.google.com by vanjo1...@gmail.com on 11 Sep 2012 at 8:55

GoogleCodeExporter commented 9 years ago
It looks like "type" is required.  
http://www.odata.org/media/30002/OData%20Atom%20Format.html#thetypeattributeofan
atom:linkelementrepresentingarelationship

Please let me know if you see documentation that says otherwise.

Original comment by john.spurlock on 10 Nov 2012 at 9:49