Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

root level paths / are not split correctly #1634

Open
LukeHagar opened this issue Jul 16, 2024 · 1 comment · May be fixed by #1638
Open

root level paths / are not split correctly #1634

LukeHagar opened this issue Jul 16, 2024 · 1 comment · May be fixed by #1638
Labels
p3 Type: Bug Something isn't working

Comments

@LukeHagar
Copy link

Describe the bug

When running the redocly split command the openapi path at the API root: / is not properly moved to the paths folder, and the references in the document are not properly converted to file based references.

To Reproduce
Steps to reproduce the behavior:

Minimum repro repo:
https://github.com/LukeHagar/redocly-split-repro

  1. Open the repo
  2. Run make repro
  3. See the file here:
    https://github.com/LukeHagar/redocly-split-repro/blob/main/openapi/paths.yaml

Expected behavior

I would expect this path to be handled like all the others

Redocly Version(s)

1.18.0

Node.js Version(s)

v20.15.0

Additional context

You rock! I love the bundle and split implementations

@LukeHagar LukeHagar added the Type: Bug Something isn't working label Jul 16, 2024
@LukeHagar LukeHagar linked a pull request Jul 18, 2024 that will close this issue
5 tasks
@tatomyr
Copy link
Contributor

tatomyr commented Jul 19, 2024

I confirm this is a bug. The issue is that the tool attempts to create a file named after the path item, and since it's empty (the slash doesn't count here), it fails to resolve it. The solution I propose is to give a default name for the root path. @LukeHagar, what name would you expect here?

NB: A temporary workaround would be to rename the / path item in your OpenAPI file to an arbitrary unique value (e.g., /root), then split it, and then rename it back in the generated files (leaving the file name intact).

@tatomyr tatomyr added the p3 label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants