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

Destructuring route params into a map #9

Open
RickMoynihan opened this issue Jul 25, 2017 · 0 comments
Open

Destructuring route params into a map #9

RickMoynihan opened this issue Jul 25, 2017 · 0 comments

Comments

@RickMoynihan
Copy link

RickMoynihan commented Jul 25, 2017

Currently ataraxy only supports destructuring route parameters into a vector; often I find myself having to translate these parameters immediately into a map so I can attach specs to their keys and not have to remember a specific ordering.

It would be nice if ataraxy supported the following mapping, allowing parameters to be bound into a map.

["/path" #{foo bar ?baz}] [:foo/handler {:foo foo, :bar bar, :baz baz}]

One difficulty is that we'd have to decide what to do with optional parameters. It seems there are two options, either:

  1. the parameter ?baz is bound in the map to the kv pair of :baz nil, or...
  2. the key :baz is not put in the map at all.

Personally I think that 2 is the better approach, but it might be counter to peoples expectations.

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