Schema Builder
The Schema Builder component lets you create a structured data schema from plain JSON.
You simply describe what the model should look like, list its fields, give it a name, and the component will output a ready‑to‑use schema and a JSON representation of that schema.
How it Works
When you provide the component with a Model Description, Model Fields, and Model Name, it parses the JSON fields and automatically generates a Python data model (a BaseModel
).
Internally it uses the SchemaBuilderBase
logic to:
- Read the JSON structure you supply.
- Infer field types (string, number, boolean, etc.).
- Build a schema object that can be reused in other parts of your workflow.
- Export the schema as a JSON string for easy sharing or storage.
No external APIs are called; everything happens locally inside the Nappai dashboard.
Inputs
- Model Description: A brief explanation of what the model represents.
- Model Fields: The JSON structure that defines the fields of the model.
- Model Name: The name you want to give to the generated model.
Outputs
- Schema: A
BaseModel
object that represents the data structure. - JSON: A plain text JSON string that contains the schema definition.
Usage Example
- Add the Schema Builder component to your workflow.
- Enter:
- Model Description:
"User profile information"
- Model Fields:
{"id": "integer","name": "string","email": "string","is_active": "boolean"}
- Model Name:
UserProfile
- Model Description:
- Run the workflow.
- The component will output:
- A
BaseModel
calledUserProfile
that you can use in other components. - A JSON string that you can copy, save, or feed into a database schema generator.
- A
Related Components
- JSON Parser – Convert raw JSON into a format the Schema Builder can use.
- Data Validator – Check that incoming data matches the generated schema.
- Schema Exporter – Save the schema to a file or database for later use.
Tips and Best Practices
- Keep the Model Fields JSON simple; avoid nested objects unless you need them.
- Use clear, concise Model Description text so others understand the purpose of the schema.
- If you plan to reuse the schema, give it a stable Model Name that follows your naming conventions.
- After generating a schema, test it with sample data using the Data Validator to catch any type mismatches early.
Security Considerations
- The component processes data locally, so no sensitive information leaves your Nappai instance.
- Be cautious when sharing the generated JSON schema; it may reveal the structure of your data models.
- If the schema includes fields that hold confidential data, restrict access to the component’s outputs in your workflow permissions.