dunglas / vulcain

🔨 Fast and idiomatic client-driven REST APIs.
https://vulcain.rocks
GNU Affero General Public License v3.0
3.5k stars 106 forks source link

Filtering resources does not work with multiple wildcards #47

Open cwdt opened 4 years ago

cwdt commented 4 years ago

Hi, I'm experimenting with Vulcain and I'm stuck on the following situation. I have three calls, simplified:

GET /customers Response:

[
  {
    "id": 1,
    "name": "Foo",
    "settings": "/customer/1/settings"
  }
]

GET /customer/{id}/settings Response:

{
  "allowed": false,
  "addresses": "/customer/{id}/settings/addresses"
}

GET /customer/{id}/settings/addresses Response:

[
    {
      "address": "Street 1",
      "city": "Example city"
    }
  ]

When I try to filter the address resource because I want it to only return the city property, the following is not working: Fields: /*/settings/addresses/*/city.

When I specify the exact address key (i.e. 0) it does work (Fields: /*/settings/addresses/0/city).

Am I missing something?

dunglas commented 4 years ago

It should work, we even have tests for that. Could you try to provide a reproducer (the best would be to add a failing test in this repo, but anything else such as a repo with a Docker Compose config should do the trick)?