Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hub/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

.. _changelog_2025-12-18:

2025-12-18
----------
* Added a new DTL function :ref:`strip-ns <strip_ns_dtl_function>`.

.. _changelog_2025-12-01:

2025-12-01
Expand Down
27 changes: 25 additions & 2 deletions hub/dtl/dtl-functions-dictionaries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <namespaces_feature_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 <namespace_features>` 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
| ``{``
Expand All @@ -258,7 +258,7 @@ Dictionaries
| ``"skip_dollar": true,``
| ``"recursive": true``
| ``}``
| and reflects the behaviour of the :ref:`add_namespaces=true <namespaces_feature_add_namespaces>` pipe property.
| and reflects the behaviour of the :ref:`add_namespaces=true <namespace_features>` 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 ``<identity_namespace>:``. The ``skip_underscore`` configdict setting can be set to ``false`` to treat properties starting with ``"_"`` as "normal" properties.
|
Expand All @@ -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 <namespace_features>` 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``
Expand Down
2 changes: 1 addition & 1 deletion hub/features/namespaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed this because the label is for the table containing all namespace features, not just add_namespaces specifically.


.. list-table::
:header-rows: 1
Expand Down