{"templateId":"markdown","versions":[{"version":"v1","label":"1.x (archive)","link":"/docs/cli/v1/commands/inspect-node-types","default":false,"active":false,"folderId":"6f4800fc"},{"version":"v2","label":"2.x (current)","link":"/docs/cli/commands/inspect-node-types","default":true,"active":true,"folderId":"6f4800fc"}],"sharedDataIds":{"sidebar":"sidebar-docs-cli.sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Redocly CLI","type":"markdown"},"seo":{"title":"inspect-node-types","description":"OpenAPI-generated documentation tool with 24k+ stars on Github - make APIs your company's superpower.","siteUrl":"https://redocly.com","image":"/assets/redocly-card.f670aae34a39545a5ea633a540cb3a4a333a1f23bb2ed3c4a1b17a5fbcf0ac85.db81178d.png","lang":"en-US"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"inspect-node-types","__idx":0},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["inspect-node-types"]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Experimental"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["inspect-node-types"]}," is an experimental feature."," ","Its flags and output can change in any minor release until the feature is stable."," ","Send us your feedback while we stabilize the feature."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"introduction","__idx":1},"children":["Introduction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["inspect-node-types"]}," command shows the node type that Redocly CLI assigns to each place in an API description."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Node types are the vocabulary of ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/rules/configurable-rules"},"children":["configurable rules"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/custom-plugins"},"children":["custom plugins"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["a configurable rule targets a node type in its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["a plugin rule declares a visitor for a node type"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["inspect-node-types"]}," to find the right type name for the part of your description you want to check."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A node has a type only because of the path the linter took to reach it, so the command always walks the whole description from its root."," ","Nodes in referenced files appear at their own pointers, in their own files."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"usage","__idx":2},"children":["Usage"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types <api> [--config=<path>]                  # list every node\nredocly inspect-node-types <api> --pointer=<pointer> [--parents]    # ask about one location\nredocly inspect-node-types <api> --type=<type> [--parents]          # ask about one type\nredocly inspect-node-types <api> --summary                          # count the types used\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The command answers one question at a time, so ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pointer"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--summary"]}," are mutually exclusive."," ","Passing two questions fails with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Arguments pointer and type are mutually exclusive"]},"."," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--parents"]}," is not a question of its own."," ","It changes the answer that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pointer"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type"]}," gives, and on its own it fails with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["The --parents option requires --pointer or --type"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options","__idx":3},"children":["Options"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["api"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["REQUIRED."]}," Path to the root API description filename or alias. The whole description is walked from this file."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--config"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify path to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/configuration"},"children":["configuration file"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--help"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Display help."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--lint-config"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify the severity level for the configuration file. ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible values:"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["warn"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["off"]},". Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["warn"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--parents"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Modifies ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pointer"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type"]},": display the chain of node types leading to the node, or the distinct chains that reach the type. Requires one of them."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--pointer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Look up a single node instead of listing all of them. A JSON pointer, optionally prefixed with a file: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["#/paths"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paths/orders.yaml#/get"]},". Not with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--summary"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--summary"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List the node types used in the description, with the number of nodes of each type. Not with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pointer"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List only the nodes of the given type, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type=Schema"]},". Not with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pointer"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--summary"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--version"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Display version number."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":4},"children":["Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"list-every-node","__idx":5},"children":["List every node"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pointer"]},", the command prints every node in the description, with its type first:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types cafe.yaml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Root           cafe.yaml#/\nInfo           cafe.yaml#/info\nContact        cafe.yaml#/info/contact\nPaths          cafe.yaml#/paths\nPathItem       cafe.yaml#/paths/~1orders → paths/orders.yaml\nPathItem       paths/orders.yaml#/\nOperation      paths/orders.yaml#/get\nParameterList  paths/orders.yaml#/get/parameters\nParameter      paths/orders.yaml#/get/parameters/0 → components/parameters/Filter.yaml\nParameter      components/parameters/Filter.yaml#/\nSchema         components/parameters/Filter.yaml#/schema\nWebhooksMap    cafe.yaml#/webhooks\nPathItem       cafe.yaml#/webhooks/orderCreated → paths/orders.yaml\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$ref"]}," site shows the pointer it resolves to after the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["→"]}," arrow."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"list-the-nodes-of-one-type","__idx":6},"children":["List the nodes of one type"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type"]}," to see every place one type appears:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types cafe.yaml --type=Schema\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Schema  components/parameters/Filter.yaml#/schema\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"summarize-the-types","__idx":7},"children":["Summarize the types"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--summary"]}," to see which node types the description uses, with the number of nodes of each:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types cafe.yaml --summary\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Contact        1\nInfo           1\nOperation      1\nParameter      1\nParameterList  1\nPathItem       1\nPaths          1\nRoot           1\nSchema         1\nWebhooksMap    1\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$ref"]}," site is a pointer to a node, not a node of its own."," ","The count is the number of nodes the linter visits."," ","The list above shows three ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PathItem"]}," lines: two ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$ref"]}," sites and the one path item they both reach."," ","The summary counts that path item once."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"look-up-one-node","__idx":8},"children":["Look up one node"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pass a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://datatracker.ietf.org/doc/html/rfc6901"},"children":["JSON pointer"]}," to get a single type."," ","Remember that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/"]}," inside a path or property name is escaped as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["~1"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types cafe.yaml --pointer='#/paths/~1orders'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"PathItem\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$ref"]}," and the node it resolves to are the same type, so pointing at either one works."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the pointer doesn't match a node, the command reports the closest node on that path and suggests its children — pointing at a plain field, like ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["#/info/title"]},", names the node that holds it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"see-the-chain-from-the-root-to-a-node","__idx":9},"children":["See the chain from the root to a node"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--parents"]}," to a pointer lookup to get every level above the node."," ","The chain is the vocabulary of a configurable rule's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["where"]}," list, which names ancestors from the root down:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types cafe.yaml --pointer='components/parameters/Filter.yaml#/schema' --parents\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Root → Paths → PathItem → Operation → ParameterList → Parameter → Schema\nRoot → WebhooksMap → PathItem → Operation → ParameterList → Parameter → Schema\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A node reached through more than one ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$ref"]}," can sit under more than one chain, and the command prints one line per chain."," ","Routes that pass through the same types collapse into a single line."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"see-every-way-to-reach-a-type","__idx":10},"children":["See every way to reach a type"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--parents"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--type"]}," to get the distinct chains that lead to that type, each ending at the type itself:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types cafe.yaml --type=PathItem --parents\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Root → Paths → PathItem\nRoot → WebhooksMap → PathItem\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Inspect this before you write a rule for a type: it shows which places a rule targeting that type reaches."," ","This way, you can add a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["where"]}," gate for the ones you mean and exclude the rest."," ","In this example a rule about the shape of a URL path needs a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Paths"]}," gate, because the same type also holds webhook names."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The command reports what this description contains, not everything the specification allows."," ","A description with no webhooks shows no webhook chain."," ","Check a description that exercises the areas you care about."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"look-up-a-node-in-a-referenced-file","__idx":11},"children":["Look up a node in a referenced file"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Prefix the pointer with the file, relative to the directory you run the command from."," ","The API argument stays the root of the description:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly inspect-node-types cafe.yaml --pointer='paths/orders.yaml#/get/parameters/0'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Parameter\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the file is not referenced from the root, the command reports that it found nothing and exits with a non-zero code."]}]},"headings":[{"value":"inspect-node-types","id":"inspect-node-types","depth":1},{"value":"Introduction","id":"introduction","depth":2},{"value":"Usage","id":"usage","depth":2},{"value":"Options","id":"options","depth":2},{"value":"Examples","id":"examples","depth":2},{"value":"List every node","id":"list-every-node","depth":3},{"value":"List the nodes of one type","id":"list-the-nodes-of-one-type","depth":3},{"value":"Summarize the types","id":"summarize-the-types","depth":3},{"value":"Look up one node","id":"look-up-one-node","depth":3},{"value":"See the chain from the root to a node","id":"see-the-chain-from-the-root-to-a-node","depth":3},{"value":"See every way to reach a type","id":"see-every-way-to-reach-a-type","depth":3},{"value":"Look up a node in a referenced file","id":"look-up-a-node-in-a-referenced-file","depth":3}],"frontmatter":{"seo":{"title":"inspect-node-types"}},"lastModified":"2026-09-08T11:53:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/cli/commands/inspect-node-types","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}