The JSON data source provides information about what REST client, REST call and path expressions to use.
The JSON data source is part of the magnolia-rest-client-ui extension module for the Magnolia 6 UI framework. The fully qualified class name is info.magnolia.rest.ui.JsonDatasourceDefinition.
If you work with the Magnolia 5 UI framework, see Content connector instead.
The JSON data source, which provides the ability to use REST clients in the UI, is a DX Core feature that is not available in the Community Edition.
Use info.magnolia.rest.ui.JsonDatasourceDefinition for the class property or jsonDatasource for the $type shortcut.
restClient
required
Specifies the REST client to be used.
restCall
required
REST call configuration. Must use the entity class com.fasterxml.jackson.databind.JsonNode.
jsonPathExpressions
required
Simplifies data selection from REST responses. See info.magnolia.rest.ui.JsonPathExpressionsDefinition for more information.
itemId
required
Unique identifier of the item.
items
required
List of items to be used by the data provider.
describeBy
optional
Describes (in the status bar) the selected item.
preview
optional
Provides preview of the selected item.
properties
optional
Mapping to get values using path expressions. Useful for values deep in the hierarchy.
name
optional,default is rest
Name of the data source.
pagination
optional
Defines a pagination strategy for the list presenter. Must implement the info.magnolia.rest.ui.pagination.PaginationStrategyDefinition interface.
When the JSON data source is paginated, sorting is disabled for lists and the items appear in the order delivered by the REST API.
Data source components
Module component mappings can be defined in the context of the current data source (a component section should have an id in the form of <id>datasource-<ds-name></id>, where <ds-name> is configured in the definition).