redocly-cli
redocly-cli copied to clipboard
Bundling is not importing tags data used in referenced schema
When bundling spec file and there are paths imported
paths:
/entities:
$ref: 'entities.yaml#/paths/~1entities'
Then tags section is not updated with tags data used in imported path scheme, but used Schemas are imported.
So tags section should also be imported from source file. Tag naming conflict should be solved same way as schema objects.
Hi @indrek-sixfold, could you provide an example that illustrates the desired solution? What's the use case of importing one API description from another? Have you considered any alternatives (like using join command or a decorator)?
I have an API where endpoints are grouped by business domains. For example one definition file contains /users/... endpoints, other file /companies/... and both have defined tags descriptions in their file. If I bundle this API into single then tag definitions are not bundled. Or vice versa, if I extract for example /users/... part of API into separate definition file.
Don't ask why, but world of business requirements is colorful.
I think I still don't fully grasp what you are trying to achieve 🙂. If you want to combine several API descriptions onto a single one, you probably should use the join command instead of bundle (see the docs).
I want to extract a part from a big single API definition file.
If I've understood this correctly, you want to combine multiple independent OpenAPI descriptions into one? Bundle will resolve all of a single OpenAPI description, but if you want to combine them to become one merged description then you should use the join command (docs: https://redocly.com/docs/cli/commands/join/). Could you please give that a try and see if that does more what you expected?
No. I have yaml that imports paths from multiple files. If I bundle this file then paths and schemas are nicely present in bundle but tags section is not.
Can you share an example with us? The bundle command takes an OpenAPI and resolves references into a single file, so that you can pass a one-file OpenAPI description to tools that don't support references across files. If the tags aren't defined in the OpenAPI description, bundle can't include them, because they aren't supplied.