OData / OData/AspNetCoreOData

Need a way to build custom URIs in OData responses (i.e. "@odata.context", "@odata.nextlink")

Open
#524 3 comments 0 reactions 1 assignee View on GitHub

@mikepizzo is already working on this.

Since Mar 15, 2022.

feature question
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

I'm building an OData API that will be hosted in a multi-tenant and load-ballanced environment with multiple backend servers/nodes.

Also, web requests may be routed to backend apps by our custom web gateway. The gateway may route requests to internal and private URI with additional segments.

I'm concern of URI values returned in OData responses in production (i.e. "@odata.context", "@odata.nextlink").
Values may be incorrect for public clients and further requests...
At least the host part will point to the private node/app.
Also protocol and segments may conains rewrited ones by our gateway.

Is there a way to handle custom URIs in responses with AspNetCoreOData ?
Maybe some "publichost" configuration setting or a dynamic handler hooked in code ?

For now, I'm thinking of implementing a custom middleware that deserialize odata responses, look for URIs in "@odata.*" elements, correct it with public values.
Deserializing JSON sounds really bad for performance... maybe I can inspect OData responses before it get serialized in HTTP response ?
Maybe there is a more fast and elegant solution ?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.