dox_core
library
Classes
Accepted <T >
The value must be true, 1, '1', 'true', 'yes' or 'on':
@Accepted(). For a "terms" check box. Use it on
a bool field with no default, so a missing value fails too.
AdaptedServer
A server that tells its ServerAdapter . Dox uses that adapter for a
server that the app binds itself (a CustomServer of dox_core).
AESEncryptor
Encrypt and decrypt text with AES-GCM.
After
After date (exclusive). date is one of:
AfterOrEqual
On or after date . date works like in After .
AfterOrEqualRule
Date must be on or after date .
AfterResponse
Runs work after the response is sent, so the client does not wait
for it. Any code can add work. It does not need the request.
AllowEmpty
Keep "" as a value. Without it, "" counts as missing.
Alpha
Only ASCII letters.
AlphaDash
Only ASCII letters, - and _.
AlphaNumeric
Only ASCII letters and digits.
AlphaRule
Text must match Patterns.alpha , Patterns.alphaDash or
Patterns.alphaNumeric , by code. It reads the pattern each time it
checks or exports JSON Schema, so it follows Validator.flags, also
for a schema made before the flags were set.
AnySchema
Accepts any value, even null or missing. Made by v.any().
ApiDeprecated
Marks the route as deprecated in the docs.
The Dart @Deprecated and @deprecated work too.
ApiIgnore
Leaves this method (or all methods of this class) out of the docs.
AppConfig
AppRoutes
the routes of the app, from Dox.loadRoutes
AsyncRule <T >
A rule that only has an async check, like "email is unique in the DB".
BadRequestException
Thrown when the body can not be read, like JSON that is not valid.
Dox answers with 400 Bad Request.
BaseSchema <O >
Base of the fluent schemas (v.string(), v.object(), ...).
It keeps the rules and docs in fields, so each fluent method can copy
the schema and add one more.
Before
Before date (exclusive). date works like in After .
BeforeOrEqual
On or before date . date works like in After .
BeforeOrEqualRule
Date must be on or before date .
BetweenRule <N extends num >
Number must be from min to max .
Body
Like Request , but always the request body.
BoolSchema
Schema for true / false. Made by v.bool().
BuiltInRule <T >
Base for the built-in rules. It keeps name, message, params and
JSON Schema hints in fields, so each rule only writes check .
BuiltInServer
The servers that come with Dox. They use the settings of AppConfig.
Cache
Cache facade on top of dox_cache.
CacheConfig
Cache settings.
CacheEncrypter
Turns cache text into secret text and back. A store with
'encrypt': true uses it. Set it as CacheConfig(encrypter: ...).
CacheFlags
Opt-in behaviors of the cache that change the defaults. Every flag is
off by default.
CacheLock
An atomic lock. Only one owner can hold it at a time.
CacheManager
Gives named cache stores from the config. Each store is built once.
CacheStore
The main cache API for one store. Wraps a CacheDriver.
CoerceBuilder
Schemas that convert input first. Made by v.coerce.
Confirmed <T >
The key <field>_confirmation must have the same value:
@Confirmed() on password needs password_confirmation.
Give other to use another key.
ControllerAction <T extends Object >
A route action that points to a method of a controller from the
container. The controller is made once per isolate, at start.
CoreFlags
Opt-in behaviors that change the defaults. Every flag is off by default.
Pass it as AppConfig(flags: ...).
CORSConfig
Crypt
Encrypt and decrypt with the APP_KEY of the app (AES-256-GCM).
Old keys in AppConfig.previousKeys can still decrypt.
CryptCacheEncrypter
The default CacheEncrypter of a Dox app. It uses Crypt , so the
APP_KEY of the app is the key, and AppConfig.previousKeys can still
decrypt old entries.
CsrfMiddleware
Stops cross site request forgery (CSRF).
CustomServer
A server that binder opens, with the dart:io HttpServer API:
dart:io itself, or another package.
DataPath
Reads values from nested maps and lists.
DateFormatted
The text must be a real date in format : @DateFormatted('Y-m-d').
(Not named DateFormat, so it does not clash
with package:intl.)
DateSchema
Schema for DateTime . Made by v.date().
DateTimeStringRule
Text must be an ISO 8601 date time.
Declined <T >
The value must be false, 0, '0', 'false', 'no' or 'off':
@Declined().
DecryptException
Thrown when encrypted text can not be decrypted.
The text was changed, cut, or made with another key.
Dox answers with 400 Bad Request. With CoreFlags.decryptServerError
it answers 500 Server Error, and the ExceptionHandler reports it.
DefaultMessages
Default English message templates.
DefaultSchema <O >
Uses a default value when the input is missing. Made by .defaultTo().
Describe
A short text about the field. It goes into the JSON Schema as
description, so OpenAPI docs and MCP tools show it. It does not
change the checks.
Description
Longer text of the route in the docs.
The default is the rest of the /// doc comment.
Different <T >
The value must not equal the key other in the same object:
@Different('old_password'). It compares the
raw input like Same . A missing other passes.
Digits
The text must be only digits (0-9), exactly length of them:
@Digits(6). Use a String field, so leading
zeros are kept.
DigitsBetween
The text must be only digits (0-9), from min to max of them:
@DigitsBetween(4, 6).
Dimensions
A PNG, GIF, WebP or JPEG image whose width and height (in pixels) fit
every limit given. ratio is width / height, like 3 / 2.
DimensionsRule
The file must be a PNG, GIF, WebP or JPEG image whose size fits every
limit given. See ImageSize.fits .
DownloadableFile
Dox
DoxController
Marks a class as a controller for the OpenAPI docs.
DoxCookie
DoxEnv
Marks a typed env class. dox_builder writes _$<Class> for it.
DoxModel
DoxProvider
A provider sets up a part of the app when it starts, eg. the database,
Redis or the auth guards. Dox finds every class that extends it (with
dox_builder) and runs it in every isolate.
DoxRequest
DoxResponse
Dto
Marks a class as a DTO: typed, checked input.
DtoChecks
Checks used by the generated DTO code.
DtoErrors
Errors added by the validate(DtoErrors errors) method of a DTO.
DtoRegistry
Finds a DTO schema by its type or class name.
DtoSchema <T >
The checks, the converter and the JSON Schema of one @Dto class.
DtoState
The state of one DTO check. The generated code of a DTO calls it.
Email
An email address.
EmailRule
Text must be an email address.
EndsWith
The text ends with suffix .
EndsWithRule
Text must end with suffix .
EnumSchema <T >
Value must be one of values . Made by v.enumOf().
Env
EnvKey
Reads a getter from this env key, not from the UPPER_SNAKE getter name.
EnvReader
Reads and converts env values for a @DoxEnv() class.
ETag
Adds an ETag header to GET and HEAD answers, and answers
304 Not Modified with no body when the client already has the same
answer (its If-None-Match header has the same ETag).
ExceptionHandler
The one place that turns a thrown error into a response.
ExcludeIf
Skip the field when the key other has value :
@ExcludeIf('type', 'person'). Then no check of
the field runs, and it gets its default (or null, or
Maybe.missing()), as if it was not sent. When other is missing,
the field is not skipped. other is read from the raw input and
matches like in RequiredIf . Use it on a nullable field, a Maybe
field or a field with a default.
ExcludeSchema <O >
Leaves the key out of an object when condition applies. Made by
.excludeIf() and .excludeUnless(). The object schema checks
condition before the field, so the wrappers around it do not
matter. Anywhere else it only runs inner .
ExcludeUnless
Skip the field unless the key other has value :
@ExcludeUnless('type', 'company'). A
missing other counts as null, so the field is skipped then.
See ExcludeIf .
ExcludeWhen
Base of ExcludeIf and ExcludeUnless . The fluent .excludeIf() and
.excludeUnless() use them too.
ExistsRule <T >
A row in table has this value in column .
Made by v.string().exists('teams'). Use parseAsync.
FieldCompare <T extends num >
Base of the rules that compare a number with the key other in the
same object. The raw other must be a number
(or number text); else the check fails.
FileExtensionRule
The file must be one of the types extensions , like ['pdf'].
The real type comes from the first bytes of the file (see FileTypes ).
FileInput
An uploaded file the validator can check.
FileSchema
Schema for uploaded files. Made by v.file().
The value must implement FileInput .
FileTypes
Finds the real type of a file from its first bytes ("magic bytes").
Filled
When the key is sent, it must have a value: not null, not blank
text, not an empty list. A missing key passes.
ForbiddenHttpException
403 Forbidden: the user is known, but may not do this.
GlobalMiddleware
Middleware that packages add at startup. dox_core puts them in
front of the app's own globalMiddleware.
GreaterThan
Greater than value (exclusive).
GreaterThanField <T extends num >
Greater than the key other : @GreaterThanField('min_price').
The code is greater_than.
GreaterThanOrEqualField <T extends num >
Greater than or equal to the key other :
@GreaterThanOrEqualField('min_price').
The code is min.
GreaterThanRule <N extends num >
Number must be greater than min .
GrpcStream
One gRPC call on an HTTP/2 stream of the server. dox_grpc reads the
request and writes the answer through it. Each ServerAdapter that
speaks HTTP/2 has its own kind (see ServerAdapter.grpcStream ).
Hash
HealthCheck
The controller of Route.health(). It runs the checks at the same
time and answers:
HexColor
The text must be a hex color: # and 6 hex digits, like #1a2b3c.
Both cases pass. @HexColor(short: true) also takes 3 digits (#abc).
It is strict on purpose (no 4 or 8 digit forms), because most apps
store #rrggbb.
HttpStatusException
An error answer with any status code, and optional headers.
IAuth
IAuthMiddleware
A middleware that logs a user in.
IDoxMiddleware
IDoxNextMiddleware
A class middleware that runs code before and after the controller.
IDoxRequest
IDoxTerminableMiddleware
A middleware that runs code after the answer is sent to the client.
Good for work the client should not wait for: logs, metrics, cleanup.
IHttpException
Image
An image: jpg, jpeg, png, gif, webp or bmp. Not svg.
ImageSize
The width and height of an image, read from the first bytes only.
In
One of values . Works for text and numbers.
IncludesRule
Text must contain text .
Info
The info block of the document.
Inject
Puts a class in the Dox container. dox_builder finds it and writes
lib/generated/container.g.dart, so you never register it by hand.
InternalErrorException
IntSchema
Schema for whole numbers. Made by v.int().
Invalid
Marks a value that failed its type check.
IocContainer
The Dox container. It makes your classes and gives their
constructors what they need.
Ip
An IPv4 or IPv6 address.
IpRule
Text must be an IPv4 or IPv6 address. Same check as the DTO @Ip.
IsolateBus
Sends messages between the isolates of one Dox app.
IssueCodes
Codes used in ValidationIssue.code .
IssueMaps
Helpers to group issues by path.
JSON
Small helper to turn data into JSON and JSON back into data.
Json
The text must be valid JSON: @Json().
JsonObjectWriter
Writes the JSON of the objects of another class.
JsonReadable
Gives one key of toJson(), with no map.
JsonRun
A fixed part of JSON, as UTF-8 bytes, ready to write.
JsonSchemaTools
Small helpers for building JSON Schema maps.
JsonWritable
A class that writes its own JSON.
JsonWriter
Writes one JSON object, one piece at a time, with no Map in between.
KeyDerivation
Makes keys for one purpose from one secret, with HKDF-SHA256
(RFC 5869).
Length
Number of characters: @Length(min: 3, max: 50). Give one or both.
LengthRule
Text must have exactly length characters.
LessThan
Less than value (exclusive).
LessThanField <T extends num >
Less than the key other : @LessThanField('max_price').
The code is less_than.
LessThanOrEqualField <T extends num >
Less than or equal to the key other :
@LessThanOrEqualField('max_price').
The code is max.
LessThanRule <N extends num >
Number must be less than max .
ListSchema <T >
Schema for a list where every item matches item . Made by v.list().
ListText
Helper to make a short, readable text from a list of values.
LiteralSchema <T >
Value must equal value . Made by v.literal().
Logger
LoggerConfig
LogMiddleware
Lowercase
Make the text lower case.
MapSchema <V >
Schema for a map with any keys, where every value matches values .
Made by v.map(). Keys are checked with keys when given.
Max
At most value .
MaxItems
At most value items.
MaxItemsRule <T >
List may have at most max items.
MaxLength
At most value characters.
MaxLengthRule
Text may have at most max characters.
MaxRule <N extends num >
Number may be at most max .
MaxSize
At most size , like '2MB'. Units: B, KB, MB, GB.
MaxSizeRule
The file may be at most bytes long.
Maybe <T >
A value that knows "missing" from null. Use it for PATCH input.
MessageRequest
Everything a MessageResolver needs to build one message.
MessageResolver
Turns issue codes into messages.
MethodNotAllowedHttpException
405 Method Not Allowed. allow is sent in the Allow header.
Dox throws it when the path has routes, but not for this method.
MethodOverride
Lets a plain HTML form reach a Route.put, Route.patch or
Route.delete route. A form can only send GET or POST, so it sends
POST with a _method field:
Mimes
One of the file types types (extensions, like pdf).
The real type comes from the first bytes of the file.
MimesRule
The file must be one of types (extensions, like pdf). Same check
as FileExtensionRule , with the mimes code and message of @Mimes.
MimeTypes
One of the MIME types types , like image/png or image/*.
The real type comes from the first bytes of the file, not from the
content type the client sent.
MimeTypesRule
The file must be one of mimeTypes , like image/png or image/*.
The real type comes from the first bytes of the file, not from the
content type the client sent (see FileTypes.matchesMimeTypes ).
Min
At least value .
MinItems
At least value items.
MinItemsRule <T >
List must have at least min items.
MinLength
At least value characters.
MinLengthRule
Text must have at least min characters.
MinRule <N extends num >
Number must be at least min .
MinSize
At least size , like '10KB'. Units: B, KB, MB, GB.
MinSizeRule
The file must be at least bytes long.
MultipleOfRule <N extends num >
Number must be a multiple of factor .
Name
The input key of this field. Default: the field name in snake_case.
NotFoundHttpException
NotIn
Not one of values . Works for text and numbers.
NullableSchema <O >
The value may be null. Made by .nullable().
NumSchema
Schema for any number. Made by v.num().
ObjectSchema
Schema for a map with known keys. Made by v.object().
The output is a new Map<String, dynamic>.
OpenApi
Builds an OpenAPI 3.1 document from Info and an ApiDoc.
OpenApiConfig
OpenAPI docs for the app: /docs, /openapi.json and /openapi.yaml.
OpenApiDocument
Builds the OpenAPI document from the registered routes and serves it.
OpenApiOperation
Docs of one controller method, made at build time by dox_builder.
OpenApiRegistry
Everything dox_builder found in the app: controller methods,
route calls, model schemas and login schemes. The generated file
makes one.
OpenApiRouteBinding
A Route.get('path', controller.method) call the builder found.
It tells which class a route handler belongs to.
OpenApiSecurity
A login scheme from @Security on a middleware class.
OptionalSchema <O >
The value may be missing. Made by .optional().
OrDefault
A bad value gives the default of the field (or null), not an error.
For query strings that old links may get wrong, like ?page=abc.
ParseResult <O >
The result of safeParse.
ParseState
Data shared by every schema during one parse call.
Password
A strong password: a minimum length, plus the character kinds you ask for.
Patterns
Regular expressions shared by string rules.
PayloadTooLargeException
Thrown when a request body is bigger than the configured limit.
Dox answers with 413 Payload Too Large.
PortConfig
One more port of the app with its own http2 and tls , for
AppConfig.ports.
Positive
Greater than 0.
PresenceVerifier
Finds values in a database table, for ExistsRule and UniqueRule .
Present
The key must be sent. Its value may be empty or null.
Processors
Finds how many CPUs this process may really use.
Prohibited
The key must be missing, or blank text: @Prohibited().
A key with null,
[], {}, 0 or false fails, "" and " " pass. It reads the
raw input, so it runs before the type check.
ProhibitedIf
When the key other has value , the field must be missing or
empty: @ProhibitedIf('type', 'guest').
Empty: null, blank text, an empty list or map. 0 and false fail.
other matches like in RequiredIf . Give a list for many values.
Query
Like Request , but always the query. Each field is one parameter.
QueryException
Range
From min to max .
RateLimit
Lets a client send at most max requests in each per window.
One more request gets 429 Too Many Requests with a Retry-After
header (seconds). Every answer has X-RateLimit-Limit and
X-RateLimit-Remaining.
RedisOptions
RefineRule <T >
Rule made by .refine() and .refineAsync().
Regex
The whole text must match pattern . No ^ and $ needed.
RegexRule
Text must match pattern .
Request
The request class of the route: a @Dto class,
for example @Request(CreateUser). It goes in the body for POST,
PUT and PATCH, and in the query for the other methods.
Use it when the builder can not find it by itself.
RequestBody
The body of a request, read once.
RequestFile
An uploaded file from a multipart/form-data request.
RequestId
Gives each request an id. It is sent back in the X-Request-Id
header and can be read as req.requestId. LogMiddleware lines and
the error reports of ExceptionHandler show it.
RequestTimeout
Answers 503 Service Unavailable when the rest of the middleware
and the controller take longer than duration .
RequestValidator
Checks request input with a DTO or a fluent schema.
RequiredIf
Required when the key other has value :
@RequiredIf('type', 'company'). Give a list for many values:
@RequiredIf('type', ['company', 'shop']).
RequiredUnless
Required unless the key other has value :
@RequiredUnless('type', 'guest'). Give a list for many values.
A missing other counts as null, so the
field is required then. other matches like in RequiredIf .
RequiredWhen
Base of RequiredIf , RequiredWith and the other Required* rules.
The field is required only when appliesTo is true. Use them on a
nullable field, a Maybe field or a field with a default.
RequiredWhenIssue
The issue of a failed RequiredIf or RequiredWith : code, default
message and params. DTOs and .optional().requiredIf() share it.
RequiredWith
Required when any of the keys others is present and not empty:
@RequiredWith(['phone']). others are keys in the same object.
RequiredWithout
Required when any of the keys others is missing or empty:
@RequiredWithout(['email']).
RequiredWithoutAll
Required when all of the keys others are missing or empty:
@RequiredWithoutAll(['email', 'phone']).
Response
One response of the route. Add it more than once for more status codes.
ResponseDoc
Docs for one response of a route.
ResponseHandlerInterface
Route
RouteBinding
one binder added with Route.bind
Router
coverage:ignore-file
Rule <T >
A reusable check for one value.
RuleContext
What a rule can see and do while it runs.
Same <T >
The value must equal the key other in the same object:
@Same('password').
ScalarOptions
Options for the Scalar docs page.
Schema <O >
Base class of every schema. O is the output type.
SchemaConstants
Values for the Standard Schema interface and JSON Schema export.
Security
How to log in to the routes that use this middleware class.
Adds security headers to every answer. Each header has a safe
default. Give your own value to change it, or null to turn it off.
null also removes a header that the server sends by default, like
X-Frame-Options: SAMEORIGIN.
SecurityScheme
A way to log in, placed under components/securitySchemes.
Serialize
Makes dox_builder write fast JSON code for a class.
Serializer <T >
SerializeWriter
The JSON writer that @Serialize() makes for one class.
Server
One server the API runs on.
ServerAdapter
The work that differs between HTTP servers under Dox. A server
package extends it, and the app gives it to
Dox().startServer(server:). Dox opens each port with bind , with
the settings of AppConfig.
ServerFile
A file the server opened, to send with no byte through Dart (eg.
sendfile). Each ServerAdapter has its own kind.
ServerSettings
The settings of one port. Dox makes them from AppConfig (and the
http2 and tls of the port), and gives them to
ServerAdapter.bind .
ServerTiming
Adds a Server-Timing header to the answer. The browser dev tools
show it in the Network tab.
ServerTls
The certificate and key files of a port with TLS.
Session
The session of one request: req.session. SessionMiddleware makes
it.
SessionConfig
Settings of the session, see SessionMiddleware.
SessionMiddleware
Gives each request a session (req.session) and saves it after the
controller. Settings come from AppConfig.session.
StandardIssue
One problem found during validation.
StandardResult <O >
The result of StandardSchema.validate .
StandardSchema <I , O >
A common interface for validators, based on https://standardschema.dev .
StartsWith
The text starts with prefix .
StartsWithRule
Text must start with prefix .
StreamFile
A file to send as a stream, from a controller.
The body is not loaded into memory.
StrictConfig
Strict mode: warnings for code that blocks the server. Use it in
development. Dart runs one thing at a time in an isolate, so a slow
sync call (bcrypt, a PDF, an image) makes every other request on that
isolate wait. When on, Dox writes a [strict] warning to stderr when:
StringSchema
Schema for text. Made by v.string().
Summary
Short title of the route in the docs.
The default is the first line of the /// doc comment.
SuperRefineRule <T >
Rule made by .superRefine() and .superRefineAsync().
The function adds issues itself with context.addIssue().
Tags
Tags that group the route in the docs page.
TlsOptions
The certificate and key files of a TLS (HTTPS) port.
TokenMismatchException
Thrown by CsrfMiddleware when the CSRF token of a request is
missing or wrong. Dox answers with 419.
TooManyRequestsException
Thrown when a client sends too many requests, eg. by RateLimit .
Dox answers with 429 Too Many Requests.
TransformSchema <I , O >
Changes the output after the inner schema passes.
Made by .transform(). JSON Schema shows the input shape.
Trim
Remove spaces at the start and the end.
Ulid
The text must be a ULID: 26 Crockford base32 characters, any case.
@Ulid().
Undefined
Marks a value that is not there at all, like a missing map key.
UnionSchema <O >
The value must match one of options . The first match wins.
Made by v.union().
UniqueItems
No item twice.
UniqueRule <T >
No row in table has this value in column .
Made by v.string().unique('users'). Use parseAsync.
UnsupportedMediaTypeException
Thrown when a DTO reads a body of a type Dox can not read
(not JSON, not form data). Dox answers with 415.
Uppercase
Make the text upper case.
Url
An http or https url with a host.
UrlRule
Text must be a URL with a scheme and a host, like https://x.dev.
Uuid
A UUID, any version.
UuidRule
Text must be a UUID.
ValidateSignature
Answers 403 Forbidden when the url of the request has no valid
signature, or its expires time is past. Make such urls with
Route.signedUrl.
ValidationException
ValidationFlags
Opt-in behaviors of dox_validation. Each one is off by default.
ValidationIssue
One validation problem.
Validator
Makes schemas. Use the top-level v.
Properties
uuid
→ Uuid
final
Functions
abort (int code , [dynamic message , ])
→ Never
Stop the request and answer with code.
back (DoxRequest req , {String fallback = '/' })
→ DoxResponse
A 302 redirect to the page the request came from (the Referer
header), or to fallback when there is none.
defaultErrorPage (int status , Object error , StackTrace stackTrace , bool debug )
→ String
The default error page: a small HTML page with the status and its
title, like 404 Not Found. With debug, it also shows the error
text and the stack trace. It loads no files from outside.
isWebSocketUpgrade (HttpRequest req )
→ bool
true when req asks for a WebSocket upgrade, on either server
redirect (String url , {int status = HttpStatus.found })
→ DoxResponse
A redirect to url. 302 by default.
response ([dynamic content ])
→ DoxResponse
content can be anything
String, int, Map, json serializable object, Stream<List<int>>, File
route (String name , {Map <String , Object ? > params = const <String, Object?>{} , Map <String , Object ? > query = const <String, Object?>{} , bool absolute = false , String ? baseUrl })
→ String
the path of the route named name, see Route.url .
sameHostUrl (String ? url , String ? host )
→ String ?
url when it points to the same host as the host header, else null.
showErrors ()
→ bool
True when APP_ENV is development or local. Then error text may
be sent to the client. Dox uses this rule for its own error answers.
Use it when your code sends errors itself, so it follows the same rule.
upgradeWebSocket (HttpRequest req , {String ? protocol , int maxMessageSize = 16 * 1024 * 1024 })
→ Future <WebSocket >
Accepts the WebSocket upgrade of req on the server Dox runs on
(dox_http_native, or the server of startServer(server:)). For the raw handler of a
Route.mount (like Socket.IO): Route.websocket does this itself.
protocol is the subprotocol to answer with. A message or frame over
maxMessageSize bytes closes the socket with 1009.
webSocketOriginAllowed (String ? origin , String ? host , List <String > allowedOrigins )
→ bool
true when a WebSocket upgrade with this origin may open.
Typedefs
apiDeprecated
= ApiDeprecated
apiIgnore
= ApiIgnore
AsyncCheckFunction <T >
= Future <bool > Function(T value )
Signature for an async check.
AsyncSuperCheckFunction <T >
= Future <void > Function(T value , RuleContext context )
Signature for an async check that adds its own issues.
body
= Body
CheckFunction <T >
= bool Function(T value )
Signature for a simple check.
description
= Description
doxController
= DoxController
Makes the HTML of the error page, see AppConfig.htmlErrors.
status is the HTTP status. debug is true when APP_ENV is
development or local: then the page may show the error text and
the stackTrace. Escape every value you put in the page.
FallbackCondition
= bool Function(HttpRequest req )
true when a Route.fallback with when should answer req
HealthCheckFunction
= FutureOr <Object ? > Function()
One health check. It fails when it throws, returns false, or takes
longer than the timeout.
IocFactory <T >
= T Function(IocContainer c )
Makes one object for the container. It gets the container, so it can
ask for the objects it needs.
Next
= Future <DoxResponse > Function()
Runs the rest of the middleware and the controller. It gives the
response. An error on the way is already turned into its error
response by the ExceptionHandler.
NextMiddlewareFunction
= FutureOr Function(DoxRequest req , Next next )
A function middleware that runs code before and after the controller.
query
= Query
RateLimitKey
= String Function(DoxRequest req )
Gives the name of the client to count requests for, eg. its ip.
RawRequestHandler
= Future <void > Function(HttpRequest request )
raw handler for every request under a path prefix, see Route.mount
request
= Request
RouteBinder <T >
= FutureOr <T? > Function(String value )
turns the raw text of a route param into a value, like a model.
null means not found: the request gets 404.
RouteErrorRenderer
= DoxResponse ? Function(Object error , DoxRequest req )
Gives the response for an error of a route, see
Route.renderErrorsWith . null: Dox renders it as usual.
ServerBinder
= Future <HttpServer > Function(int port , Object ? address )
Opens the HTTP server of one port, for CustomServer .
address is AppConfig.host (or APP_HOST), null for all interfaces.
summary
= Summary
SuperCheckFunction <T >
= void Function(T value , RuleContext context )
Signature for a check that adds its own issues.
tags
= Tags
WebSocketHandler
= FutureOr <void > Function(WebSocket socket , DoxRequest req )
gets the open socket of a Route.websocket request