Mockoon : How to get query parameters value with dot in parameter's name?

909 views Asked by At

I try to mock GET /wssorting/get-sortings?SearchCriteria.Names=abc123

My response body is set to :

{
  param:  {{queryParam 'SearchCriteria.Names'}}
}

I tried with queryParamRaw, by escaping the dot SearchCriteria\.Names, using triple curly braces, but I get always the response body :

{
  param:
}

I cannot remove the dot in parameter name, it is a part of name.

Is it possible to use dot in query parameter names with Mockoon ?

1

There are 1 answers

0
255kb - Mockoon On

[Update 2024-01-01]

This is now possible since v4.1.0, which added support for dot notation and JSON Path to the queryParam and queryParamRaw helpers.

However, using the dot notation in the query parameters will not create an object as Mockoon is using qs to parse the parameters. Only the bracket notation is supported.

It should work by calling the endpoint with:

GET /wssorting/get-sortings?SearchCriteria[Names]=abc123


This is not yet possible in Mockoon but will be, as part of the next release (in the coming days). It's already possible using the body or bodyRaw helpers, which can be confusing.