openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

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

Open msillence opened this issue 5 years ago • 8 comments

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.

msillence avatar Mar 22 '19 14:03 msillence

+1

borsch avatar Mar 31 '20 16:03 borsch

I think this feature request should log in the Swagger Parser repo instead as OpenAPI Generator relies on Swagger Parser to parse the spec at the moment.

wing328 avatar Mar 31 '20 16:03 wing328

@wing328 what exacly swagger parser is used? https://github.com/OpenAPITools/swagger-parser or https://github.com/swagger-api/swagger-parser ?

borsch avatar Mar 31 '20 16:03 borsch

https://github.com/swagger-api/swagger-parser

(We filed some PRs to https://github.com/swagger-api/swagger-parser before and since it took some time to review, we were using https://github.com/OpenAPITools/swagger-parser before those PRs got merged)

wing328 avatar Mar 31 '20 16:03 wing328

+1, would it make sense to provide a config for all other schemas too? Meaning request, response, ... schemas?

ManuelTS avatar Feb 23 '22 06:02 ManuelTS

Any news?

RobertCer avatar Feb 22 '23 09:02 RobertCer

Any update on this?

pontus-eliason avatar Feb 08 '24 13:02 pontus-eliason

also pinging this issue for an update plz && ty

SteveGazzoJr avatar May 15 '24 16:05 SteveGazzoJr