openapi-typescript
openapi-typescript copied to clipboard
feat: fixed typescript error dynamic paths
Changes
Openapi-typescript creates an faulty file when using --path-params-as-types to generate types when nested path parameters exists.
This is particularly annoying when used with a Restful CRUD like :
- /users
- /users/{userId} ...
How to Review
How can a reviewer review your changes? What should be kept in mind for this review?
Checklist
- [ x] Unit tests updated
- [ ]
docs/updated (if necessary) - [ ]
pnpm run update:examplesrun (only applicable for openapi-typescript)
Deploy Preview for openapi-ts ready!
| Name | Link |
|---|---|
| Latest commit | abbea8cea748b4bfbcf3418b2b4e976587d97058 |
| Latest deploy log | https://app.netlify.com/projects/openapi-ts/deploys/678eb2cd80b01b000835113e |
| Deploy Preview | https://deploy-preview-2106--openapi-ts.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
⚠️ No Changeset found
Latest commit: abbea8cea748b4bfbcf3418b2b4e976587d97058
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Hello, I drafted the PR because I thought there was a bug in my solution.
Finally I came across this observation, when you use a path that has a static part after the dynamic part, you have to add a / to make the typing work.
I don't know if that's likely to cause a problem, in my case it's fine, but I don't want to speak for other people.
Here's some example of what i am talking about :
without trailing slash:
any other path works fine