Skip to content

JSON condition and evaluator #6

@Sebbs128

Description

@Sebbs128

Investigate creating a JSON-specific evaluator for request bodies.

Using System.Text.Json, this might look like either using the PipeReader (per ASP.NET Core docs advice on request operations, or passing the body stream to a Utf8JsonReader after enabling request buffering.

Care needs to be taken with the stream approach to ensure YARP can still correctly forward the request contents.

There is some advice at https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/use-utf8jsonreader, which also includes a section on using Utf8JsonReader with a ReadOnlySequence<byte>, which is applicable to the PipeReader option of implementing this.

Configuration should likely contain a way to specify a path for the particular json property to be evaluated against MatchValues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions