PartialResponseRequest.Fields 1.1.0-beta

This is a prerelease version of PartialResponseRequest.Fields.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package PartialResponseRequest.Fields --version 1.1.0-beta                
NuGet\Install-Package PartialResponseRequest.Fields -Version 1.1.0-beta                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PartialResponseRequest.Fields" Version="1.1.0-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PartialResponseRequest.Fields --version 1.1.0-beta                
#r "nuget: PartialResponseRequest.Fields, 1.1.0-beta"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PartialResponseRequest.Fields as a Cake Addin
#addin nuget:?package=PartialResponseRequest.Fields&version=1.1.0-beta&prerelease

// Install PartialResponseRequest.Fields as a Cake Tool
#tool nuget:?package=PartialResponseRequest.Fields&version=1.1.0-beta&prerelease                

Build Status Azure DevOps tests with custom labels Coverage Nuget Nuget Nuget

Partial response

A simple set of libraries that enables you to parse, interpret, serialize and build simple queries for fields and filters that could be used in building flexible REST endpoints (but not limited to API): https://my-app.com/animals?fields=id,photoUrl,guardian{name}&filters=id(gt:5)

Quick start

Response pruner

Nuget

Add a dependency using the NuGet package manager (console):

Install-Package PartialResponseRequest.AspNetCore.ResponsePruner

Use services.AddPartialResponse() to add a custom json output formatter, that will search for ?fields=... query string that would be used to prune the response for the client.

public void ConfigureServices(IServiceCollection services)
{
    services.AddHttpContextAccessor();
    services.AddPartialResponse();
}

Read more

Fields Queries

Nuget

Add a dependency using the NuGet package manager (console):

Install-Package PartialResponseRequest.Fields

Allows you to parse fields query for processing/interpreting and reacting based on it, like building a custom optimized SQL query:

var parser = new FieldsQueryParser();
IEnumerable<FieldToken> fields = parser.Parse("id,name,photoUrl");
var interpreter = new FieldsQueryInterpreter(fields);

// Use the interpreter to build queries
if (interpreter.Includes("id"))
{
    // include id field
}

Read more

Filters Queries

Nuget

Add a dependency using the NuGet package manager (console):

Install-Package PartialResponseRequest.Filters

Allows you to parse filters query for processing/interpreting and reacing based on it, like building custom SQL query where clauses:

var parser = new FilterQueryParser();
IEnumerable<FilterToken> filters = parser.Parse("created(gt:2020-01-01)");
var interpreter = new FiltersQueriesInterpreter<MyFilters>(filters.ToList());

if (interpreter.FiltersBy(x => x.Created, out IOperatorsInterpreter<CreatedFilters> createdFilter))
{
    if (createdFilter.HasOperator(x => x.Gt, out OperatorValue value))
    {
        var parsedValue = DateTime.Parse(value.Value);
        Console.WriteLine(parsedValue.ToString());
    }
}

Read more

Documentation

View the documentation here

Cake build tasks

https://cakebuild.net/

Build the project build.ps1 --target=Build [--configuration=Release]

Run tests build.ps1 --target=Test [--outputDirectory=./output]

Run a test coverage report build.ps1 --target=Report [--testResultsDirectory=./test-results/]

Create nuget packages build.ps1 --target=Pack [--outputDirectory=./output] [--configuration=Release] [--package-version=1.0.0.0]

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on PartialResponseRequest.Fields:

Package Downloads
PartialResponseRequest.AspNetCore.ResponsePruner

ASP.NET Web API JSON output formatter for partial response

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.2-beta 7,508 2/28/2021
1.1.0-beta 359 6/13/2020
1.0.0-rc2 316 3/8/2020
1.0.0-rc 484 3/7/2020