[C#/OData] Filtering inside a component

tried with JsonQuery with a similar issue at hand given this JsonQuery:

JsonQuery = new
{
	filter = new
	{
		path = "data.pagemeta.slug",
		op = "eq",
		value = page
	}
}

with error:

Json query not valid: Path ‘data.pagemeta.slug’ does not point to a valid property in the model.

Mmmm I think I may have found the clue on the issue.
It does seem that $filter(in the ToQuery()) isn’t indeed a good variable name for the query string, meanwhile the filter is, as demonstrated in this screenshots that compare the calls:

  1. with $filter
  2. with filter

And I also found that if I escape the $filter like \$filter it does work too!

Looking between the documentation and the code I also spotted that when in the documentation it does portray a correct get with filter as:

https://…/api/content/geodata/cities?$filter=data/name/en eq Munich

Meanwhile the code at ContentsClient.cs line 147 generates something like:

https://…/api/content/geodata/cities/?$filter=data/name/en eq Munich

(there’s an extra forward slash in front of cities but I don’t really know if it does bother the final call or not)

In the end could there be something wrong with the parsing of that $ sign that somewhere isn’t really getting to the service in a correct way?

It is verylikely a problem with your query. E.g. the field path should be data.pagemeta.iv.slug

It doesn’t seem like given the error and everything is flattened:

Json query not valid: Path ‘data.pagemeta.iv.slug’ does not point to a valid property in the model

Did you check out the other answers? If yes, what do you think?

Hi, the query structure is related to the database representation, not to the transformed API response.

If you can: Invite me to your project and send me the login credentials using PM.

For everybody else, we solved with putting the language of interest also in the filter, so it does look like:
data/pagemeta/{CurrentLanguage}/slug eq '{page}'}
meanwhile X-Languages as a header(included with .WithLanguages(...) didn’t really matter to the filter as I thought, that’s why of the erroring.