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

Issue with column oriented json encoding #218

Open
StianBerger opened this issue Nov 21, 2024 · 0 comments
Open

Issue with column oriented json encoding #218

StianBerger opened this issue Nov 21, 2024 · 0 comments

Comments

@StianBerger
Copy link

I am trying to create a rest app that outputs server side rendered plotly plots.
When i pass the built plot through response object with json content type, it somehow transforms the data in the plotly object to columnar form. (Instead of being an array of objects, it becomes objects of arrays.)
I have scratched my head a lot trying to figure out why this happens, and came across this:

res = jsonlite::toJSON(x, dataframe = 'columns', auto_unbox = unbox, null = 'null', na = 'null')

Could we have a way of configuring the dataframe='columns' parameter?

As of now, I found a workaround by setting custom encoder on the response object - and I can live with that.
I think that this can bite others as well though.

Thanks for a great package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant