apazureck / odatatools

OData Tools for vscode
24 stars 12 forks source link

There is no Function in EntitySet if it bounds to Collection(SomeType) #29

Closed olexu closed 6 years ago

olexu commented 6 years ago

I have two functions in $metadata:

`

` When I try to generate models there is no **AccessGroupTemplate** function in **AccessGroupEntitySet**. Only **AdHocMemberships** function is exists. Is it a bug?
apazureck commented 6 years ago

Hi,

Maybe. The question is: Is it in the default template or in the preprocessing.

Could you send me the whole metadata file? I will try to look into it this week. Or you could get the preprocessed json from the output console. It should be dumped there. This is the data the handlebars template works with to generate the client.

olexu commented 6 years ago

Hi, Here is metadata file I'm using. I think the problem in preprocessing, but not sure.

metadata.xml.txt

apazureck commented 6 years ago

Thanks,

I'll have a look at it. I hope I can check it this week. But no promise, we are moving this weekend, so time is scarce.

apazureck commented 6 years ago

Hi @olexu,

I had a look at your OData Service. There are some shortcomings in the generator (like EntitySets and Actions/Functions with the same name). I'll try to fix that the next days.

apazureck commented 6 years ago

@olexu,

I found the error. Please replace your template with this proxy.ot template: https://github.com/apazureck/odatatools/blob/develop/dist/templates/promise/proxy.ot It should fix your issue.

And you will have to rename your "Context" Function, as the name collides with the Context Property.

I will provide a "post production" strategy to enable the user to autofix this in the near future. But I cannot just prefix every unbound function in my default template, as it will be an api breaking change.

But you can do with your template what you want! Just Prefix all unbound functions in the template with _ or something you like and you will not have colliding names anymore.

Regards

olexu commented 6 years ago

Thanks a lot. It works fine