docs: def as_json(self, force_object=True, name=None):
          """
          Declares a stream converting each tuple on this stream into
          a JSON value.
  
          The stream is typed as a :py:const:`JSON stream <streamsx.topology.schema.CommonSchema.Json>`.
  
          Each tuple must be supported by `JSONEncoder`.
  
          If `force_object` is `True` then each tuple that not a `dict` 
          will be converted to a JSON object with a single key `payload`
          containing the tuple. Thus each object on the stream will
          be a JSON object.
  
          If `force_object` is `False` then each tuple is converted to
          a JSON value directly using `json` package.
  
          If this stream is already typed as a JSON stream then it will
          be returned (with no additional processing against it and
          `force_object` and `name` are ignored).
  
          Args:
              force_object(bool): Force conversion of non dicts to JSON objects.
              name(str): Name of the resulting stream.
                  When `None` defaults to a generated name.
  
          .. versionadded:: 1.6.1
  
          Returns:
              Stream: Stream containing the JSON representations of tuples on this stream.
  
          """
          func = streamsx.topology.runtime._json_force_object if force_object else None
          saj = self._change_schema(streamsx.topology.schema.CommonSchema.Json, 'as_json', name, func)._layout('AsJson')
          saj.oport.operator.sl = _SourceLocation(_source_info(), 'as_json')
          return saj