web / lib/jobs/handlers/validate-schema-job
lib/jobs/handlers/validate-schema-job
Defines the job handler for validating the detected schema against the dataset’s existing schema.
This job is responsible for schema validation and determining the next processing stage. Its main tasks are:
- Finalizing the schema detection using the cached state from the schema detection stage.
- Comparing the newly detected schema with the current schema version of the target dataset.
- Identifying breaking changes (e.g., type changes, removed fields) and non-breaking changes (e.g., new optional fields).
- Determining whether the changes can be automatically approved based on the dataset’s configuration.
Next stage routing:
- If changes require manual approval →
AWAIT_APPROVALstage - If changes are auto-approved →
CREATE_SCHEMA_VERSIONstage - If no schema changes →
GEOCODE_BATCHstage
Variables
validateSchemaJob
constvalidateSchemaJob:object
Type declaration
slug
slug:
"validate-schema"=JOB_TYPES.VALIDATE_SCHEMA
handler()
handler: (
context) =>Promise<{output: {requiresApproval:boolean;hasBreakingChanges:boolean;newFields:number; }; }>
Parameters
context
Returns
Promise<{ output: { requiresApproval: boolean; hasBreakingChanges: boolean; newFields: number; }; }>
Last updated on