Redocly/redocly-cli

Path containing # breaks path resolution

avanbremen opened this issue ยท 6 comments

Describe the bug

When the $ref contains # I receive: Can't resolve $ref: ENOENT: no such file or directory.

Similar to issue #1392.

Most likely due to change in ref-utils.ts.

Tested with release @redocly/cli@1.9.0.

To Reproduce

For example:

openapi.yml

openapi: 3.1.0

info:
  title: My API
  version: 1.0.0
  description:
    $ref: './info#description.md'

info#description.md

# Description

Redocly is awesome.

Expected behavior

Success.

Logs

Can't resolve $ref: ENOENT: no such file or directory '/home/runner/work/openapi-specification/openapi-specification/src/v1/info'

OpenAPI description

Redocly Version(s)

1.9.0

Additional context

Similar to issue #1392.

GitHub Actions runner version: 2.313.0.

This downstream issue is also related to the change to ref-utils.ts
openapi-ts/openapi-typescript#1542 (comment)

Thanks for letting us know. Taking a look.

Hey guys. Prepared a fix. Feel free to leave your comments: #1445.

@avanbremen, @jaredLunde could you confirm the issue got resolved in v1.9.1?

@tatomyr this fixed the issue for me ๐Ÿ˜„ thank you!

@tatomyr tested with latest (1.10.1), the issue is now solved. Thanks!