Prism generates code in wrong directory based on stack name instead of backend_path

Resolved 💬 2 comments Opened Jan 27, 2026 by Lasse-numerous Closed Jan 27, 2026

Description

When running prism generate with a prism.config.py that specifies:

config = PrismConfig(
    spec_path="specs/models.py",
    backend_path="packages/backend/src/prisme_api",  # <-- expected output directory
    ...
)

And a spec with:

spec = StackSpec(
    name="madewithprisme",  # <-- stack name
    ...
)

The code is generated into packages/backend/src/madewithprisme/ instead of packages/backend/src/prisme_api/.

Expected behavior

The generator should respect the backend_path configuration and generate files into prisme_api/, not create a new directory based on the stack name.

Actual behavior

Code is generated into a new directory madewithprisme/ which:

  1. Doesn't match the existing package structure
  2. Has imports referencing madewithprisme instead of prisme_api
  3. Creates duplicate code that needs manual consolidation

Environment

  • prism version: 0.12.0
  • OS: Linux (WSL2)

Workaround

Manually copy files from the generated directory and update imports.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗