Create Schema
AI-generatedOverview
This node, named Schema Inferrer, automatically infers a JSON schema from one or multiple input JSON data items. It is useful for scenarios where you need to generate a JSON schema based on sample data, such as validating incoming data, generating documentation, or preparing data for database insertion. For example, you can connect JSON data to the input and execute the node to generate a schema that describes the structure and types of the data fields.
Use Case Examples
- Generating a JSON schema from API response data to validate future responses.
- Creating a schema from user-submitted JSON data to enforce data consistency.
- Inferring a schema to prepare data for insertion into a structured database.
Properties
| Name | Meaning |
|---|---|
| notice | A notice informing the user that the node automatically infers a JSON schema from all input items and instructing to connect data to the input and execute to generate the schema. |
| requiredFieldOptions | Configure which fields should be marked as required in the generated schema, including options to override inferred required fields, specify required fields by name, and control substring and case-insensitive matching. |
| inferenceOptions | Control how the node infers types from the input data, including options to infer maps, enums, date/time, UUIDs, boolean strings, and integer strings. |
| overrideOptions | Override inferred field types using rules, either quick comma-separated rules or advanced rules with field name, match type, and new type. |
| outputFormatting | Control the formatting and structure of the generated schema, including alphabetizing properties, indentation level, and adding leading comments. |
| namingOptions | Control how field names are handled in the generated schema, such as converting all property names to lowercase. |
| minimiseOutput | When enabled, trims non-essential parts of the schema to keep results small for previews. |
| includeDefinitions | Include or omit the schema definitions block for smaller outputs. |
Output
JSON
schema- The generated JSON schema inferred from the input data, reflecting the structure, types, and required fields as configured.
Dependencies
- An optional API key credential for schema inferrer configuration, if used.
Troubleshooting
- If the node fails to infer the schema correctly, check that the input data is valid JSON and consistent in structure.
- Errors about unknown operations indicate a misconfiguration of the operation parameter; ensure it is set to 'create' for schema creation.
- If required fields are not marked as expected, verify the required field options and matching settings (substring and case sensitivity).
- If type inference is incorrect, adjust the inference options or use override rules to specify correct types.