Skip to content

Explicit request object in defpage #131

Description

@eslick

Noir is a fantastic packaging of functionality, but several of us prefer to program in a more functional, less 'bindings' way. Middleware wrappers allow us to add system-level state to ring requests, but a dynamic binding is the only way to extract and use that request object. My own solution has been to write a wrapper which destructures the request object and other state added by middleware which gets annoying.

This is a long way of asking whether we can add a special parameter to get the full request object in the defpage destructuring argument, or add a request variable to the defpage macro call so we can refer to it explicitly?

(defpage [:post "/api/foo/bar"] {:keys [userid param2 +request+]} & body)

or optional defpage form

(defpage [:post "/api/foo/bar'] request {:keys [userid param2]} & body)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions