Skip to content

Frontend ↔ Backend Type Mismatches #12

@MaximumTrainer

Description

@MaximumTrainer

Gap

Connection Types

Frontend (types/index.ts) Backend (DataConnection.kt) Match?
POSTGRESQL POSTGRESQL
MYSQL ❌ Frontend-only
MARIADB ❌ Frontend-only
MSSQL ❌ Frontend-only
ORACLE ❌ Frontend-only
SQLITE ❌ Frontend-only
MONGODB MONGODB
AZURE_SQL ❌ Backend-only
MONGODB_COSMOS ❌ Backend-only

Selecting a frontend-only type (e.g. MYSQL) causes backend request deserialization/binding to fail (HTTP 400), because the value cannot be mapped to the backend ConnectionType enum.

Generator Types

The frontend defines 16 generator types (e.g. RANDOM_STRING, HASH_SHA256, FAKER) while the backend defines 11 different types (e.g. NAME, SSN, CREDIT_CARD). The two enums are not aligned.

User Roles

Frontend defines ADMIN, USER. Backend model includes an additional VIEWER role in WorkspaceRole. Misalignment can cause issues when rendering workspace user lists.

Affected files:

  • frontend/src/types/index.ts
  • backend/src/main/kotlin/com/opendatamask/model/DataConnection.kt
  • backend/src/main/kotlin/com/opendatamask/model/ColumnGenerator.kt

Required Work

  • Align ConnectionType enums so frontend and backend are identical.
  • Align GeneratorType enums (decide on a single canonical list).
  • Align UserRole / WorkspaceRole enums.
  • Add end-to-end type validation or a shared schema (e.g. OpenAPI spec generation from the backend).

Metadata

Metadata

Labels

priority: highImportant, address soontype: bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions