@_with_element
def json(self, element, body):
    "Display object or string as a pretty-printed JSON string.\n\n        Parameters\n        ----------\n        body : Object or str\n            The object to print as JSON. All referenced objects should be\n            serializable to JSON as well. If object is a string, we assume it\n            contains serialized JSON.\n\n        Example\n        -------\n        >>> st.json({\n        ...     'foo': 'bar',\n        ...     'baz': 'boz',\n        ...     'stuff': [\n        ...         'stuff 1',\n        ...         'stuff 2',\n        ...         'stuff 3',\n        ...         'stuff 5',\n        ...     ],\n        ... })\n\n        .. output::\n           https://share.streamlit.io/0.25.0-2JkNY/index.html?id=CTFkMQd89hw3yZbZ4AUymS\n           height: 280px\n\n        "
    import streamlit as st
    if (not isinstance(body, str)):
        try:
            body = json.dumps(body, default=(lambda o: str(type(o))))
        except TypeError as err:
            st.warning(('Warning: this data structure was not fully serializable as JSON due to one or more unexpected keys.  (Error was: %s)' % err))
            body = json.dumps(body, skipkeys=True, default=(lambda o: str(type(o))))
    element.json.body = body
Display object or string as a pretty-printed JSON string.

Parameters
----------
body : Object or str
    The object to print as JSON. All referenced objects should be
    serializable to JSON as well. If object is a string, we assume it
    contains serialized JSON.

Example
-------
>>> st.json({
...     'foo': 'bar',
...     'baz': 'boz',
...     'stuff': [
...         'stuff 1',
...         'stuff 2',
...         'stuff 3',
...         'stuff 5',
...     ],
... })

.. output::
   https://share.streamlit.io/0.25.0-2JkNY/index.html?id=CTFkMQd89hw3yZbZ4AUymS
   height: 280px
@_with_element
def json(self, element, body):
    "Display object or string as a pretty-printed JSON string.\n\n        Parameters\n        ----------\n        body : Object or str\n            The object to print as JSON. All referenced objects should be\n            serializable to JSON as well. If object is a string, we assume it\n            contains serialized JSON.\n\n        Example\n        -------\n        >>> st.json({\n        ...     'foo': 'bar',\n        ...     'baz': 'boz',\n        ...     'stuff': [\n        ...         'stuff 1',\n        ...         'stuff 2',\n        ...         'stuff 3',\n        ...         'stuff 5',\n        ...     ],\n        ... })\n\n        .. output::\n           https://share.streamlit.io/0.25.0-2JkNY/index.html?id=CTFkMQd89hw3yZbZ4AUymS\n           height: 280px\n\n        "
    import streamlit as st
    if (not isinstance(body, str)):
        try:
            body = json.dumps(body, default=(lambda o: str(type(o))))
        except TypeError as err:
            st.warning(('Warning: this data structure was not fully serializable as JSON due to one or more unexpected keys.  (Error was: %s)' % err))
            body = json.dumps(body, skipkeys=True, default=(lambda o: str(type(o))))
    element.json.body = body