-
Notifications
You must be signed in to change notification settings - Fork 59
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
Possible alternative to configQueryExtraUnreserved option? #95
Comments
Before addressing the proposed solution, I just want to be clear about how the code generator works. From the point of view of the generator api, technically The operation function only demands the required parameters as part of the function arguments Required parameters could also end up as query parameters for example
So, we could introduce a change like you propose only for Alternatively we could come up with a method that works for required params too, however the required parameters are harder to change since they're tied to concrete types in the generated code. Another option which would be to let the user modify the request object instead of the operation arguments, to tell it how those query params get plus+encoded, this would be a less-typed solution but more general. A lot of this depends on how typed the fix needs to be. even for your example I'll think about it and play around with some code to see the best way to provide a solution to this. The only place i know of where plus-encoding is not allowed is in labels and selectors currently, but that seems like an important piece, so i'm not sure if its a better default to not plus-encode or default to plus-encode. (if you're really stuck, you can always have more than one config object |
Thanks for the quick response! FWIW, I have read that while there isn't good universal agreement about how plus signs in URLs should be treated, the W3C URI spec says the following:
Other guidance I've seen for API designers is in line with this as well. Therefore, I'd suggest defaulting to plus-encode and treating the places where Kubernetes APIs violate this rule as the exceptional cases. Hopefully such cases are rare and limited to things like labels and selectors (I'm not aware of any others either). |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
Yes @hughjfchen, I referenced the relevant commit (541fb76) in the initial post. I'd say "fixed" is a strong word :P |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
haskell/kubernetes/lib/Kubernetes/OpenAPI/Client.hs
Line 187 in 94ee7cc
This option was introduced here: 541fb76.
I have been running commands using the pod "exec" endpoint, and some of my commands had plus signs in them. (Because of new-style Nix hashes, as it turns out.) I spent many hours scratching my head about why they weren't executing properly before I found this change.
I don't think it makes sense to set a global
configQueryExtraUnreserved
in theKubernetesClientConfig
, because sometimes this kind of escaping needs to happen and sometimes it doesn't.I was wondering if an alternative might be possible which is easier to use/more apparent when you're getting it wrong. I'm picturing a newtype called
PartiallyUnescaped
orUnescapePlusSigns
or something, which can be wrapped around a normal query param, so you could do something likeand then define the
toQueryParam
method ofToHttpApiData (UnescapePlusSigns a)
accordingly.I'm not married to any particular solution of course. CC @jonschoning
The text was updated successfully, but these errors were encountered: