developers

No menu items for this category

Generate Typescript Types From JSON Schema

This step-by-step guide will help you to generate typescript types from JSON schema.

We are using quicktype to generate types from JSON Schema.

Ensure you have quicktype installed. If not, install it using the commands below.

Navigate to the openmetadata-ui directory and install dependencies:

Return to the root folder, add the relevant files to the staging area, and execute the following command:

This command identifies all staged files located in the openmetadata-spec/src/main/resources/json/schema/ path and stores the file paths in the changed_files variable.

From the OpenMetadata root folder, you can generate types for a specific JSON schema file using:

Examples:

Note: The path should be relative to the OpenMetadata directory.

If using Option A, run the following script to generate TypeScript types for the identified JSON schema files:

This script processes the staged JSON schema files and generates the corresponding TypeScript types.

The generated TypeScript types will be available in the appropriate location within the UI project structure.