openui5-model-json-crud
An OpenUI5 library that extends JSONModel to send CRUD requests over HTTP with fetch, so its calls return Promises; the README documents the read method only.
A plain JSONModel holds data and leaves the request to the application. CRUDModel (openui5/model/json/crud/CRUDModel) is constructed with a service URL and sends its requests with fetch rather than jQuery.ajax, so its calls return Promises. The one method the README shows is read(servicePath, modelPath): the service path is appended to the service URL, and the model path names the property the response is written into; with no model path the local model is left alone and the response is only returned. The README names create, update and delete in its description and documents no call for them. It is installed from npm and registered in the host app's manifest under sap.ui5/dependencies/libs and sap.ui5/resourceRoots.
Facts
Where it sits
Who is behind it
In the atlas: maintains 16, contributes to 41, wrote 4@mauriciolauffermaintainer
What it declares
Every artifact
- Type
- Package
- Origin
- Independently maintained
As a package
- Where it runs
- Inside its host
- Distributed through
- npm
Connections
Keeping a control and a model in step in both directions
Framework core: module loader, MVC runtime, binding, routing, theming
Download
Install
npm add openui5-model-json-crudDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from mauriciolauffer/openui5-model-json-crud under MIT, readopenui5-model-json-crud
An OpenUI5 library which extends JSONModel to support CRUD (Create, Read, Update, Delete) operations. It uses fetch (not jQuery.ajax) to send requests to the server and populates a JSON Model with the responses. As aforementioned, OpenUI5 CRUD JSON Model uses fetch hence it returns Promises.
Demo
You can check out a live demo here:
https://mauriciolauffer.github.io/openui5-model-json-crud/demo/webapp/index.html

Project Structure
- demo - Library's live demo
- dist - Distribution folder which contains the library ready to use
- src - Development folder
- test - Testing framework for the library
Getting started
Installation
Install openui5-model-json-crud as an npm module
$ npm install openui5-model-json-crud
Configure manifest.json
Add the library to sap.ui5/dependencies/libs and set its path in sap.ui5/resourceRoots in your manifest.json file, as follows:
{
"sap.ui5": {
"dependencies": {
"libs": {
"openui5.model.json.crud": {}
}
},
"resourceRoots": {
"openui5.model.json.crud": "./FOLDER_WHERE_YOU_PLACED_THE_LIBRARY/openui5/model/json/crud/"
}
}
}
How to use
Import openui5-model-json-crud to your UI5 controller using sap.ui.define or sap.ui.require:
sap.ui.require([
'openui5/model/json/crud/CRUDModel'
], function(CRUDModel) {
const serviceUrl = 'https://api.jikan.moe/v3/'; //backend root URL
const crudModel = new CRUDModel(serviceUrl);
this.getView().setModel(crudModel, 'CRUDModel');
//'search/anime?q=DBZ' is the path to the service to be called, it'll be concatenated to serviceUrl
//'/DBZ' is the path to the property into the model, in case you want to updated the model with the response;
// empty value does not update the local model, it only returns the response
crudModel.read('search/anime?q=DBZ', '/DBZ')
.then(function() {
console.log('Data selected from API');
})
.catch(function(err) {
console.error(err.toString());
});
});
Author
Mauricio Lauffer
License
This project is licensed under the MIT License - see the LICENSE file for details
History
Others providing
Compare all 5 on the Data binding page →- ui5-antaresui5-antaresA SAPUI5 library that generates OData V2 metadata-based dialogs, object pages and value helps with input validation, and wraps OData V2 requests in promises.independent, ui5SAPUI5 library generating OData V2 metadata-based dialogs and pagesfrom UI5
- openui5-model-odata-v2-odatapromiseopenui5-model-odata-v2-odatapromiseAn OpenUI5 library that extends the OData V2 model, sap.ui.model.odata.v2.ODataModel, to support Promises; its README documents no usage, installation or API.independent, ui5OpenUI5 OData V2 model extension with Promisesfrom UI5
- openui5-validatoropenui5-validatorAn OpenUI5 library that validates the fields of a view against a JSON schema using Ajv, returning a verdict and a list of failures and leaving reporting to the user to the app.independent, ui5OpenUI5 library validating view fields against JSON schemafrom UI5
- @openui5/sap.ui.core@openui5/sap.ui.coreThe OpenUI5 core: the module loader, the MVC runtime, data binding, routing, theming and the test stack, which is everything a UI5 app does before a single community package is added.sap official, ui5Framework core: module loader, MVC runtime, binding, routing, themingfrom UI5
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:mauriciolauffer-openui5-model-json-crud- JSON
- /artifacts/mauriciolauffer-openui5-model-json-crud.json
- MCP
- Connecting an agent