I'm digging here around trying to find a solution, how to merge several OpenApi v3 component definitions in one file.
Let's imagine a situation:
blueprint.v1.yaml
).
Usually, I use swagger-cli
to merge all $ref
dependencies, but now it's not a case, because I can not refer to the whole components/schemas object list
swagger-cli bundle
tool.So, the question is - how to reuse already defined component blocks (files called components.v1.yaml) in my blueprint.v1.yaml
file?
P.S. Every components.v1.yaml
looks like this:
And a, for ex, location-create-single.v1.yaml
path definition is shown on picture below. Mention, that all $ref
referes to components.v1.yaml
files.
I don't think there is a "native" OpenAPI solution to your problem. People are discussing for a while about OpenAPI overlays/extends/merges. There is currently (2020-04-24) not any consensus about this topic.
Although you could implement your own tool or use an existing one to preprocess your blueprint.v1.yaml
and generate a "merged OAS".