Storing JSON and XML
I have some configuration files in JSON and XML that I store in 1Password using the 'Secure Note' type. Copy/Paste does not work well without clicking Edit, as the line breaks are not displayed properly in the non-Edit view.
I was hoping JSON and XML would be a supported 'type', with a better UI for viewing, editing, and copying/pasting.
Not sure what I'm looking for in starting this discussion, but maybe others do the same and know of a feature request that's already been submitted, has alternative options, etc.
1Password Version: 8.10.23
Extension Version: Not Provided
OS Version: Windows 10
Browser: Not Provided
Comments
-
Hi there @friedrickjo
Are you enclosing the JSON/XML in a Markdown code block? If you haven't already, try adding three backticks (the ` character) on a line before and after the text, like this:
Then, when viewing the item, it'll look like this:
Give that a go and let me know how you find it. Alternatively, you may want to save that JSON or XML into a .txt file and attach it to the item instead.
Please let me know if you have any questions, or would like any further help. :)
— Grey
0 -
Hi @GreyM1P,
Thanks for the response and idea. It looks like the markdown for 'code' doesn't like some XML and the formatting doesn't get applied, looks like due to the first question mark in the first line, for example <?xml version="1.0" encoding="utf-8"?>. When it did work, both JSON and XML appeared as a giant text block with no formatting.
However, it did get me looking at the markdown page and I tried the preformatted text option (```) which worked well with XML and JSON, which displays better with indentations and line breaks.
Thanks for the idea! It seems like remembering/documenting to use ``` markdown on new entries and full content updates is a more favorable option than remembering to 'Edit then copy' when needing to grab one of them to use.
Attaching files is just not as convenient. Lots of clicking, less visibility into the content at a glance, etc.
I guess I was hoping native support for these formats was available and I was just missing something obvious... but thanks again for the tip, I think this will help for now.0 -
You're welcome! That preformatted code block is super handy for things like this. I have a blob of JSON I use for work in one of our systems, and that's how I store it too. Glad to hear it's helped you as well.
0