node-odata icon indicating copy to clipboard operation
node-odata copied to clipboard

$metadata missing

Open englertm opened this issue 9 years ago • 11 comments

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!

englertm avatar May 28 '15 14:05 englertm

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.

zackyang000 avatar May 28 '15 14:05 zackyang000

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.

martineley avatar Jul 06 '15 17:07 martineley

$metadata will be the major work of the next version. (v0.8)

zackyang000 avatar Jul 10 '15 08:07 zackyang000

any status on this? This would really help for SAP apps too

girishbr avatar Jan 03 '16 12:01 girishbr

@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

lelong37 avatar May 24 '16 06:05 lelong37

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

zackyang000 avatar May 24 '16 10:05 zackyang000

@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.

zackyang000 avatar May 26 '16 03:05 zackyang000

@TossShinHwa sure thing, let me give it a try :)

lelong37 avatar May 26 '16 04:05 lelong37

Any news about $metadata? How could I help you guys?

mauriciolauffer avatar Oct 18 '16 00:10 mauriciolauffer

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

hermygithub avatar Jul 17 '17 14:07 hermygithub

Hi. Is in the meantime a way for the $metadata route?

maxwiese avatar Aug 19 '19 11:08 maxwiese