OpenAPITools / OpenAPITools/openapi-generator

[REQ] Per Operation Templates

Open
#5,854 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I am trying make an oclif CLI generator. It requires that each operation be in its own file; however, from what I can tell, openapi-generator wants to group operations by tag into APIs all in one file. I see the supporting files get all the operations, but it still doesn't seem like a file can be created for each operation.

Describe the solution you'd like

I'd like to have something like this (similar to apis and models):

operationTemplateFiles.put("operation.mustache", ".zz");

where there's a template file for an operation and it gets called for each operation.

I would also be more than happy to hear simpler solutions to this without requiring changing the framework like this. Any pointers would be appreciated.

Describe alternatives you've considered

I've also reached out to the oclif team to see if it's possible to have more than one operation per file.

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 by tracing the generator's existing API and model template handling, then inspect the operationTemplateFiles configuration described in the issue. Confirm how templates are selected for grouped operations; done means an operation template can be invoked once per operation and produce separate files for generators that need them.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.