question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating a request with OData parameters that includes a comma

See original GitHub issue

Hi, I’m trying to create a wiremock response and request that matches on an OData query.

I’m trying to create a basic request like this:

public void SetUp(string body, string path) 
{
    var response = Response
       .Create()
       .WithBody(body)
       .WithHeader("content-type", "application/json; charset=utf-8")
       .WithStatusCode(200);
    
    var request = Request
       .Create()
       .WithPath(path)
       .WithParam("$filter", "startswith(name,'testName')")
       .UsingGet();
       
    _server.Given(request).RespondWith(response); 
}

I’m then faced with a problem where the response is returned as a partial match because of the request query, and if I inspect the query later on it appears as two queries (separated by the comma I guess). image

Is there anything I can do to make sure that the query-value is not split by the comma?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
StefHcommented, Oct 24, 2022

Hello @loekensgard

By default, the application does split on &, ; and ,.

However I’ve changed this.

In the settings, set the value QueryParameterMultipleValueSupport to a desired value.

This new functionality is in the preview version 1.5.8-ci-16573.

(https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)

0reactions
StefHcommented, Nov 8, 2022

@loekensgard Good to hear that you found another way.

(Note that I will still merge the PR to master, just to be more flexible in the future)

Read more comments on GitHub >

github_iconTop Results From Across the Web

I need an example of a request to the OData API for returning ...
4. I'm having trouble with the comma separated list of field names that is supposed to be sent back as the resultParameter.
Read more >
URL Conventions (OData Version 3.0)
The sopParameterNameAndValue syntax rule defines the grammar for specifying any parameters to the service operation in the query part of the request URL....
Read more >
URI Conventions (OData Version 2.0)
A URI with a $inlinecount System Query Option specifies that the response to the request includes a count of the number of Entries...
Read more >
Modifying responses with query parameters - OneDrive API
Here is a table of optional OData query parameters you can use in your OneDrive API requests. Comma-separated list of relationships to expand ......
Read more >
Parameter with comma - Radzen IDE (Angular)
Hello. I'm making a application with Radzen that integrates with an ERP and on the MSSQL database of the ERP there is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found