OData / OData/odataorg.github.io

Odata V4 reference service produces incorrect Metadata without alias/namespace

Open
#117 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
73
Forks
106
PR merge metrics
No merged PRs in 30d

Description

The http://services.odata.org/TripPinRESTierService/ service returns the following annotation:
...
<EntitySet Name="Airlines" EntityType="Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline"> <Annotation Term="Org.OData.Core.V1.OptimisticConcurrency"> <Collection> <PropertyPath>Name</PropertyPath> </Collection> </Annotation> </EntitySet> ...
unfortunately, the used Org.OData.Core.V1 namespace is not referencing anywhere an alias or namespace in the schema.
This results, when retrieving the code with the latest available OData V4 Lib for Java, in the EdmAnnotationClass Code
public EdmTerm getTerm() { if (term == null) { if (annotation.getTerm() == null) { throw new EdmException("Term must not be null for an annotation."); } term = edm.getTerm(new FullQualifiedName(annotation.getTerm())); } return term; }
that in debugging the annotation.getTerm()=="Org.OData.Core.V1.OptimisticConcurrency" but the term is then set to null from edm.getTerm() as it seems to check for available namespace/aliases in the schema and cannot find one.
So practically, this annotation does not exist for the currently latest Olingo-OData-Client-for-Java-4.3.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by retrieving the TripPinRESTierService metadata and inspecting the Org.OData.Core.V1.OptimisticConcurrency annotation on the Airlines entity set. Compare its namespace or alias declarations with the Olingo-OData-Client-for-Java-4.3.0 lookup behavior; done means the annotation term resolves instead of returning null.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.