OpenAPITools / OpenAPITools/openapi-generator

[ASPNETCORE] multiple tags for a method generates multiple controllers

Open
#2,844 6 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

General: Discussion
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

Multiple tags create multiple server endpoints

openapi-generator version

4.0.0-beta3

OpenAPI declaration file content or url

This is more a query (is there not a ML/community for this sort of thing?).

I've declared tags in the OpenAPI specification, to thematically collect API calls around various use-cases.

Thus API methods may have several tags. This is very useful in documentation generation.

But when aspnetcore generation occurs, you get a controller per tag - which doesn't seem right at all - not least of which the URL is identical in both.

There seems to be an assumption that a method has only one tag (maybe?) for the server end.

There doesn't seem to be a nice way to split up big APIs in OpenAPI that works nicely. Unless I'm missing something..

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 reproducing the issue with the ASP.NET Core generator and an OpenAPI declaration where one operation has multiple tags. Inspect the generated controllers and compare their identical URLs; done should mean the generator's handling of multi-tag operations matches the intended server behavior, with coverage for the reproduced case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.