custom properties in metadata document

Feb 15, 2011 at 2:17 PM


I tried to read a data service metadata document with custom attributes (defined in a custom namespace) . Currently it seems that these additional attributes and namespaces are not supported right? I also found a  // TODO: support namespaces in attributes and // Currently, only m: for metadata is supported as a prefix in the schema. in the code. Is this feature planned?

Another point: do additional annotation properties already work?

Thank you guys!


Feb 15, 2011 at 8:36 PM

We haven't implemented these because we're not sure who's using them and for what. It's certainly doable, and we'll be happy to add support for them if needed.

Can you tell us a bit about what you're planning to do with these extensions? (they'll likely simply show up in the metadata object model).



PS: the comment about 'm:' prefix is misleading - that actually refers to our internal parsing table, which only has elements from the main namespace or an 'm' extension namespace, which are treated as first-class because they're referneced in the various specs. We can still add support for other annotations in a an "extension bucket" per element.

Feb 16, 2011 at 4:30 PM

Hi Marcelo,

thank you. Yes I used an odata service with additional custom properties which were defined in the metadata document and I couldn't access them through odata.

Another question I have:

does datajs also consider Feed Customization annotations when using atom feed format

like described here?:

Do i have to read the metadata document first and then hand it over to the request so that it works correctly or does datajs take care of it automatically?



Feb 16, 2011 at 6:05 PM

Yes, datajs is aware of feed customization annotations and will apply them if present in metadata.

The library doesn't read metadata automatically (because it incurs an extra round-trip). You can download it at runtime like David explains at, or you can simply declare a literal and pass it around or push it onto OData.defaultMetadata (and then you don't have to re-specify this every time you need it).

Thanks for describing how you're using the custom properties!