OpenAPITools / OpenAPITools/openapi-generator

[REQ] Allow a list of paths or operations to be passed for being generated

Open
#12,755 0 comments 7 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 would love to be able to pass one or more path' to be allowed to be generated.
This would actually allow us to partially generate code for dedicated endpoints rather than having a huge API client containing all endpoints.

Describe the solution you'd like

npx @openapitools/openapi-generator-cli generate -i openapi.json -g <PROGRAMMIN LANGUAGE> -o generated/ --include-path "/my/endpoint/{parameter}" --include-path="/my/other-endpoint"

npx @openapitools/openapi-generator-cli generate -i openapi.json -g <PROGRAMMIN LANGUAGE> -o generated/ --include-operation-id=myEndpointOperationId  --include-operation-id=myOtherEndpointOperationId

Describe alternatives you've considered

Additional context

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 generate command shown in the issue and trace how repeated --include-path or --include-operation-id arguments could be handled. Check the OpenAPI generator command-line entry point and related option handling, then verify that generation can produce only the requested paths or operation IDs while retaining required parameters and dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.