OpenAPITools / OpenAPITools/openapi-generator

[REQ] Generate all components not just those used by services

Open
#2,483 8 comments 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.

We have services in two places that include the same domain objects
We want to generate all the domain objects even if we don't have a service definition that uses them

Describe the solution you'd like

We slit out our service and domain definitions generating all the domain objects not not necessarily all the service definitions
we use the $ref to refer to the definitions in the other file
$ref: 'domain-core.yaml#/components/schemas/DomainObject

we'd like to be able to generate all the domain objects in that other file

Describe alternatives you've considered

We are considering generating a dummy service file that references all objects

Additional context

Our domain objects and services are used in multiple systems we'd like a single source of these domain objects even if they are only used internally by some systems or exposed in a different way to our main services.

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 split-definition setup using the service file and domain-core.yaml, including the $ref to domain-core.yaml#/components/schemas/DomainObject. Trace how generation discovers components and define done as generating every domain object from the referenced file without requiring dummy service references.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, 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.