You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating request URIs, the generated code uses Query for the query type, which escapes characters like +, which should not escaped, for instance, for the Kubernetes API client.
Build the generator.
Use it in a code base that does something like the following:
let request = listEndpointsForAllNamespaces (Accept MimeJSON)
selector = LabelSelector $ "foo+in+(bar)"
in do
_ <- dispatchMime' manager config $ request -&- selector
Verify that the generated request has URL-encoded the + signs.
Related issues/PRs
Suggest a fix
To resolve this situation, the generated code should use PartialEscapeQuery instead, which sadly is a more complex type as the underlying items are no longer Maybe ByteString, but instead are EscapeItem, so it becomes a larger refactoring
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
When generating request URIs, the generated code uses
Query
for the query type, which escapes characters like+
, which should not escaped, for instance, for the Kubernetes API client.In the Kubernetes API client, we should be able to generate queries like
?labelSelector=environment+in+%28production%2Cqa%29%2Ctier+in+%28frontend%29
(from https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#list-and-watch-filtering). Right now, the generated URIs URL-encode the plus signs, which the API server rejects.openapi-generator version
Commit number
c9737cf97d5e31936639842d389118e980ee85a9
(from https://github.com/kubernetes-client/haskell/blob/master/settings)OpenAPI declaration file content or url
https://github.com/kubernetes-client/haskell/blob/master/kubernetes/openapi.yaml
Command line used for generation
In the directory where https://github.com/kubernetes-client/haskell/ is checked out:
../gen/openapi/haskell.sh . ./settings
Steps to reproduce
Build the generator.
Use it in a code base that does something like the following:
Verify that the generated request has URL-encoded the + signs.
Related issues/PRs
Suggest a fix
To resolve this situation, the generated code should use
PartialEscapeQuery
instead, which sadly is a more complex type as the underlying items are no longerMaybe ByteString
, but instead areEscapeItem
, so it becomes a larger refactoringThe text was updated successfully, but these errors were encountered: