Skip to content

Cleaner middleware for response formatting when it comes to useRcBlock, and format option #1876

@TarikGul

Description

@TarikGul

Looks fine, so I will approve.

It may be a cleaner and cut down on all the duplication if we just have a responseFormatter middleware. It will also cut down on human error as endpoints are added and changed if someone forgets to add this formatting. It also give a single place to look for output formatting, which we could later document and would probably be nice to know as a developer coming in with little context.

Naming-wise, I would consider a better name, but I am not sure what to suggest. Something like format=rc might work and might be more intuitive and flexible but I am uncertain on the naming side.

Originally posted by @andrew-ifrita in #1872 (review)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions