Fork me on GitHub

Hi there! I’m trying to adopt swagger(-ui) feature with reitit but looks like the generated swagger.json doesn’t conform with PathsObject specification. Especially pathTemplating part - It expects curly braces instead of colon prefix notation.


@delaguardo oh, needs fixing then. Would you like to do a PR?


Hmm... I though I added swagger validator tests, but can't see any.


I will try to do a PR

👍 1

It seems like trailing slashes confuse reitit and don’t resolve properly. This works (reitit.core/match-by-path router "/dashboard") ;=> #reitit.core.Match{ ... } but this doesn’t (reitit.core/match-by-path router "/dashboard/") ;=> nil


Is this the intended behaviour, and if so, what is the idiomatic way of matching both routes to the same route name?


@skammer currently, there is no way, but this should be resolved. I wrote for this. Ideas welcome.


Independent of what strategy is chosen, there should be clear distinction between rerouting trailing-slash paths to non-trailing-slash paths, serving specific versions and allowing/disallowing extraneous slashes in between (is /some///silly////path// same as /some/silly/path?) And especially for static resource resolution this might become quite important as /path/ indicates a directory while /path indicates a file which ,may be abused to access eg. files in same root as intended resource directory itself.


This is one of those problems I've never found a good solution for that I'd be 100% happy but that doesn't mean there wouldn't be one 🙂


we have a project deadline on friday, more time next week time (for the frontend-module too).


e.g. the current good practise would be to do it yourself: if there is no match, try without a trailing slash, if still nothing, try with trailing slash added. let’s make something better out of this.