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
allow escaping of path params to be optional (#58)
Certain OpenAPI specs depend on the path params to be not escaped (e.g. OpenPolicyAgent specifications).
This will allow the escaping of path parameters to be specified at request context level (with default as `true`), and also allows overriding at the client instance level (defaults to no overridiing). The existing behavior of always escaping is retained as the default.
- `pre_request_hook`: A function that is called before every API call. This function must provide two methods:
127
128
- `pre_request_hook(ctx::Ctx)`: This method is called before every API call. It is passed the context object that will be used for the API call. The function should return the context object to be used for the API call.
128
129
- `pre_request_hook(resource_path::AbstractString, body::Any, headers::Dict{String,String})`: This method is called before every API call. It is passed the resource path, request body and request headers that will be used for the API call. The function should return those after making any modifications to them.
130
+
- `escape_path_params`: Whether the path parameters should be escaped before being used in the URL. This is useful if the path parameters contain characters that are not allowed in URLs or contain path separators themselves.
129
131
- `verbose`: Can be set either to a boolean or a function.
130
132
- If set to true, then the client will log all HTTP requests and responses.
131
133
- If set to a function, then that function will be called with the following parameters:
@@ -141,6 +143,7 @@ struct Client
141
143
downloader::Downloader
142
144
timeout::Ref{Int}
143
145
pre_request_hook::Function# user provided hook to modify the request before it is sent
0 commit comments