daredadevil daredadevil - 4 months ago 68
jQuery Question

Can I use SAP UI5 mockserver without having a oData model

Backend : Jersey backend
Frontend : SAPUI5 application with a JSON model

I use jQuery.ajax() calls to make requests to the backend. I would like to mock these requests and load mock data to do a quick POC.

The Mockserver provided by SapUI5 seems to work with only oData model. can it be used with json models? https://sapui5.netweaver.ondemand.com/#docs/guide/bae9d90d2e9c4206889368f04edab508.html

Thanks in advance.

Answer

For JSon models you don't need the mockServer actually. In the Component.js try to load your JSon model as below

var oModel = new JSONModel(uritojson);
this.setModel(oModel);

uritojson is the link to your mock file

Ivan