Skip to content

The "generate-templates" command is broken. #1228

Closed
@sadkebab

Description

@sadkebab

Issue

When you run a command like swagger-typescript-api generate-templates --output ./templates the console will output this:

> swagger-typescript-api generate-templates --output ./templates

Generate ".ejs" templates needed for generate api (swagger-typescript-api generate-templates v13.1.3)                                                                                                5:33:27 PM

USAGE swagger-typescript-api generate-templates [OPTIONS] -o, --output

OPTIONS

           --clean-output    clean output folder before generate template. WARNING: May cause data loss             
                  --debug    additional information about processes inside this tool                                
    --http-client="fetch"    http client type (possible values: fetch,axios)                                        
                --modular    generate templates needed to separate files for http client, data contracts, and routes
  -o, --output (required)    output path of generated templates                                                     
            -r, --rewrite    rewrite content in existing templates                                                  
                 --silent    Output only errors to console                                                          



ERROR  Missing required argument: --path 

But path is not an argument for generate-templates.

If you add path pointing to a swagger json file the content inside the generated templates folder will include Api.ts too.

The problem

I guess when you set the run and args in a root defineCommand from citty they will be always validated and executed. If I comment these two props in the cli.js file I find in my node_modules it works properly.

Source of the bug:

1cb1c9c

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions