dox_core
library
Classes
AESEncryptor
Encrypt and decrypt text with AES-GCM.
After
After date (exclusive). An ISO 8601 date, or 'now'.
AfterOrEqualRule
Date must be on or after date .
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.
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
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). An ISO 8601 date, or 'now'.
BeforeOrEqualRule
Date must be on or before date .
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 .
Cache
Cache facade on top of dox_cache.
CacheConfig
Cache settings.
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.
CORSConfig
DataPath
Reads values from nested maps and lists.
DateSchema
Schema for DateTime . Made by v.date().
DateTimeStringRule
Text must be an ISO 8601 date time.
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.
DefaultMessages
Default English message templates.
DefaultSchema <O >
Uses a default value when the input is missing. Made by .defaultTo().
Description
Longer text of the route in the docs.
The default is the rest of the /// doc comment.
Disk
The public API for one storage disk.
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
DoxRequest
DoxResponse
DoxService
DoxShutdown
Add this to a service that must clean up when the server stops, eg.
close database or Redis connections. It runs in every isolate, after
the open requests are done (on SIGTERM, SIGINT or Dox().stop()).
DriveManager
Holds named disks and picks the right one.
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.
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").
GreaterThan
Greater than value (exclusive).
GreaterThanRule <N extends num >
Number must be greater than min .
Hash
IAuth
ICacheDriver
IDox
IDoxMiddleware
IDoxRequest
IDoxWebsocket
IHttpException
Image
An image: jpg, jpeg, png, gif, webp or bmp. Not svg.
In
One of values . Works for text and numbers.
IncludesRule
Text must contain text .
Info
The info block of the document.
InternalErrorException
IntSchema
Schema for whole numbers. Made by v.int().
Invalid
Marks a value that failed its type check.
IocContainer
Ip
An IPv4 or IPv6 address.
IpRule
Text must be an IPv4 address.
IssueCodes
Codes used in ValidationIssue.code .
IssueMaps
Helpers to group issues by path.
IStorageDriver
JsonSchemaTools
Small helpers for building JSON Schema maps.
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).
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().
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.
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.
Mimes
One of the file types types (extensions, like pdf).
The real type comes from the first bytes of the file.
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 .
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 and model schemas. 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.
OptionalSchema <O >
The value may be missing. Made by .optional().
ParseResult <O >
The result of safeParse.
ParseState
Data shared by every schema during one parse call.
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.
Positive
Greater than 0.
Query
Like Request , but always the query. Each field is one parameter.
QueryException
Range
From min to max .
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.
RequestFile
An uploaded file from a multipart/form-data request.
RequestValidator
Checks request input with a DTO or a fluent schema.
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
Router
coverage:ignore-file
Rule <T >
A reusable check for one value.
RuleContext
What a rule can see and do while it runs.
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.
SecurityScheme
A way to log in, placed under components/securitySchemes.
Serializer <T >
Server
One server the API runs on.
SocketAdapterFactory
Makes a Socket.IO Adapter inside each isolate. A Redis connection can
not be sent to another isolate, so it is made where it is used.
SocketIoConfig
Socket.IO on the Dox HTTP port, at /socket.io/. Off by default.
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 .
Storage
Storage facade on top of dox_storage.
StorageConfig
Storage disks for Storage().
StorageDiskFactory
Builds a dox_storage DriveManager from a StorageConfig .
StreamFile
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.
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.
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.
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.
ValidationException
ValidationIssue
One validation problem.
Validator
Makes schemas. Use the top-level v.
WebsocketEvent
Properties
uuid
→ Uuid
final