Product Information
An introduction to OData CSDL Modeler for Visual Studio Code
In this blog post, we’ll introduce a new lightweight tool OData CSDL modeler for OData developers to view OData metadata CSDL document in a graphical manner in Visual Studio Code so that they can understand the structure of OData metadata more easily.
Usage of OData CSDL modeler for VSCODE
You can very easily find OData CSDL Modeler in VSCODE Marketplace at https://marketplace.visualstudio.com/items?itemName=SAPSE.vsc-extension-odata-csdl-modeler, and install the extension to your VSCODE development environment.
In order to use the CSDL modeler to view your OData metadata CSDL document, you need to download and copy the CSDL document locally:
Right click the edmx file on the VSCODE left pane, click “Open With…” context menu:
In the VSCODE command palette dialog, select “Open with OData CSDL Modeler”:
Now you will be able to see the OData metadata document is loaded successfully by the OData CSDL Modeler:
You can also see the entity sets on the property sheet as well:
Conclusion
In the blog post, we introduced a new tool “OData CSDL Modeler” in VSCODE Marketplace that enables OData developers to view complex OData metadata CSDL documents in a graphical manner so that they can understand OData CSDL structure more easily.
Thanks, this great, and very timely! We may have to explore this extension in this coming Friday's Hands-on SAP Dev live stream 🙂 Thanks also to Ralf Handl for alerting me to this.
Great DJ Adams! Any feedback would be appreciated after you evaluate the tool.
Hi Xiao-Fei
OData CSDL Modeler seems not to work for me
I downloaded XML from the URL
http://vhcala4hci:50000//sap/opu/odata/sap/ZDEMO_DDL_SPFLI_CDS/$metadata?sap-client=001&sap-language=EN
I downloaded and kept it all in text file myCSDL.metadata.xml
Open With shows "Open with CSDL Modeler"
myCSDL.metadata.xml
But the error window opens
Error Window
When I noticed that a message comes in VSCODE status line
XML Annotation Language Server: waiting for connection...
I installed SAP Fiori Tools - XML Annotation Language Server
This resolved LSP issue but got "problems"
[Error: ENOENT: no such file or directory, open 'c:\webapp\manifest.json'] {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'c:\\webapp\\manifest.json'
}
Moved myCSDL.metadata.xml to webapp directory then got problem
{"level":"info","message":"File 'file:///c%3A/Users/sssca/projects/cenproject1/webapp/myCSDL.metadata.xml' is not registered in manifest.json file"}
Regards
Jayanta@Kolkata
Hi Jayanta,
CSDL modeler support opening file with *.edmx, *.edmx.xml, *.csdl.xml, *.metadata.xml extension.
Regards,
Xiao-fei
Hi Xiao-Fei
The Open with CSDL Modeler comes with correct file extension.
But throws an error window.
I have updated my previous comment.
As I have pasted the entire output of the CSDL file
please try with this.
Regards & Thanks
Jayanta
It was strange. I can open the csdl file successfully with the CSDL modeler. What exactly the error did you see? Are you using the latest version of the modeler?
Yes, thanks so much for developing this!!!!!
Hoping you'll add support for SAP Business One's Service Layer. It also exposes an ODATA v4 endpoint with proper $metadata EDMX, but this Visual Studio Code tool gives me errors unfortunately.
I tried editing and fixed some errors prior to this one (it seemed the generated EDMX had some weird spaces inside of the XML attributes). But, once I hit the error above, I started going down a bad worm hole
*********************
Later I tried loading my SAPB1 service layer EDMX into Microsoft's CsdlReader, like thus:
Then, I can get all the errors from it at one go, using TryWriteSchema, like this:
Here's what I got from doing that.. so.. I guess the way the SAP B1 Service Layer $metadata is implemented is not pefectly compliant