WireMock-Net / WireMock.Net

WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.
Apache License 2.0
1.36k stars 199 forks source link

Update JSONPathMatcher.cs to cover the string path selection to a child #993

Closed DayLightDancer closed 10 months ago

DayLightDancer commented 10 months ago

The .SelectToken method accept string path selection and JSONPath queries. The current code works only for the queries because the result is JObject. When the string path is selected the result is JValue and event with a valid result the code the code doesn't return valued result. https://www.newtonsoft.com/json/help/html/SelectToken.htm

StefH commented 10 months ago

@DayLightDancer Can you please also add a unit test for this scenario?

DayLightDancer commented 10 months ago

Added the unit tests. I am not able to run the entire solution locally so the tests are created and run on separate solution and added in the existed file.

StefH commented 10 months ago

Thanks.

Can you take a look at the comments?

DayLightDancer commented 10 months ago

I've addressed the comments

DayLightDancer commented 10 months ago

HI, Please tell me if there is anything to do with that PR and when I can expect the new build?

StefH commented 10 months ago

You set the comments to resolved, but did you also commit your latest changes?

DayLightDancer commented 10 months ago

I think so. I've edited the files in place. I will appreciate any help complete that PR.

StefH commented 10 months ago

it seems that the files are not changed, can you please double check?

DayLightDancer commented 10 months ago

it seems that the files are not changed, can you please double check?

Yes. I will in few ours. But this is what is see image

StefH commented 10 months ago

This one is not yet done: image

DayLightDancer commented 10 months ago

This one is not yet done: image

I found the problem: image Do you know how to solve it?(The commit doesn't belong to any branch)

StefH commented 10 months ago

Replace it by a one line:

// The SelectToken method can accept a string path to a child token ( i.e. "Manufacturers[0].Products[0].Price"). In that case it will return a JValue (some type) which does not implement the IEnumerable interface.
DayLightDancer commented 10 months ago

Can you check it, now?

StefH commented 10 months ago

I will merge this one and update it myself.

DayLightDancer commented 10 months ago

I will merge this one and update it myself.

Thank you verry much. I really appreciate it.