node-odata
node-odata copied to clipboard
$metadata missing
node-data is a pretty good tool. I was very happy to find it, then I have seen that you don't create standard $metadata.
I need to call the webservice from my OpenUI5 application, so I can't use it. What a pitty!
You are right. The standard $metadata is must to be support. But now, I'm focus on features support. So, I think the usability important than interoperability, at least for now.
I will add standard $metadata after most of the features are supported.
Thanks.
I really need $metadata support so we can use this with Salesforce.com, if you can add $metadata support this would allow us to surface data in our CRM solution.
$metadata will be the major work of the next version. (v0.8)
any status on this? This would really help for SAP apps too
@TossShinHwa let me know if I can help with the $metadata task/implementation, not sure we could just roll our own or integrate with this package https://www.npmjs.com/package/odata-v4-service-metadata
Great job! I will check it later.
Sent from my iPhone
On May 24, 2016, at 14:41, Long Le [email protected] wrote:
@TossShinHwa let me know if I can help with the $metadata task/implementation, not sure we could just roll our own or integrate with this package https://www.npmjs.com/package/odata-v4-service-metadata
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
@lelong37, odata-v4-service-metadata
works well, I make a simple test for this.
var odata = require('node-odata');
var ServiceMetadata = require('odata-v4-service-metadata').ServiceMetadata;
var server = odata('mongodb://localhost/my-app');
server.resource('books', { title: String, price: Number });
server.get('/odata/\\$metadata', ServiceMetadata.defineEntities({
namespace: 'Default',
containerName: 'Container',
entities: [
{
name: 'Kitten',
collectionName: 'Kittens',
keys: ['Id'],
computedKey: true,
properties: {
Id: 'Edm.String',
Name: 'Edm.String',
Age: 'Edm.Int32',
Lives: 'Edm.Int32',
Owner: 'Edm.String'
},
annotations:[
{ name: 'UI.DisplayName', value: 'Meww' },
{ property: 'Id', name: 'UI.ReadOnly', value: 'true' },
{ property: 'Title', name: 'UI.DisplayName', value: 'Meww Meww' },
]
}
]
}).requestHandler());
server.listen(3000);
This is a example for $metadata
. So, we should integrate it with ourself resources
. If you can make a pull request for this , I will appreciate it :)
If you can't, just let me know. Thx.
@TossShinHwa sure thing, let me give it a try :)
Any news about $metadata? How could I help you guys?
Hey Guys, would be really cool if there is a native integration so that such metadata schema can be generated from the resource object.
the reason why i'm asking is because i want to integrate the odata feed with excel Power Query or with Linqpad (WCF connector)
MetadataException: Schema specified is not valid. Errors: (0,0) : error0075: Key Part: 'Id' for type Kitten is not valid. All parts of the key must be non-nullable.
i'm a bit confused with "odata-v4-service-metadata" example given on May 26, 2016, which comes directly from the documentation, and a more elaborated example you can find there https://raw.githubusercontent.com/jaystack/odata-v4-service-metadata/master/tests/schema2.json
as you see, they use different json, to describe "key" vs "keys" / "property" vs "properties" etc... giving this strange result if i try to align one with the other
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0"> <edmx:DataServices> <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Default"> <EntityType Name="Kitten"> <Key> <PropertyRef Name="[object Object]"/> </Key> <Property Name="0" Type="[object Object]"/> <Property Name="1" Type="[object Object]"/> <Property Name="2" Type="[object Object]"/> <Property Name="3" Type="[object Object]"/> <Property Name="4" Type="[object Object]"/> </EntityType> <EntityContainer Name="Container"> <EntitySet Name="Kittens" EntityType="Default.Kitten"/> </EntityContainer> <Annotations Target="Default.Kitten/Id"> <Annotation Term="UI.ReadOnly" String="true"/> </Annotations> <Annotations Target="Default.Kitten/Title"> <Annotation Term="UI.DisplayName" String="Meww Meww"/> </Annotations> <Annotations Target="Default.Kitten/[object Object]"> <Annotation Term="Org.OData.Core.V1.Computed" Bool="true"/> </Annotations> </Schema> </edmx:DataServices> </edmx:Edmx>
hope you would have some time to elaborate!
thx Herman
Hi. Is in the meantime a way for the $metadata route?