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

Path parameter resolving doesn't work when using string interpolation #89

Closed
basdijkstra opened this issue Jun 23, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@basdijkstra
Copy link
Owner

Example:

[Test]
public void SinglePathParameterCanBeSpecified()
{
    Given()
        .PathParam("userId", this.userId)
        .When()
        .Get($"{MOCK_SERVER_BASE_URL}/user/{{userId}}")
        .Then()
       .StatusCode(200);
}

will not lead to a proper path.

@basdijkstra basdijkstra self-assigned this Jun 23, 2023
@basdijkstra basdijkstra added the bug Something isn't working label Jun 23, 2023
@basdijkstra
Copy link
Owner Author

basdijkstra commented Jun 23, 2023

The problem is with the Stubble {{ and }} delimiters that are seen by C# as placeholders for variables when doing string interpolation. I can't find a way to change the default delimiter to another value, neither in Stubble nor in Handlebars.Net (an alternative).

@basdijkstra
Copy link
Owner Author

Addressed in 7e849d5 by changing delimiters to [ and ].

As this is technically a breaking change, I'll have to release an update as version 3.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant