Skip to content

Type-safe request extensions #317

@sjanota

Description

@sjanota

Is your feature request related to a problem? Please describe.
Right now HttpRequest is can be assigned any property. Thanks to that you can pass custom properties down the stream as middleware-jwt does.

However, custom properties are of type any. I can't see a way to make them type-safe. Am I missing something?

Describe the solution you'd like
I'd like to pass custom properties in a type-safe manner as it is done with params, query, and body.

Describe alternatives you've considered
I tried to extend the HttpRequest type and make my middleware return the extended version, but with no success.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedscope: coreRelates to @marblejs/core package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions