josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
820 stars 108 forks source link

Accept POST request for larger JSON #242

Closed black-inc-service closed 1 year ago

black-inc-service commented 1 year ago

For the online formatter it can accept JSON in the URL query as shown in the documentation https://jsoneditoronline.org/#left=json.ENCODED_JSON_CONTENTS&right=json.ENCODED_JSON_CONTENT This has a limitation of only small JSON objects due to the max URL size. Is it possible to implement a POST method where you can add left and right as part of the body to format larger JSON?

josdejong commented 1 year ago

There is indeed a limitation in how long a URL can be to be safe. I think you can upload your document somewhere (anywhere), and then pass the URL to JSON Editor Online:

https://jsoneditoronline.org/#left=url.ENCODED_URL_HERE&right=url.ENCODED_URL_HERE

Docs: https://jsoneditoronline.org/docs/index.html#url

Would that work for your case?

black-inc-service commented 1 year ago

I found a site: https://ctxt.io/ that can create a link of text to share but is difficut to do this progamaticlly, I could not find any site that offers a free API to upload text.

josdejong commented 1 year ago

Maybe something like https://keyvalue.immanuel.co/? Found that when googling for "online key value store".

black-inc-service commented 1 year ago

Good find, I think this could work.