André Oliveira
André Oliveira

Reputation: 1121

How to do a "Where filter" using Loopback 4 explorer

I'm trying to use the filter object in Loopback 4 to do a where clause, let's say I have a model named city and I want to filter the cities based on the name.

How you that filter look like in Loopback 4 explorer?

Here is what I have:

{
  "where": {"name":"Orlando"},
  "offset": 0,
  "limit": 10,
  "order": [
    "string"
  ]  
}

This will produce the following Request URL:

http://127.0.0.1:3000/cities?filter[offset]=0&filter[limit]=10

I want to produce: http://127.0.0.1:3000/cities?filter[where][name]=Orlando&filter[offset]=0&filter[limit]=10

Thanks in advance for any help!

Filter screenshot

Upvotes: 1

Views: 3298

Answers (1)

Peter Liapin
Peter Liapin

Reputation: 1275

This is s known bug in Loopback 4.x due too a known bug/limitation of swagger-ui and swagger-js. See the corresponding discussions on Loopback's Github:

And the corresponding issue for the swagger-js:

Upvotes: 1

Related Questions