I’m not sure from your example what is a constant that defines a grouping and what are variables.
What I’m interpreting:
recipes → Root level url to show the list of categories
recipes/<str:category> → Shows list of recipes for “category”
recipe/<str:recipe> → Shows the specific recipe.
Is this interpretation correct? If so, there is no clean nested structure for all these in one definition. I’d suggest either rethinking your url structure and naming conventions or simply including these three entries in your root urls.