-
Notifications
You must be signed in to change notification settings - Fork 1
JSON condition and evaluator #6
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Activity
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
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 aUtf8JsonReaderafter 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
Utf8JsonReaderwith aReadOnlySequence<byte>, which is applicable to thePipeReaderoption of implementing this.Configuration should likely contain a way to specify a path for the particular json property to be evaluated against
MatchValues