OData / OData/AspNetCoreOData

Type Microsoft.OData.Edm.EdmModel is not configured as a type that is allowed to be serialized for this instance of ObjectSerializer

Open
#952 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Version: 8.0.12
MongoDB.Driver: 2.19.2
MongoDB.Entities: 22.0.0

I am using MongoDB to create Odata service.
Here are my API and entity object
image

image

The issue currently while using
https://localhost:7119/odata/Supplier?select=Name
select for mongo db collection. It is throwing an error for mongo db. I am not sure is a mongo db package issue or if something needs to configure for OData.
BsonSerializationException: Type Microsoft.OData.Edm.EdmModel is not configured as a type that is allowed to be serialized for this instance of ObjectSerializer.

image

Can anyone guide here on what can be an issue here?

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 reproducing the failure at the /odata/Supplier?select=Name endpoint using the reported ASP.NET Core OData, MongoDB.Driver, and MongoDB.Entities versions. Trace how the OData $select request reaches MongoDB and the ObjectSerializer exception, then determine whether the failure is in package interaction or requires OData configuration; done means the endpoint works or the incompatibility is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, mongodb
Domain
api, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.