OpenAPITools / OpenAPITools/openapi-generator

[BUG][Customization] "folder" custom template parameter gets ignored

Open
#11,794 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I use this configuration file to generate additional files for each API in a new "state" sub-directory:

templateDir: openapi-templates
files:
  asd.mustache:
    folder: state
    templateType: API
    destinationFilename: Asd.ts

But I get all the files right in the "api" directory. I also tried using relative path "../state" but it didn't work out.

At the same time, using SupportingFiles type does create custom folders, but it's useless in my case, as I need to create special files for each API: state, slice, sagaes etc.

Also, I couldn't find any formal docs on possible configuration options. There are no any references here: https://openapi-generator.tech/docs/customization/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the customization documentation at https://openapi-generator.tech/docs/customization/ and trace how the YAML files entry is handled for templateType: API. Reproduce the configuration with folder: state, then verify that generated per-API files are placed in the requested subdirectory and document the supported options.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.