Skip to content

feat(server): introduce ServeConfig dataclass to consolidate serve() kwargs #414

@bokelley

Description

@bokelley

Context

serve() now has roughly 15 keyword arguments: validation, asgi_middleware, enable_debug_endpoints, debug_traffic_source, base_url, specialisms, description, mock_ad_server, etc. The signature is noisy, hard to read, and IDE autocomplete is unwieldy.

Group these into a ServeConfig dataclass with sensible defaults. Keep backwards compatibility — both serve(handler, config=ServeConfig(...)) and serve(handler, **kwargs) should work.

Acceptance Criteria

  • ServeConfig dataclass exported from adcp.server
  • Both serve(handler, config=ServeConfig(...)) and serve(handler, **kwargs) call patterns work
  • All examples updated to use ServeConfig
  • IDE help / signature is dramatically cleaner

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions