server_auth library
OpenAPI generation for composed server_auth plugin registries.
Classes
- ApiBody
- Describes the request body for a handler.
- ApiDeprecated
- Marks a handler as deprecated in the OpenAPI spec.
- ApiHidden
- Hides a handler from the generated OpenAPI spec.
- ApiParam
- Describes a path, query, header, or cookie parameter for a handler.
- ApiResponse
- Describes a possible response for a handler.
- AuthPluginOpenApiConfig
- OpenAPI generation settings for a composed auth plugin registry.
-
AuthPluginOpenApiGenerator<
TContext> - Generates an OpenAPI 3.1 document from a frozen auth plugin registry.
- BodySchema
- Describes a request body schema.
- Description
- Marks a handler with an OpenAPI description (detailed explanation).
- ExtractedRouteMetadata
- Partial OpenAPI metadata extracted from handler declarations.
- HandlerIdentity
- Identifies a route handler for cross-referencing between runtime registration and static analysis.
- OpenApiComponents
- Reusable OpenAPI components.
- OpenApiConfig
- Configuration for the OpenAPI spec generation.
- OpenApiInfo
- Metadata about the API.
- OpenApiMediaType
- A media type with its schema.
- OpenApiOperation
- A single API operation (e.g. GET /users).
- OpenApiParameter
- A parameter (path, query, header, or cookie).
- OpenApiPathItem
- Describes the operations available on a single path.
- OpenApiRequestBody
- Describes a request body.
- OpenApiResponse
- Describes a response for a status code.
- OpenApiSecurityScheme
- An OpenAPI security scheme used by operation security requirements.
- OpenApiServer
- A server URL template.
- OpenApiSpec
- Root of an OpenAPI 3.1 specification document.
- OpenApiTag
- An OpenAPI tag for grouping operations.
- OperationId
- Sets the OpenAPI operationId for a handler.
- ParamSchema
- Describes a path, query, header, or cookie parameter.
- PipeRuleSchemaConverter
- Converts validation pipe-rule maps into JSON Schema objects.
- ResponseSchema
- Describes a response for a given status code.
- RouteSchema
- Describes the schema for a single route's request/response contract.
- Summary
- Marks a handler with an OpenAPI summary (short description).
- Tags
- Assigns one or more OpenAPI tags to a handler.
Enums
- AuthOpenApiSessionSecurity
- Transport advertised for session-authenticated plugin operations.
- ParamLocation
- Location of an API parameter in the HTTP request.
Extensions
-
AuthServerPluginRegistryOpenApi
on AuthServerPluginRegistry<
TContext> - Generates an OpenAPI 3.1 document for this composed plugin registry.
- OpenApiRouteBuilderExtensions on RouteBuilder
-
Fluent OpenAPI metadata extensions for
RouteBuilder.
Constants
-
openApiSchemaKey
→ const RouteMetadataKey<
RouteSchema> - Route metadata key used by the OpenAPI integration.
Functions
-
enrichManifestWithProjectMetadata(
RouteManifest manifest, {required String projectRoot, required String packageName}) → Future< RouteManifest> - Enriches a manifest with annotation and Dartdoc metadata from project files.
-
extractRouteMetadataFromSource(
String source, {Iterable< String> sourcePaths = const <String>[]}) → Map<String, ExtractedRouteMetadata> -
Extracts route metadata from a Dart
sourcestring. -
extractRouteMetadataIndex(
BuildStep buildStep) → Future< Map< String, ExtractedRouteMetadata> > -
Extracts route metadata from Dart assets visible to
buildStep. -
extractRouteMetadataIndexFromFileSystem(
{required String projectRoot, required String packageName}) → Future< Map< String, ExtractedRouteMetadata> > - Extracts route metadata from Dart source files in a package directory.
-
manifestToOpenApi(
RouteManifest manifest, {OpenApiConfig config = const OpenApiConfig()}) → OpenApiSpec -
Converts a
RouteManifestinto an OpenApiSpec. -
mergeManifestWithExtractedMetadata(
RouteManifest manifest, Map< String, ExtractedRouteMetadata> extracted) → RouteManifest - Merges extracted handler metadata into a runtime route manifest.
-
openApiBuilder(
BuilderOptions options) → Builder -
Factory function registered in
build.yaml. -
schemaValidationMiddleware(
RouteSchema schema) → Middleware - Creates a middleware that automatically validates incoming request data against a RouteSchema's validation rules.
Exceptions / Errors
- AuthOpenApiContractException
- A composition error that would make generated auth clients ambiguous.