-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Feature Request] Automatic encoding of $ breaks OData APIs #592
Comments
I'm still not sure what the best way to deal with special characters is. It's a pretty difficult thing to change this far into the app's lifecycle. I'm thinking the best thing to do might be to make the encodable characters configurable within the workspace settings. I should also point out that the setting you mention only applies to query string parameters defined in the URL (not in the friendly Query tab). If that works for you, it's actually possible to write a simple plugin to toggle this setting for every request. module.exports.requestHooks = [
context => {
context.request.settingEncodeUrl(false)
}
]; |
That would work reasonably for me. OData/non-OData is very closely tied to my workspaces (i.e. some are 90%, some are 0%, not much between). It's not super discoverable and it'll keep catching people out first time, but I can see why you'd be cautious around breaking existing behaviour, in case anybody does rely on these being encoded. It's not perfect, but that would be a good strict improvement for me. Getting it working in the friendly query tab too would be even better of course 😃 Thanks for the plugin tip! I had no idea any of that existed. |
My OData APIs are callable with Insomnia. But there's a small issue with URL Strings in the response messages. |
@Atvaark that commit should address your issue ^ |
Going to close this in favor of #605 Please move all further discussion there 😄 |
Details
Making a request like
http://example.com/abc?$expand=my_expansion
actually makes a request likehttp://example.com/abc?%24expand=my_expansion
(encoding the$
to a%24
).This can be painful because it means it's impossible to ever pass any options to any OData API, since they all require a literal
$
option prefix: http://docs.oasis-open.org/odata/odata/v4.0/os/part2-url-conventions/odata-v4.0-os-part2-url-conventions.html#system-query-optionsurl5.1.I've now seen from #417 that there's an option to disable this encoding, request by request, but it's a bit awkward when 100% of my requests need this to be individually turned off, for a major API standard. Lots of other tools have this problem too, annoyingly, but as a useful datapoint Swagger disabled this behaviour, asked for feedback from anybody who does need this encoded, and got zero further responses.
The text was updated successfully, but these errors were encountered: