-
Notifications
You must be signed in to change notification settings - Fork 0
IHttpParamValueDeserializer
A custom deserializer interface that allows fully customized deserializing of HTTP parameters. If implemented, it will be called in the deserialization phase for each of the HttpParams. The implementation of this interface must be registered to Services at startup.
The interface implementor can cover all four parameter type deserializations:
- Form fields
- Headers
- Body
- Query parameters
The implementation does not have to implement every case though; if your custom deserializer decides it only wants to cover some types, or some specific functions, you may do so. Each interface method returns a DeserializerResult where a field called DidDeserialize determines whether default deserialization will be attempted for the parameter - if it's set to true, then it's assumed that the custom deserializer handled the parameter and no further action is required. If it's set to false then the default deserialization code will attempt to deserialize the parameter.
To register your implementation you should register your implementation in the dependency injection provider. In practise you need to add the following line to your Function App startup code:
builder.Services.AddSingleton<IHttpParamValueDeserializer, MyDeserializer>();Example startup code:
[assembly: WebJobsStartup(typeof(Startup), "MyStartup")]
namespace AzureFunctionsV2.HttpExtensions.Tests.FunctionApp.Startup
{
public class Startup : IWebJobsStartup
{
public void Configure(IWebJobsBuilder builder)
{
builder.Services.AddSingleton<IHttpParamValueDeserializer, MyDeserializer>();
}
}
}Table of contents
- Overview
- Authentication and authorization
- Exception handling
- HttpParam Attributes
-
Classes and interfaces overview
- Implementable interfaces
- Infrastructure classes