Changes for version 1.7.0 - 2026-08-29

  • FEATURE
    • File uploads: a request body with Content-Type multipart/form-data is now parsed (per RFC 7578) instead of unconditionally failing JSON decode and hard-rejecting with 422 before any handler or dependency ran. New PAGI::FastAPI::Context methods: form_data(), uploaded_files(), uploaded_file().
    • Background tasks: new $c->background(async sub {...}) on PAGI::FastAPI::Context for fire-and-forget work that keeps running after the response has been sent. Retention is owned by the application (not the request), a failing task is logged rather than crashing anything, and any still-pending tasks are drained on PAGI Lifespan shutdown before on_shutdown callbacks run.
    • Per-route OpenAPI metadata: get/post/put/patch/delete now accept tags, summary, description, deprecated, and a responses => {...} map (merged over, not replacing, the existing default 200/422 entries), threaded into the generated OpenAPI document for that route. summary still defaults to "$method $path" when omitted.
    • PAGI::FastAPI::Context now includes a file() method for returning file responses with configurable MIME types and attachment headers.
    • Swagger UI rendering now accepts an injectable $swagger_ui_parameters configuration hash during app instantiation.
    • Added $swagger_ui_css_url and $swagger_ui_bundle_url constructor attributes, allowing developers to override CDN links or serve Swagger UI assets locally.
  • BUGFIX
    • PAGI::FastAPI->new's default 'version' (when not explicitly passed) was the blessed version object itself rather than a plain string, which crashed encode_json on /openapi.json for any app that didn't pass an explicit version. Found via testing the OpenAPI metadata feature above; unrelated to it otherwise.
    • Resolved random visual shuffling of endpoints in the /docs UI by explicitly defaulting operationsSorter to 'method' and tagsSorter to 'alpha'.
  • TESTING
    • Added the following unit tests to cover new features added:
      • t/37-multipart_file_uploads.t
      • t/38-background_tasks.t
      • t/39-openapi_route_options.t
  • EXAMPLES
    • Added the following applications to demo new features:
      • eg/background_demo.pl
      • eg/docs_demo.pl
      • eg/file_uploads_demo.pl

Documentation

Modules

Asynchronous, Type-Safe Micro-Framework with Dependency Injection and OpenAPI & Swagger UI
Base Interface for PAGI::FastAPI Bot Protection
Stateless Proof-of-Work Bot Mitigation Engine
Request and Response Lifecycle Context for PAGI::FastAPI
Request Cookie Parsing Helper for PAGI::FastAPI
Dependency Injection Wrapper for PAGI::FastAPI
Asynchronous Proof-of-Work Bot Protection Middleware for PAGI::FastAPI
Typed Exception-to-Handler Dispatch for PAGI::FastAPI
Async Rate Limiting Middleware for PAGI::FastAPI
Pluggable Async Message Queue Facade for PAGI::FastAPI
Abstract Base Class for Message Queue Storage Drivers
Default In-Memory Storage Driver for PAGI::FastAPI::Queue
Abstract Base Class for Rate Limiting Storage Drivers
Default In-Memory Storage Driver for Rate Limiting
Base HTTP Response Class for PAGI::FastAPI
File Download Response for PAGI::FastAPI
HTML Response Class for PAGI::FastAPI
HTTP Redirect Response for PAGI::FastAPI
Server-Sent Events (SSE) Streaming Response for PAGI::FastAPI
Response Shape Validation and Filtering for PAGI::FastAPI
Path Parameter Validation for PAGI::FastAPI