Class IdempotencyOptions
idempotency settings for an endpoint
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public sealed class IdempotencyOptions
Properties
AddHeaderToResponse
by default, the idempotency header will be automatically added to the response headers collection. set false
to prevent that from happening.
Declaration
public bool AddHeaderToResponse { get; set; }
Property Value
Type | Description |
---|---|
bool |
AdditionalHeaders
any additional headers that should participate in the generation of the cache-key. see the source/definition for the list of default additional headers.
Declaration
public HashSet<string> AdditionalHeaders { get; set; }
Property Value
Type | Description |
---|---|
HashSet<string> |
CacheDuration
determines how long the cached responses will remain in the cache store before being evicted. defaults to 10 minutes.
Declaration
public TimeSpan CacheDuration { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
HeaderName
the header name that will contain the idempotency key. defaults to Idempotency-Key
Declaration
public string HeaderName { get; set; }
Property Value
Type | Description |
---|---|
string |
IgnoreRequestBody
by default, the contents of the request body (form data/json) is taken into consideration when determining the uniqueness of incoming requests even if the idempotency-key is the same among them. i.e. if two different requests come in with the same idempotency-key but with different request body content, they will be considered to be unique requests and the endpoint will be executed for each request.
Declaration
public bool IgnoreRequestBody { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
this involves buffering the request body content per each request in order to generate a sha512 hash of the incoming body content. if the clients making
requests are under strict quality control and are guaranteed to not reuse idempotency keys, you can set this to true
to prevent the hashing of
request body content.
SwaggerExampleGenerator
a function to generate an example value for the swagger request param header
Declaration
public Func<object>? SwaggerExampleGenerator { get; set; }
Property Value
Type | Description |
---|---|
Func<object> |
SwaggerHeaderDescription
the description text for the swagger request header parameter
Declaration
public string? SwaggerHeaderDescription { get; set; }
Property Value
Type | Description |
---|---|
string |
SwaggerHeaderType
the type/format of the swagger example value
Declaration
public Type? SwaggerHeaderType { get; set; }
Property Value
Type | Description |
---|---|
Type |