Give schemaless JSON files a .json extension
-
What you'll see
Code writes a small data file with
docly.saveJson("#/Orders/123/state", data)or a log withdocly.logJson("#/Orders/123/log", entry). The file gets exactly that name. In the Docly file list, indocly dirand ingetFilesit sits next to the schema-bound documents with nothing to show that it is a schemaless JSON file. -
What's actually happening
saveJsonandlogJsonstore the path you give them and add no extension. Schema-bound documents are.doclyfiles, pages are.hash, code is.js— the extension is how people and scripts tell them apart. A schemaless JSON file without.jsonis the one file type that carries no such sign, so it gets mistaken for a document, opened in the wrong tool, or overlooked when a folder is cleaned up.Verified 2026-11-28:
docly.saveJson("#/KBtest/state.json", { Count: 1 })created a file listed asstate.jsonwith no schema, anddocly.getJson("#/KBtest/state.json")read it back. -
What to do
End every schemaless file name with
.json, and read it by the same name:docly.saveJson("#/Orders/" + id + "/state.json", data); var s = docly.getJson("#/Orders/" + id + "/state.json") || {}; docly.logJson("#/Orders/" + id + "/log.json", { Event: "Paid" });First ask whether the file should be schemaless at all. Records belong in schema-bound documents, where they get an editor form — see Keep private data under the # folder and Model a record as a document named by its key. Plain JSON is for what no one edits by hand: logs, caches and settings files such as
#/site.json.Don't:
docly.saveJson("#/Orders/123/state", data)— a file namedstatethat looks like a document.
Last reviewed 28 Nov 2026