Path: redb-route/redb.Route.Http/Rest/RestParamDefinition.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.Http/Rest/RestParamDefinition.cs
----
namespace redb.Route.Http.Rest;
/// Where a declared REST parameter comes from.
public enum RestParamType
{
/// A {name} segment of the path template. Always required.
Path,
/// A query string parameter.
Query,
/// A request header.
Header,
}
/// The value type of a declared REST parameter, as OpenAPI names it.
public enum RestParamDataType
{
/// Any text.
String,
/// A whole number (invariant culture, optional sign).
Integer,
/// A decimal number (invariant culture).
Number,
/// true or false.
Boolean,
}
///
/// One parameter declared on a REST verb with Param(...): described in the OpenAPI document
/// always, enforced only when client request validation is on.
///
/// Parameter name: the template segment, the query key or the header name.
/// Where the parameter comes from.
/// A missing required parameter is answered with 400.
/// A value that does not convert to this type is answered with 400.
/// OpenAPI description.
public sealed record RestParamDefinition(
string Name,
RestParamType Type,
bool Required,
RestParamDataType DataType,
string? Description);