Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7446851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:26:44+00:00 2026-05-29T12:26:44+00:00

Using the OData Library October ’11 CTP to serialize an entry using v3 I

  • 0

Using the OData Library October ’11 CTP to serialize an entry using v3 I get the following:

{
    "d":{
        "__metadata": {
            "id":"http://dev.foo.bar/Statuses(7)",
            "type":"Presentation.Status"
        },
        "Description":"Testing..."
    }
}

In the v3 specification the example is as follows:

DataServiceVersion: 3.0

{
    "d": {
        "__metadata": { 
            "uri": "Customers(\'ALFKI\')",
            "type": "SampleModel.Customer",
            ....

The specification uses _metadata/uri and the Libary uses “_metadata/id”. In section [2.2.6.3.3 Entity Type (as a JSON Object)] the spec states:

The JavaScript Object Notation (JSON) serialization of an EntityType
instance MAY<58> include a name/value pair named “_metadata”. This
name/value pair is not data, but instead, by convention defined in
this document, specifies the metadata for the EntityType instance that
the JSON object represents. The ordering of this name/value pair with
respect to other name/value pairs that represent properties that are
defined on the Entity Type is insignificant. In version 1.0 and
version 2.0 of the OData protocol, the value of the “
_metadata”
property contains seven name/value pairs: “uri”, “type,” “etag”,
“edit_media”, “media_src”, “media_etag”, and “content_type”. In
version 3.0 of the OData protocol, three more name/value pairs are
added: “properties”, “actions”, and “functions”. The order of these
name/value pairs is insignificant. The value of the “uri” name/value
pair MUST be the canonical URI identifying the EntityType instance
represented by the JSON object.

It looks like the current CTP of the OData library is incorrectly emitting “id”, where it should be emitting “uri”, as the uriNVP – as defined by:

metadataNVP = quotation-mark "__metadata" quotation-mark
              name-seperator
              begin-object
              ( uriNVP
....

uriNVP = quotation-mark "uri" quotation-mark
             name-seperator
             quotation-mark resourcePath quotation-mark

Is the Library just incorrect – or am I missing something or using it incorrectly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T12:26:47+00:00Added an answer on May 29, 2026 at 12:26 pm

    The V3 spec is not yet complete. We did add the id property into the OData Library, it just didn’t make it into the official spec yet. Note that the id and uri are two different things.

    The id property is the value of the ODataEntry.Id property. It should be a globally unique URI identifying the entity. It doesn’t have to be a valid URL, so for example “urn:myentity:id1” is perfectly fine. It’s the same value as the id element in the ATOM representation.

    The uri property is the edit or read link. So it’s the value of the ODataEntry.EditLink or if that’s null it’s the vaue of the ODataEntry.ReadLink. This has to be a valid URL which can be used to read and/or modify the entity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the benefit of the new Javascript OData library over using jQuery? http://blogs.msdn.com/b/astoriateam/archive/2011/02/08/new-javascript-library-for-odata-and-beyond.aspx
I’m trying to get some code working using OData. The following bit of code
I have a WP7 app using the ODATA v2 library with DataServiceState class and
OData services expose their metadata: http://www.odata.org/blog/queryable-odata-metadata What's the best way to programmatically get the
I am following authentication method described at http://blogs.msdn.com/b/astoriateam/archive/2010/07/21/odata-and-authentication-part-6-custom-basic-authentication.aspx I am able to consume service
Am a newbie in odata4j concepts. Using odata4j Library odata4j-0.5-nojpabundle.jar launched producer on tomcat
I've created an OData endpoint (using entity framework, WCF data service) and added a
I have created an OData/WCF service using Visual Studio 2010 on Windows XP SP3
I tried to create a OData web service using VS 2008 without any luck.
I'm attempting to make an Odata post using odata4j. After dumping the posted xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.