Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Metadata for Dynamics 365 Finance and Operation in JSON format using OData and Metadata for single Entity

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Everyone

I am trying to get the Metadata from D365 FnO in JSON format using the Odata protocol but problem is, it giving an error. Self referencing loop detected for property 'Container' with type 'Microsoft.OData.Edm.Library.EdmEntityContainer'. Path 'EntityContainer.Elements[0]'. - This is the error message I get when trying to use this URL : InstanceURL/data/$metadata?$format=application/json.

I read on OData documentation that application/json and json are both recognized as valid argument for format query and format query has precedence over request Headers.
If I try to get metadata of a single Entity using the URLs that Odata sends in data response, something like : "@odata.context" :"InstanceURL/data/$metadata#[EntityName]". Entity name is not honored in such a case.
so my question is : 1. Is there a way to get JSON format metadata from D365 FnO since XML format is way to big in size and takes a lot of time.
2. Is there a different syntax for getting metadata of a single entity.
Let me know if any other information is needed.
All is appreciated. 
Thanks!
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Metadata for Dynamics 365 Finance and Operation in JSON format using OData and Metadata for single Entity

    Hi Will

    Thanks for the response. If this helps the error type is -> Newtonsoft.Json.JsonSerializationException under innererror response.

    Is this not supported by the MS D365 FnO? I am asking this question because other application that use Odata can send metadata in JSON format for a single Entity. I am receiving this specific error response and type when specifying format in URL or application/json in headers.

    Is there any workaround for this? Metadata document in XML is taking forever to load. It is around 25 MB in size :D.

    I am not that familiar with MS FnO but is there any system level change or something that I can do in FnO instance to get around this error.

  • WillWU Profile Picture
    WillWU 22,352 on at
    RE: Metadata for Dynamics 365 Finance and Operation in JSON format using OData and Metadata for single Entity

    Hi A.D.I.T.Y.A. ,

    As far as I know, this isn't supported by the specification. The $metadata document is in the CSDL format, which is only available in XML format, not JSON.

    You have to parse XML by yourself. You could use some of the third-party libraries to do this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans