Class RestVerbDefinition
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
Properties
ConsumesType
Expected request media type; a request with another Content-Type is answered with 415.
public string? ConsumesType { get; }
Parameters
Parameters declared with , in declaration order.
public IReadOnlyList<RestParamDefinition> Parameters { get; }
PathParameters
Path parameter names in declaration order ({id} → id).
public IReadOnlyList<string> PathParameters { get; }
RequestType
CLR type of the request body (JSON binding and OpenAPI).
public Type? RequestType { get; }
RouteId
Route id; default rest-METHOD-full-path-1a2b3c4d (no '/' and no space, stable across restarts). Also the
public string? RouteId { 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)
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>()