Skip to content

How to specify custom enum-data-contract.ejs template? #1521

@ezhylin

Description

@ezhylin

Summary

I'm trying to provide a custom enum template enum-data-contract.ejs in my custom templates folder, but although the generator logs that it finds the enum template in my custom folder, the rendered output still uses the package default. How should I correctly specify a custom enum template so it will actually be used at render time?

What I did

I set templates prop to my templates folder

<project-root>/generate-api.ts snippet ... templates: path.join(process.cwd(), '/templates'), debug: true, ...

My custom file is located at: /templates/enum-data-contract.ejs

Logs (relevant lines)

From the run with debug: true:

[10:52:59 PM] WARN Code generator will use the default template: "api" template not found in "<project-root>\templates" [10:52:59 PM] ℹ "enumdatacontract" template found in <project-root>\templates" [10:52:59 PM] WARN Code generator will use the default template: "routetypes" template not found in "<project-root>\templates" 

Actual behavior

The generator logs that enumdatacontract is found in my custom folder. However the final generated code uses the package's default enum template, not my custom enum-data-contract.ejs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions