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

--make-paths-enum renames the paths URL #2101

Open
2 tasks done
semanser opened this issue Jan 13, 2025 · 2 comments · May be fixed by #2152 or #2153
Open
2 tasks done

--make-paths-enum renames the paths URL #2101

semanser opened this issue Jan 13, 2025 · 2 comments · May be fixed by #2152 or #2153
Assignees
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@semanser
Copy link

openapi-typescript version

7.5.2

Node.js version

20.12.1

OS + version

macOS 15.1.1

Description

This is basically exactly the same issue as described here #950. It seems like the bug was added back here #2052 when implementing this feature again for the v7.

In short, the ApiPaths urls are getting renamed like so /persons/{id} -> /persons/:id, which shouldn't happen.

The line that needs to be fixed is this:

// Replace {parameters} with :parameters
const adaptedUrl = url.replace(/{(\w+)}/g, ":$1");

See this PR #951 on how it was fixed before.

Let me know if you want me to open the PR. Thanks!

Reproduction

See this PR #950

Expected result

Ths URLs in both paths and ApiPaths should be identical.

Required

  • My OpenAPI schema is valid and passes the Redocly validator (npx @redocly/cli@latest lint)

Extra

@semanser semanser added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Jan 13, 2025
@drwpow
Copy link
Contributor

drwpow commented Jan 25, 2025

Great investigative work! Yes would love a PR for this, thank you 🙏

@drwpow drwpow self-assigned this Jan 25, 2025
@insertmike
Copy link

Is there any updates here? @drwpow @semanser , this is pretty much blocking me

insertmike added a commit to insertmike/openapi-typescript that referenced this issue Feb 13, 2025
@semanser semanser linked a pull request Feb 13, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
3 participants