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

fix: problem when providing urls with parameters #46

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

Corepex
Copy link
Contributor

@Corepex Corepex commented Mar 22, 2024

This PR obsoletes: #40

Problem

I noticed that the parameters I provide to a request won't get replaced. So /customers/{id} becomes /customers/%7Bid%7D, and the request fails after 3 retries ...

TLDR;
/customers/{id} becomes /customers/%7Bid%7D?id=35467709-efc5-4e87-a09e-f7f2151afd50
instead of /customers/35467709-efc5-4e87-a09e-f7f2151afd50

Fix

I used the request interceptors to replace all placeholders (e.g. {id}) with the corresponding value (from config.params)

Other

Also see this comment: axios/axios#706 (comment)

@Corepex
Copy link
Contributor Author

Corepex commented Mar 22, 2024

I don`t know what the problem here is https://github.com/7nohe/openapi-react-query-codegen/actions/runs/8394740113/job/22992524284?pr=46

@7nohe, any suggestions?

examples/react-app/request.ts Outdated Show resolved Hide resolved
@7nohe 7nohe merged commit 488b693 into 7nohe:main Apr 10, 2024
4 checks passed
@Corepex Corepex deleted the fix_parameter_issue branch April 10, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants