OpenAPITools / OpenAPITools/openapi-generator

[REQ] aspnetcore Make code generation configurable

Open
#2,101 1 comment 0 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.
  • Trying to get the aspnetcore generator to generate interfaces only. This will be akin to the Java Spring support where we generate the interfaces for the API and let the servers implement the interface. The difficulty is that a lot of irrelevant code is generated and it should be easy to turn it off via the configuration.
  • The goal will be to add in additional configuration parameters to finetune what is generated.

Describe the solution you'd like

Want to have options to fine tune the generation by logical grouping without having to enumerate each possible output for the supporting files. E.g. generateWWWRoot would enable or disable generating the wwwroot directory.

Describe alternatives you've considered

Tried various options for the generator and looking a the generator code I don't think there is control over that.
I have created a fork with the additional option (for the wwwroot directory) and it seems to to the job. Happy to submit the change as a PR

Additional context

Looking to extend this further to generate pure interfaces and models and at that point I see leveraging these options (some being set automatically based on the choice of generating an interface).

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 reading the aspnetcore generator code and the fork mentioned in the issue, focusing on the existing wwwroot generation path. Compare the proposed configuration option with the Java Spring interface-generation support. Done should provide documented logical configuration controls for generated output, including the requested interface and model use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.