Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIME encoded json gives unexpected result #387

Closed
andrewhamon opened this issue Nov 12, 2022 · 1 comment
Closed

MIME encoded json gives unexpected result #387

andrewhamon opened this issue Nov 12, 2022 · 1 comment
Labels
bug Installation and functionality issues

Comments

@andrewhamon
Copy link

andrewhamon commented Nov 12, 2022

Baseline: JSON output in python

In a python notebook, I can do the following:

from IPython.display import JSON


JSON({'a': [1, 2, 3, 4,], 'b': {'inner1': 'helloworld', 'inner2': 'foobar'}})

image

Which gives a nice interactive, collapsable, searhable display.

Not working as expected: JSON output in kotlin

I tried achieving the same with Kotlin:

val jsonStr = """
{"a": [1, 2, 3, 4], "b": {"inner1": "helloworld", "inner2": "foobar"}}
"""

MIME("application/json" to jsonStr)

image

This is interpreted as JSON value of string, rather than a JSON object (however Jupyter seems to still think it is showing JSON - see the root label and the search box).

Is there a way to properly render a json value with MIME?

@blshao84
Copy link

I have been looking for a solution for exactly the same problem ...

@ileasile ileasile added the bug Installation and functionality issues label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Installation and functionality issues
Projects
None yet
Development

No branches or pull requests

3 participants