API for Accessing metadata

Jan 13, 2012 at 2:04 PM
Edited Jan 13, 2012 at 2:05 PM


as datajs reads and  processes the metadata internally it is possible to access this metadata and e.g. the types via an API or how is this possible?

This is needed for doing e.g. validation of user input etc.

Could this already parsed metadata be exposed somehow to the user?


Thanks and best regards!


Jan 16, 2012 at 6:14 PM

Hi Joe,

   Hope you are doing great.  To what metadata do you refer?? To the additional information about properties and the like that is availabe in the ATOM feeds? Or to the metadata exposed by the end point via the $metadata URI?  If the former, this data is available to you (only when working with ATOM feeds) as part of the entry objects that the library creates after parsing the ATOM feed / entry document.  Please see the OData payload formats page for more details.  If the latter, then you can request the full metadata of the OData service by using the metadata handler: 

var metadata;
OData.read("myservice.svc/$metadata", function (data) { 
      metadata = data;
   }, function (err) {
   }, OData.metadataHandler);

   We don't have publicly availabe apis to navigate through the metadata object.. but you are welcome to look into some of the internal helper functions that the library uses. 


Alex Trigo.

Jan 17, 2012 at 12:49 PM

Hi Alex,


thanks for your reply. Yes I meant the metadata document. The metadata included with atom feeds that is already exposed is nice but works only when the user requests this data in this format and not in JSON as you mentioned.

Ok then I'll do a metadata request as you specified...Is there any documentation available how the retrieved metadata is parsed and converted by datajs?

Also do you already parse metadata extensions that the service may provide/define?

Best regards