From 9342323a9ccee39c3305e7231104b948326fb76e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 12:50:01 +0000 Subject: [PATCH] Link the tested remote-service samples from the external-service page The page said, rightly, that nothing tested a remote service call and that its Northwind code was the shape rather than a measured recipe. cap2UI5/samples-stack now has that recipe: Z2UI5_CL_CAPS_APP_001 reads SAP S/4HANA's API_BUSINESS_PARTNER with cds.connect.to and cds.ql, runs against CAP's mock without the system, and is tested against that mock and through a real OData V2 request. Z2UI5_CL_CAPS_APP_002 does the same for a function module over RFC with @sap/cds-rfc. The warning becomes a pointer to the sample, and keeps saying that the Northwind code itself runs in no test. verify-refs reads the two sample names as framework classes because of their z2ui5_ prefix, so they go into .verify-refs-ignore with that reason. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TRkYvBYut1a1PjFYuUAcqj --- docs/.verify-refs-ignore | 6 ++++++ docs/examples/external-odata.md | 21 +++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/.verify-refs-ignore b/docs/.verify-refs-ignore index a8b74ad..bf353cc 100644 --- a/docs/.verify-refs-ignore +++ b/docs/.verify-refs-ignore @@ -18,6 +18,12 @@ my_app_name # stands for "your class" in the ?app_start= URL on the zcl_my_app # stands for "your app class": the name you gave defineApp in the why-cap2UI5 pitch, and the ABAP class on the views page — an ABAP app is registered by its transpiled class, not by defineApp ClassName # literal placeholder in the URL-parameter description +# --- apps of other repositories ------------------------------------------- +# Registered with defineApp in their own repository, not in cap2UI5 - and apps, +# not framework classes, whatever their z2ui5_ prefix says to the class check. +z2ui5_cl_caps_app_001 # cap2UI5/samples-stack's OData sample, linked from examples/external-odata +z2ui5_cl_caps_app_002 # cap2UI5/samples-stack's RFC sample, linked from examples/external-odata + # Upstream's frozen src/99 needs no entries any more: the plugin hosts # upstream's whole transpiled runtime, so z2ui5_cl_xml_view and its siblings # ARE in it (measured in the assembled output) and resolve like any other diff --git a/docs/examples/external-odata.md b/docs/examples/external-odata.md index 4017522..f1821d6 100644 --- a/docs/examples/external-odata.md +++ b/docs/examples/external-odata.md @@ -4,12 +4,16 @@ An app is a CAP handler in every way that matters, so calling a remote service is CAP's job rather than cap2UI5's: import the service, declare it in `cds.requires`, `cds.connect.to` it, and run a query. -::: warning Not exercised by this project's test suite -Everything here is standard CAP remote-service usage, and it works from an app -because an app is ordinary handler code with `cds` in scope. But there is no -test in the repository that calls a remote service, so treat this page as the -shape rather than as a measured recipe — unlike [Hello World](./hello-world) -and [List & Detail](./list), which are files the CI runs. +::: tip Runnable and tested: cap2UI5/samples-stack +[cap2UI5/samples-stack](https://github.com/cap2UI5/samples-stack) has this page +as a project you can run. Its sample +[`Z2UI5_CL_CAPS_APP_001`](https://github.com/cap2UI5/samples-stack/blob/main/srv/apps/z2ui5_cl_caps_app_001.js) +reads SAP S/4HANA's OData service `API_BUSINESS_PARTNER` the way this page +shows — `cds.connect.to`, then `cds.ql` — and runs without the system: while no +credentials are configured, `cds watch` mocks the service. Its tests drive the +app against that mock and through a real OData V2 request. The Northwind code +below has the same shape, but no test runs it — the sample is the measured +recipe. ::: ## Import the service @@ -106,4 +110,9 @@ until you refresh it deliberately. ## Next - [**List & Detail**](./list) — the same shape against your own entities, tested +- [**cap2UI5/samples-stack**](https://github.com/cap2UI5/samples-stack) — this + page against SAP S/4HANA, and a function module in an SAP system called over + RFC with `@sap/cds-rfc` + ([`Z2UI5_CL_CAPS_APP_002`](https://github.com/cap2UI5/samples-stack/blob/main/srv/apps/z2ui5_cl_caps_app_002.js)) + — both runnable without the system, both tested - [**Data Binding**](../guide/data-binding) — declaring the row type