{
  "slug": "json-normalize",
  "name": "gizza-ai/json-normalize",
  "version": "0.1.0",
  "title": "JSON normalize — nested objects to entity tables — gizza.ai",
  "description": "Normalize deeply nested JSON into id-keyed entity tables plus a result id, using a compact entity schema and deterministic local WASM.",
  "tags": [
    "json",
    "normalize",
    "normalizr",
    "entity table",
    "nested json",
    "redux",
    "schema"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/json-normalize/",
    "markdown": "https://gizza.ai/tools/json-normalize/index.md",
    "descriptor": "https://gizza.ai/tools/json-normalize/tool.json",
    "deep_link_example": "https://gizza.ai/tools/json-normalize/?json=%7B%22id%22%3A%22123%22%2C%22title%22%3A%22My%20first%20post%21%22%2C%22author%22%3A%7B%22id%22%3A%221%22%2C%22name%22%3A%22Paul%22%7D%2C%22comments%22%3A%5B%7B%22id%22%3A%22324%22%2C%22commenter%22%3A%7B%22id%22%3A%222%22%2C%22name%22%3A%22Nicole%22%7D%7D%5D%7D&schema=articles%3A%20author%20-%3E%20users%2C%20comments%20-%3E%20%5Bcomments%5D%0Acomments%3A%20commenter%20-%3E%20users%0Ausers%3A&root=articles&path=data.items&id_field=id%2C_id%2Cuuid&on_missing_id=error&on_conflict=merge&output=normalized&pretty=true&indent=2"
  },
  "cli": "gizza tool json-normalize '{\"id\":\"123\",\"title\":\"My first post!\",\"author\":{\"id\":\"1\",\"name\":\"Paul\"},\"comments\":[{\"id\":\"324\",\"commenter\":{\"id\":\"2\",\"name\":\"Nicole\"}}]}' 'schema=articles: author -> users, comments -> [comments]\ncomments: commenter -> users\nusers:' 'root=articles'",
  "tool": {
    "description": "Normalize a nested JSON document into the normalizr-style {entities,result} shape used by front-end stores and ETL code. Provide an entity schema that names each table and the fields that point at nested entities; the tool extracts those nested objects into entities.<type>.<id> and replaces each occurrence with its id. The schema accepts either a JSON object form ({\"articles\":{\"author\":\"users\",\"comments\":[\"comments\"]},\"users\":{}}) or shorthand lines (articles: author -> users, comments -> [comments]). root names the entity represented by the document or by each item at path; path can point into wrappers such as data.items. id_field defaults to id but can be a fallback list or per-entity JSON map. Duplicate ids can merge, replace, keep first, or error. Missing ids can error, synthesize index ids, content-hash ids, or stay inline. Output can be {entities,result}, entities only, result only, or a report. Pure local Rust/WASM; no eval callbacks, no network, no denormalize step.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "id_field": {
          "default": "id",
          "description": "Entity id field. Use one field name (id), a fallback list (id,_id,uuid), or a JSON object mapping entity names to fields, with * as a default: {\"*\":\"id\",\"tweets\":\"id_str\"}. Ids must be scalar JSON strings, numbers, or booleans.",
          "type": "string"
        },
        "indent": {
          "default": 2.0,
          "description": "Spaces per indent level when pretty is true, from 0 through 8. Values above 8 are clamped to keep browser output readable.",
          "maximum": 8,
          "minimum": 0,
          "type": "integer"
        },
        "json": {
          "description": "The JSON document to normalize. It may be one entity object, an array of entity objects, or a wrapper object when path points at the payload. Decoded input is capped at 5 MB and nesting is capped at 100 levels.",
          "type": "string"
        },
        "on_conflict": {
          "default": "merge",
          "description": "How duplicate ids in the same table are handled. merge (default) shallowly merges with later keys winning; replace keeps the last entity; keep_first keeps the first; error rejects the document.",
          "enum": [
            "merge",
            "replace",
            "keep_first",
            "error"
          ],
          "type": "string"
        },
        "on_missing_id": {
          "default": "error",
          "description": "What to do when an entity object lacks its id field. error (default) stops; index creates stable run-local ids like users-1; hash creates a content hash; keep leaves that nested object inline instead of extracting it.",
          "enum": [
            "error",
            "index",
            "hash",
            "keep"
          ],
          "type": "string"
        },
        "output": {
          "default": "normalized",
          "description": "Output shape. normalized returns {entities,result}; entities returns only lookup tables; result returns only the root id/id array; report returns a human-readable count summary for debugging schemas.",
          "enum": [
            "normalized",
            "entities",
            "result",
            "report"
          ],
          "type": "string"
        },
        "path": {
          "description": "Optional dotted/indexed path to the payload inside a wrapper document, for example data.items or data.0.attributes. Leave empty to normalize the whole document.",
          "type": "string"
        },
        "pretty": {
          "default": true,
          "description": "Pretty-print JSON output. Turn off for compact exact JSON; report output is always plain text.",
          "type": "boolean"
        },
        "root": {
          "description": "The schema entity represented by the document or by each item at path, such as articles, comments, or users. It must be declared in schema.",
          "type": "string"
        },
        "schema": {
          "description": "Entity schema. JSON form maps entity names to relation fields, e.g. {\"articles\":{\"author\":\"users\",\"comments\":[\"comments\"]},\"users\":{}}. Shorthand form is one line per entity: articles: author -> users, comments -> [comments]. Undefined fields are copied through unchanged.",
          "type": "string"
        }
      },
      "required": [
        "json",
        "schema",
        "root"
      ],
      "type": "object"
    }
  }
}