shashisadasivan / EDMXTrimmer

D365 Finance and operations EDMX trimmer
MIT License
21 stars 12 forks source link

:sparkles: add support for dataverse edmx files #24

Open FH-Inway opened 1 year ago

FH-Inway commented 1 year ago

While looking at #20 (which basically adds support for Business Central edmx files), I also played around with a Dataverse edmx file. While the trimmer does its thing with it, the result does not seem usable by downstream tools.

E.g. with the ODataConnectedService, no C# client can be generated. The OOASUtil (from OpenAPI.NET.OData) cannot generate an OpenAPI specification from it.

After playing around with a trimmed Dataverse edmx file, I found that the Dataverse edmx file seems to make use of more advanced features of the OData specification. For example, it includes references to OData vocabulary extensions, defines base types for entities, functions and function imports (which seem to be similar to action imports).

To support Dataverse edmx files, the trimmer would need additional functionality that covers the points listed above and probably more.

FH-Inway commented 11 months ago

@AndrewK2 Thanks for your pull requests. At a first glance, they seem to be changes that cover part of this issue? It will probably be not until next week when I can take a proper look at your changes. Let me know if you have additional comments or information for them.

AndrewK2 commented 11 months ago

Sorry for the delay. Yes, it looks so. In my case, those changes and a few more in my fork are required to clean up unused/unrelated types from Dynamics CRM EDMB to let the odata-cli utility (or VS OData Connected Service extension) complete code generation.

FH-Inway commented 11 months ago

Had a chance to look more closely at the changes from #28 Very nice changes, I like the refactorings and the noticable performance boost. It has been a few months since I was that deep in the logic of the trimmer. Hopefully, I can spend some time on #27 this weekend.

FH-Inway commented 10 months ago

@AndrewK2 Had a look at #27 today and I think I have an overview of the changes now. I've added a todo list to the first post of this issue and linked the commits from your prs that I felt were most pertinent to the todo. Let me know if you see other todos missing from that list.

Does your fork contain a version that can produce a trimmed Dynamics CRM .edmx file that can be processed by either the OOASUtil or the OData Connector? So far, I have not been able to do that, even with your changes.

I think my next step (unless you beat me to it) will be to address the regression mentioned in #28. Once this is adressed, #27 could be merged. This would make it easier to add further changes from the todo list.

FH-Inway commented 10 months ago

@AndrewK2 I took a stab at fixing the regression, see my pr https://github.com/AndrewK2/EDMXTrimmer/pull/1 to your master branch. It also introduces some unit testing based on the edmx of https://www.odata.org/blog/trippin-new-odata-v4-sample-service/

FH-Inway commented 10 months ago

@AndrewK2 I've now merged your changes with my regression fix into master and released new version 0.2.2. Thanks for your contributions and I'm happy to work with you in implementing further changes to get Dataverse files fully supported.