Skip to content

v0.21.2: Context URLs of contained entities

Choose a tag to compare

@jaravan jaravan released this 28 Oct 23:07
· 194 commits to main since this release

What's new

Contained entities' context URLs

A contained entity, one a navigation with ContainsTarget holds and no entity set does (TripPin's Person.Trips), lives in an entity set the server makes for it. Its responses named that set in their context URL: $metadata#People-Trips(Name), which is in no $metadata, so a client resolving the context found nothing. Now the context is the path through the parent, as the OData spec writes it for contained entities:

GET People('russellwhyte')/Trips?$select=Name
  before: "@odata.context": ".../$metadata#People-Trips(Name)"
  now:    "@odata.context": ".../$metadata#People('russellwhyte')/Trips(Name)"

GET People('russellwhyte')/Trips(1)
  now:    "@odata.context": ".../$metadata#People('russellwhyte')/Trips/$entity"

The same for nested ones (People('ben')/Trips(1)/PlanItems), $apply results and a created entity's response.

Upgrading

  • A V4 response for contained entities has another @odata.context, as above. Nothing else changes: the entities, their URLs and Location were already the paths through their parents. V2 has no containment.

Install

npx odata-prova@0.21.2 ./MySrv
docker run -p 3000:3000 -v "$PWD/MySrv:/models/MySrv:ro" ghcr.io/jaravan/odata-prova:0.21.2

Details: Navigations without a ReferentialConstraint (containment).