Fork me on GitHub
#reitit
<
2019-10-23
>
akiel09:10:22

@ikitommi I supply the routes in the order you mentioned and use :conflicts nil as config. Will this result in a router which offers he maximum performance possible? I have about 150 groups of routes. Besides Patient I have 150 other paths. Each “group” has 6 routes. So there will be about 900 routes.

ikitommi10:10:20

would love to hear about the perf of matching with that.

akiel10:10:39

Ok I’ll do if it runs. I currently refactor at this location.

valerauko09:10:43

the best performance is if the routes don't conflict

valerauko09:10:42

@ikitommi i have parameters spec'd as (coll-of pos-int?), but this displays in swagger-ui's example as [0] which is obviously not a valid value. spec generators can make correct example sequences out of the spec. any idea what could be causing this?

ikitommi09:10:52

@akiel only the conflicting routes are served with linear router, other with best possible algo. There is one extra method call in the stack, so maybe a few ns penalty.

ikitommi09:10:45

@vale does the swagger json contain :min value? Should be 1 for pos-int? I believe...

valerauko09:10:11

you're right, it sure does.

{"type":"integer","format":"int64","minimum":1}
so i figure this is an issue with swagger-ui then?

valerauko09:10:52

could you point me to where does reitit include/load that? then i could debug which side the problem is

ikitommi09:10:27

the swagger-ui module?

ikitommi09:10:44

I would browse the swagger-ui repo for related issues. You can also try updating the swagger-ui deps to latest

ikitommi10:10:03

1.0.0 will use Openapi, might work differently

valerauko10:10:33

oh it's a git submodule of ring-swagger-ui? got it. gonna put up a PR if i find a bug

👍 4
Jon Walch20:10:59

Is it possible to have nested routes that have gets on them?

Jon Walch20:10:54

["/user"
    {:get  {:summary    "get a user"
            :middleware [middleware/wrap-restricted]
            :handler    (fn [req]
                          (user/get-user req))}}
    ["/login"
      :post {:summary    "login as user"
             :parameters {:body {:screen_name    string?
                                 :password string?}}
             :handler    (fn [req]
                           (user/login req))}}]
...

Jon Walch20:10:57

I'm getting a 404 for /user

Toni Vanhala05:10:59

I've started to work on this.

partywombat 12
Toni Vanhala08:10:46

Made a PR for publishing intermediate paths by default https://github.com/metosin/reitit/pull/326

👍 8
Jon Walch21:10:22

thanks! Perfectly fine using the existing syntax

👍 4
Toni Vanhala05:10:59

I've started to work on this.

partywombat 12
Toni Vanhala08:10:46

Made a PR for publishing intermediate paths by default https://github.com/metosin/reitit/pull/326

👍 8