Skip to content

Destructuring route params into a map #9

@RickMoynihan

Description

@RickMoynihan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions