Reputation: 5946
Currently I am using OData2 with java via apache olingo. As time changes, new requirement comes out, now we have dynamic attributes for complex type. We cannot know these attributes in advance to provide with metaData.
So far my reading, OData4 can provide openType = true
and somehow like can provide dynamic attributes can provide.
I tried to upgrade Odata2 to Odata4, everything becomes RED. Seems like not compatible.
My database structure is open type.
Question: Is there any way to achieve dynamic attribute in Odata2 without upgrading? Any limitation for using Odata4?
Upvotes: 1
Views: 963
Reputation: 543
The OData protocol has vast incompatible differneces between V2 and V4. That is why the Olingo libraries are incompatible as well.
Also dynamic properties are currently not implemented in the Olingo libraries. At the moment every payload is validated against the metadata. This is true for Olingo V2 and V4.
If you only want these dynamic properties to be in the payload as a workaround you can use your own deserializer and serializer. If you want to address these dynamic properties within the URL then there is no workaround as the URL is tightly checked against the metadata as well.
Upvotes: 1