Skip to content
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

$0 in string parameter value is not handled correctly #141

Open
pdokoupil opened this issue Mar 3, 2020 · 0 comments
Open

$0 in string parameter value is not handled correctly #141

pdokoupil opened this issue Mar 3, 2020 · 0 comments

Comments

@pdokoupil
Copy link

Description

When an operation's string parameter contains "$0" in it's value then the resulting string that is eventually being sent in a request is broken.

Example and Expected behavior

Consider parameter {id} having a string type with a value "$0something", then the generated request contains a value "{id}something" instead of "$0something".

Source of the problem

The problem is caused by a missing escaping of $ characters in the "replacement" parameter to the Regex's Replace method. The $0 is then treated as a reference to 0th matched group, i.e. the whole pattern. I suspect that it is the following line of code:
let path' = <@ Regex.Replace(%path, pattern, %value) @> in the OperationCompiler.fs file. (Imagine parameter name being "id", pattern being "{id}" and value being, for example, "$0something".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant