def as_json(self, force_object=True, name=None):
func = streamsx.topology.runtime._json_force_object if force_object else None<EOL>saj = self._change_schema(streamsx.topology.schema.CommonSchema.Json, '<STR_LIT>', name, func)._layout('<STR_LIT>')<EOL>saj.oport.operator.sl = _SourceLocation(_source_info(), '<STR_LIT>')<EOL>return saj<EOL>
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.