JSON Schema Dereference

Dereferences a JSON Schema by resolving all $ref pointers inline

JSON Schema Dereference

AI-generated

Overview

This node dereferences a JSON Schema by resolving all $ref pointers inline. It takes a JSON Schema as input, processes it to replace all references with their actual definitions, and outputs the fully dereferenced schema. This is useful in scenarios where you need a complete, self-contained JSON Schema without external or internal references, such as for validation, documentation, or transformation purposes.

Use Case Examples

  1. Inputting a JSON Schema with $ref pointers to definitions and getting a fully expanded schema with all references replaced by their actual content.
  2. Using the node to prepare JSON Schemas for systems that do not support $ref pointers by providing a dereferenced version.

Properties

Name Meaning
Input Schema The JSON Schema to be dereferenced. It must be a valid JSON Schema object that may contain $ref pointers to definitions or external schemas.

Output

JSON

  • json
    • error - Error message if dereferencing fails for the input item.

Dependencies

  • Uses the '@apidevtools/json-schema-ref-parser' library to perform the dereferencing of JSON Schema references.
  • Requires no special credentials or external API keys.

Troubleshooting

  • If the input JSON Schema is invalid or contains circular references that cannot be resolved, the node will throw an error.
  • Common error messages include JSON parsing errors or dereferencing errors indicating unresolved or circular $ref pointers.
  • To resolve errors, ensure the input schema is valid JSON and that all $ref pointers are correct and resolvable.
  • The node supports a 'continue on fail' mode to allow processing of multiple items even if some fail.

Links

Discussion