Class RestVerbDefinition

Assembly: redb.Route.Http.dll

One operation of a : method + path template, media types, binding
types and description. Finished with (send to an endpoint) or
(write the steps inline); both create the underlying HTTP route.

public sealed class RestVerbDefinition

Inheritance

Object→RestVerbDefinition

Properties

Binding

Binding mode override for this verb.

public RestBindingMode? Binding { get; }

ConsumesType

Expected request media type; a request with another Content-Type is answered with 415.

public string? ConsumesType { get; }

FullPath

Full path template (/api/orders/{id}).

public string FullPath { get; }

Method

HTTP method (GET, POST, …).

public string Method { get; }

Parameters

Parameters declared with , in declaration order.

public IReadOnlyList<RestParamDefinition> Parameters { get; }

Path

Path template relative to the (/{id}, /{id}/status, or empty).

public string Path { get; }

PathParameters

Path parameter names in declaration order ({id} → id).

public IReadOnlyList<string> PathParameters { get; }

ProducesType

Response media type written to the reply.

public string? ProducesType { get; }

RequestType

CLR type of the request body (JSON binding and OpenAPI).

public Type? RequestType { get; }

ResponseType

CLR type of the response body (OpenAPI).

public Type? ResponseType { get; }

RouteId

Route id; default rest-METHOD-full-path-1a2b3c4d (no '/' and no space, stable across restarts). Also the

public string? RouteId { get; }

Summary

Human description → OpenAPI summary.

public string? Summary { get; }

Target

Target endpoint set by ; null for inline routes.

public string? Target { get; }

Validation

Client request validation override for this verb; null = the declaration's option.

public bool? Validation { get; }

Methods

BindingMode(RestBindingMode)

Binding mode for this operation.

public RestVerbDefinition BindingMode(RestBindingMode mode)

ClientRequestValidation(bool)

Switches client request validation on or off for this verb (see ).

public RestVerbDefinition ClientRequestValidation(bool enabled = true)

Consumes(string)

Request media type this operation accepts.

public RestVerbDefinition Consumes(string contentType)

Description(string)

Human description (OpenAPI summary).

public RestVerbDefinition Description(string summary)

Id(string)

Route id / OpenAPI operationId.

public RestVerbDefinition Id(string routeId)

OutType<T>()

Response body type, described in OpenAPI.

public RestVerbDefinition OutType<T>()

Param(string, RestParamType, bool?, RestParamDataType, string?)

Declares a parameter: described in OpenAPI, and when client request validation is on, a missing

public RestVerbDefinition Param(string name, RestParamType type = RestParamType.Query, bool? required = null, RestParamDataType dataType = RestParamDataType.String, string? description = null)

Produces(string)

Response media type this operation produces.

public RestVerbDefinition Produces(string contentType)

Route()

Handles the request with steps written inline; returns the route to add them to.

public IRouteDefinition Route()

To(string)

Sends the request to uri (usually direct:...) and returns to the REST declaration for the next verb.

public RestDefinition To(string uri)

Type<T>()

Request body type: unmarshalled under JSON binding, described in OpenAPI.

public RestVerbDefinition Type<T>()