olchas commented on a change in pull request #11061:
URL: https://github.com/apache/airflow/pull/11061#discussion_r492583493



##########
File path: docs/howto/custom-operator.rst
##########
@@ -200,6 +200,35 @@ with actual value. Note that Jinja substitutes the 
operator attributes and not t
 
 In the example, the ``template_fields`` should be ``['guest_name']`` and not  
``['name']``
 
+Additionally you may provide ``template_fields_renderers`` dictionary which 
defines in what style the value
+from template field renders in Web UI. For example:
+
+.. code-block:: python
+
+        class MyRequestOperator(BaseOperator):
+            template_fields = ['request_body']
+            template_fields_renderers = {'request_body': 'json'}
+
+            @apply_defaults
+            def __init__(
+                    self,
+                    request_body: str,
+                    **kwargs) -> None:
+                super().__init__(**kwargs)
+                self.request_body = name

Review comment:
       ```suggestion
                   self.request_body = request_body
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to