FieldParser Type
Registers a parser for a custom type in route/query parameters.
Create with Extractor.parser, Extractor.constrainedParser, or
Extractor.typedParser. Only needed for custom types — built-in types
(Guid, string, int, int64, bool) and single-case DU wrappers are handled automatically.
InputType determines how values are fed to the parser: typeof<string>
for string parsers, or a typed input (e.g., typeof<bool>) for typed parsers.
ExplicitConstraints adds ASP.NET Core route constraints at endpoint registration.
Example
let config: EndpointConfig<AppError> = {
Parsers = [
Extractor.constrainedParser<Slug> [| RouteConstraint.Alpha |] (fun s -> Ok (Slug s))
]
// ... other config
}
Record fields
| Record Field |
Description
|
|
Explicit route constraints declared by this parser (e.g., [| Alpha |])
|
The output type this parser produces (e.g., typeof
|
|
The input type the parser expects (typeof
|
|
Parse input value (boxed InputType) into the target type
|
Falco.UnionRoutes