Skip to content

Validate body of MockContext #569

@Resteklicken

Description

@Resteklicken

Is your feature request related to a problem? Please describe.
In my tests I use fuego.MockContext. The Body() method just returns mockCtx.RequestBody that can be set during fuego.NewMockContext(), skipping any validation that would happen with a real request context.

Describe the solution you'd like
I would like the Body() method to perform proper validation on mockCtx.request.Body if mockCtx.RequestBody is unset.

Describe alternatives you've considered
I have found no way to test validation via the route itself.

Additional context
It might be necessary to address #568 first to be able to actually set mockCtx.request.

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