Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match-coll not working as expected #27

Open
volrath opened this issue Jun 23, 2016 · 0 comments
Open

match-coll not working as expected #27

volrath opened this issue Jun 23, 2016 · 0 comments

Comments

@volrath
Copy link

volrath commented Jun 23, 2016

I know the title is broad and unspecific.

I tried this snippet from the README and it doesn't work:

Routes can be constrained by request methods.

(def api-routes
  (silk/routes {:api-data [["api"] {"limit" (silk/? (silk/int :limit) {:limit 100})
                                    "offset" (silk/? (silk/int :offset) {:offset 0})} (serve/POST)]}))


(silk/match api-routes {:path ["api"]})
;=> nil
(silk/match api-routes {:path ["api"] :request-method :post})
;=> {:limit 100, :offset 0, :domkm.silk/name :api-data, ...}

Last silk/match call also returned nil.

I debugged the error for a while, and narrowed it down to match-coll, but I'm not sure exactly what could be happening there.

I'm posting this here so we can discuss way to fix it, and I'll be happy to submit a PR if some guidance is provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant