Skip to content

resource schematic options (--type, --crud) trigger "unknown option" error despite being defined in schema #3229

@RYGRIT

Description

@RYGRIT

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The CLI throws an error and stops execution: error: unknown option '--type'

Minimum reproduction code

N/A (CLI command issue)

Steps to reproduce

Run the following command:

nest g resource my-res --type rest --crud true

Expected behavior

The CLI should accept --type and --crud flags and generate the files silently, bypassing the interactive prompts.

Package version

PNPM Version: 10.13.1

NestJS version

11.1.10

Node.js version

v22.20.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

I inspected node_modules/@nestjs/schematics/dist/lib/resource/schema.json and confirmed that both type and crud properties are explicitly defined in the schema definition.

It seems the CLI is not correctly dynamically mapping these schematic-specific options for the resource command, causing the strict argument parser to reject them before the schematic runs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions