Skip to content

Handle encoding and decoding errors in a middleware-like extension point #522

Open
@jpsim

Description

@jpsim

Question

I'd like to add telemetry to my app to report issues where an API response is missing a required key or otherwise has decoding errors. Ideally I could write middleware to achieve this, but from what I've been able to tell, middleware can't intercept decoding errors.

In a perfect world, the server handling the API requests would always return 100% spec-compliant responses, never introducing breaking changes, but mistakes happen.

How would you suggest I add this telemetry to my client application using swift-openapi-*?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/runtimeAffects: the runtime library.kind/enhancementImprovements to existing feature.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions