-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Missing optional params after updating to 10.9.3+ #514
Comments
path parameters can't be optional, that's why you get this error. before that we did not force it. |
Is there a workaround ? The rest api I use have optional path parameters (yes I know...) |
Here you where lying to zodios by saying it was optional and hacked into injecting it with a plugin, i could allow undefined back. But hear me just a second. API keys should not leak in the URL, for the reason that URL are usually logged in reverse proxies like nginx etc, it's a security issue and bad practice. I encourage you to change the design of your API, but if it's not doable, i'll add support for optional path parameters |
It's even worse that you think, the API key is sent with http but I can't control it and it's on a local network so it's almost "secure" https://www.sitebase.be/generate-phillips-hue-api-token/ I can't control the API I use so I have no choice to use what I have |
ok, i'll test adding optional back. |
@Zehir version |
@ecyrbe It's working thanks |
Hello,
I was on 10.9.2 with not issue and I get this issue on 10.9.3 and 10.9.4.
I have this definition :
(The API Key plugin if needed can be found here)
With version 10.9.2 the
getConfig
signature was :But with both version 10.9.3 and 10.9.4 I get this error :
![image](https://private-user-images.githubusercontent.com/845225/261812538-7332bca5-0145-443d-9ddf-254adcda39c3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NTE3OTksIm5iZiI6MTcyMDQ1MTQ5OSwicGF0aCI6Ii84NDUyMjUvMjYxODEyNTM4LTczMzJiY2E1LTAxNDUtNDQzZC05ZGRmLTI1NGFkY2RhMzljMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwOFQxNTExMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZTc0M2E4NjdiYjdhMTlhMDllZDM0ZjU4MmFmMDRjYjE0ODQ5OWJmOWRkOGQzN2IzOWQ3ZDBjZGNjMDk3ZGM2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.kpfHiyqNDlMnjLbWKxxkz71y8t_-zXu9RcbtWtKfQaw)
Typescript is happy only if I provide some apiKey param but it's should be optional here.
I don't from where is the
string | number
type coming from. During my tests sometime it's wasstring | number | boolean
. When installing back version 10.9.2 the issue is gone and typescript display the old correct signature.If you need to test my setup you can use my repo from this commit.
The call is located here and the definition here and here.
The text was updated successfully, but these errors were encountered: