Skip to content

Add a ResponseHandler<T> seam with lazy parse-once ParsedResponse<T> #36

Description

@OmarAlJarrah

Problem

There's no clean raw-vs-parsed response seam; header/status access always sits in front of (or forces) deserialization.

Proposed change

Add a fun interface ResponseHandler<T> plus ParsedResponse<T> (or Response.parseable { }) with by lazy parse-once memoization. Ship dep-free String/Empty handlers in core; the JSON handler (jsonHandler(serde, Class<T>)) lives in the adapter. Document that parse() consumes/closes the body, so raw headers must be read first. This is the seam generated services dispatch against.

Acceptance

  • Raw header/status access without parsing
  • Parse-once memoized
  • Tests + apiDump

Dependencies


Priority: medium · Effort: small

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsdk-coresdk-core toolkit

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions