Redocly/create-openapi-repo

Option to split files only where OpenAPI expect references?

mimkorn opened this issue · 4 comments

Hi,

lovely tool, thanks! We were thinking of using it in our company, but we were also considering using Stoplight Studio. However, no tools out there at the moment expect some of the splitting your tool does. Here I mean referring to markdown description files via $ref and those special filenames for paths.

Would it be possible with some flag to do the initial OpenAPI spec split only into files that the OpenAPI spec officially supports, so the repo could then be consumed by some of these editors?

Thanks.

spa5k commented

Were you able to find any way to do it? as splitting is good and all but I can't use Stoplight Studio there

Nope. We decided to use Stoplight Studio. Working with files in Studio wasn't problematic so I even kind of forgot why I wanted to use this in the first place. I was researching tools at the time and hadn't quite had the feel for the flow of how the spec will be written and used on daily basis. Now I think we can work without this.

Here I mean referring to markdown description files via $ref and those special filenames for paths.

The special filenames for paths are just a pattern for convenience. In the previous version of our tool those were used for spcial purposes but now everything is using just $refs. By default the tool splits into spec-compliant OpenAPI (OpenAPI officially supports $ref on path item items.) except for the $ref for info.description I believe.

But you can easily revert info.description manually after you definition is split. We may add some flag though.

This is done (in a separate Redocly CLI split command): https://redocly.com/docs/cli/commands/split/