redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

Allow specifying an overwrite conflict strategy for the `join` command

Open Carbonhell opened this issue 7 months ago • 1 comments

Is your feature request related to a problem? Please describe.

Hi, thank you for this amazing project! I'm using the join command to merge together the OpenAPI schemas of several AWS lambda based microservices implemented with FastAPI automatically, with a GitHub action. My problem is that I have shared component models and security scheme. Those are equal across the various microservices. For this reason, I'd assume there would be a way to resolve conflicts by merging/unifying the repeated schemas into a single one per conflict. From what I can see, I have to either edit the generated schema manually, ~~or use custom decorators which I am still investigating~~.

Describe the solution you'd like A simple flag to specify conflict resolution by merging schemas together, or perhaps marking one of the input files to use when deciding how to resolve a conflict.

Describe alternatives you've considered Manually editing the resulting schema, but this weakens the value of the join command. ~~Custom decorators look like a viable alternative, but I believe it makes sense for users to decide a conflict resolution strategy.~~ if I understood correctly, decorators are for Redocly (SaaS), not cot Redoc/simple CLI usage

Additional context

I can try implementing this myself if others think this might be a valuable feature to have :)

Carbonhell avatar Jul 11 '24 17:07 Carbonhell