Open Klaus-Keller opened 2 years ago
@Klaus-Keller I am not sure this should go into the @sap-ux/axios-extension
(#75) since it would require that it parses the metadata. So far, the module only simplifies getting the metadata but does not do anything with it. Your scenario could be easily implemented outside of the module with.
import { ODataServiceProvider } from '@sap-ux/axios-extension';
const provider = ODataServiceProvider.create({
baseURL: 'https://sap.example',
params: { 'sap-client': client }
});
const service = provider.service('/ns/my_service');
const metadata = await service.metadata();
const valueListRefs = {};
yourParser(metadata).forEach((ref) => {
valueListRefs[ref] = await provider.service(ref).metdata();
});
@Klaus-Keller I am assuming that this is not needed anymore since it has not been touched in 12+ months. If this is wrong, then please reopen.
Reopening this as it came up as requirement. Details will follow.
As a consumer of the
@sap-ux/axios-extension
(formerodata-client
), I want to be able to download metadata of referenced value help services, so that I can create mock data for them.Description
Starting with SAP Fiori elements for OData V4, value helps of applications are modeled as separate OData service endpoints. In order to write automated tests, there might be the need for mocking value help data. To be able to create mock data for value helps, we need to know the data structure behind them. This data structure can be retrieved from metadata of each value help service endpoint.
Technical Design
The module
@sap-ux/axios-extension
(formerodata-client
) allows structured access to OData services. It provides functionality to retrieve the metadata. For an OData V4 service, this metadata might contain one or multiple annotationsSAP__common.ValueListReferences
that points to the URL of a value help service. Instead of parsing the metadata for value help references by each consumer, module@sap-ux/axios-extension
could provide this functionality allowing convenient access to the metadata and metadata of all included value help references.Acceptance Criteria
Given I have a OData V4 service including value help references when I execute the function to retrieve value help metadata then I'll be able to store metadata of all referenced value help.
Notes
Example Metadata for V4 List Report Object Page service contains:
This means, the metadata for value help values can be found at:
relative/path/to/value/list/$metadata
Tasks