0

I want make Swagger specification for my API. But customers use my API can create and delete some entity on server. Each entity have only one type and can include other entity.

Example of API:

http:/localhost/api/<entity_lv_1>
http:/localhost/api/<entity_lv_1>/<entity_lv_2>
http:/localhost/api/<entity_lv_1>/<entity_lv_2>/<entity_lv_3>

And my rest controller have mapping /** for catch all of them.

I try make mapping with regexp:

@GetMapping(value = /{entityLv1}/{entityLv2:[a-z0-9_-]+/*})

But it not work fine, because server can't processed request with entity_lv_3 correctly.

  • OpenAPI [does not support wildcard path parameters](https://stackoverflow.com/q/42335178/113116). There's an existing feature request here: https://github.com/OAI/OpenAPI-Specification/issues/892 – Helen Jul 20 '21 at 12:25
  • @Helen, thanks for the quick answer to my question. – kosmo flyko Jul 21 '21 at 15:06

0 Answers0