From 3763f919ca9308082ac3944ae490808c57cc7f4f Mon Sep 17 00:00:00 2001 From: Hans Glad Date: Thu, 18 Dec 2025 14:03:30 +0100 Subject: [PATCH] IS-18622: add docs for strip-ns --- hub/changelog.rst | 6 ++++++ hub/dtl/dtl-functions-dictionaries.rst | 27 ++++++++++++++++++++++++-- hub/features/namespaces.rst | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/hub/changelog.rst b/hub/changelog.rst index ddc8e68694..a1fa3633a4 100644 --- a/hub/changelog.rst +++ b/hub/changelog.rst @@ -1,6 +1,12 @@ Changelog ========= +.. _changelog_2025-12-18: + +2025-12-18 +---------- +* Added a new DTL function :ref:`strip-ns `. + .. _changelog_2025-12-01: 2025-12-01 diff --git a/hub/dtl/dtl-functions-dictionaries.rst b/hub/dtl/dtl-functions-dictionaries.rst index 8bf10a540b..90b1ce5500 100644 --- a/hub/dtl/dtl-functions-dictionaries.rst +++ b/hub/dtl/dtl-functions-dictionaries.rst @@ -248,7 +248,7 @@ Dictionaries | NAMESPACE_OR_CONFIGDICT(string|dict) | VALUES(value-expression{1}) | - | The apply-ns function can be used to add a namespace to the properties of a dict (recursively by default ), like the :ref:`add_namespaces ` pipe feature does. + | The apply-ns function can be used to add a namespace to the properties of a dict (recursively by default ), like the :ref:`add_namespaces ` pipe feature does. The NAMESPACE_OR_CONFIGDICT is either a static string value or a static dict value. The static dict value is technically a set of keyword arguments. The default value is | ``{`` @@ -258,7 +258,7 @@ Dictionaries | ``"skip_dollar": true,`` | ``"recursive": true`` | ``}`` - | and reflects the behaviour of the :ref:`add_namespaces=true ` pipe property. + | and reflects the behaviour of the :ref:`add_namespaces=true ` pipe property. | | By default properties starting with an ``"_"`` (underscore) character is left as-is, except for the ``_id`` property, where the property-value is prefixed with ``:``. The ``skip_underscore`` configdict setting can be set to ``false`` to treat properties starting with ``"_"`` as "normal" properties. | @@ -279,6 +279,29 @@ Dictionaries | Returns ``{"myns:_id": "123", "myns:foo": 1, "myns:$bar": {"baz": 2}}`` +.. _strip_ns_dtl_function: + +``strip-ns`` +------------ + +.. list-table:: + :header-rows: 1 + :widths: 40, 60 + + * - Description + - Examples + + * - | *Arguments:* + | VALUES(value-expression{1}) + | + | This function recursively removes namespaces from keys in a dict, like how the :ref:`remove_namespaces ` pipe feature removes namespaces from output entities. + + - | Example: + | ``["strip-ns", {"ns1:b": 1, "ns2:c": 2}]``` + | Returns ``{"b": 1, "c": 2}`` + | + + .. _path_dtl_function: ``path`` diff --git a/hub/features/namespaces.rst b/hub/features/namespaces.rst index 81470611d7..9e1137da8f 100644 --- a/hub/features/namespaces.rst +++ b/hub/features/namespaces.rst @@ -46,7 +46,7 @@ You can enable namespaces in the service metadata for all the pipes in your subs Properties ^^^^^^^^^^ -.. _namespaces_feature_add_namespaces: +.. _namespace_features: .. list-table:: :header-rows: 1