OpenAPITools / OpenAPITools/openapi-generator
[Micronaut server] Add option to restrict generation of controllers to the first tag only for a path entry.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Leveraging release 5.4 ...
Given a yaml input document containing a snippet like the following ...
paths:
/management/api/v1/users/{userId}:
patch:
x-codegen-request-body-name: message
tags:
- Backup Management Service
- Backup Management Service Users
summary: Update the specified user details
description: Update the specified user details
operationId: updateUserAsAdmin
parameters:
- name: userId
in: path
description: User identifier which may be extended format identifier e.g. machine:89928359235
required: true
schema:
type: string
requestBody:
description: Details of user to update
content:
application/json:
schema:
$ref: '#/components/schemas/rest.UserUpdateRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/rest.UserResource'
'401':
$ref: '#/components/responses/401-Unauthorized'
'404':
$ref: '#/components/responses/404-NotFound'
... two controllers are generated containing the same method
BackupManagementServiceController.java
and
BackupManagementServiceUsersController.java
In our use-case, we only want a controller generated for the first tag.
The jax-rs helidon generator for example with useTags=true only leverages the first tag.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Micronaut server generator's handling of the two tags shown in the issue and compare the Helidon JAX-RS generator's useTags behavior. The work is done when an option makes the path generate only BackupManagementServiceController.java, without the duplicate BackupManagementServiceUsersController.java.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100