Skip to content

Conversation

alukach
Copy link
Member

@alukach alukach commented Oct 14, 2025

What I am changing

Allow middleware to be written with an expected_data_type argument to determine if the JSON should be processed. This is useful in order to ignore API endpoints that don't return dictionaries (e.g. STAC FastAPI's bulk-insert which returns a str)

…or transformation

- Added `expected_data_type` attribute to `JsonResponseMiddleware` to specify the type of JSON responses to transform.
- Implemented logic to skip transformation for unexpected data types, with appropriate logging.
- Introduced example middleware classes for handling string, list, and any JSON response types, demonstrating the new functionality.
- Updated tests to validate behavior for various expected data types and transformation scenarios.
@github-actions github-actions bot added the feat label Oct 14, 2025
@alukach alukach merged commit 16b05c3 into main Oct 14, 2025
3 checks passed
@alukach alukach deleted the feat/skip-json-middleware-based-on-response-data-type branch October 14, 2025 19:07
alukach pushed a commit that referenced this pull request Oct 14, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](v0.9.2...v0.10.0)
(2025-10-14)


### Features

* skip json middleware based on response data type
([#103](#103))
([16b05c3](16b05c3))
* support customizing port when running as a module
([9a18c49](9a18c49))


### Documentation

* **config:** add admonitions for more details
([40444cf](40444cf))
* **config:** cleanup formatting
([8a82d3d](8a82d3d))
* update tips to describe non-upstream URL
([ebadd52](ebadd52))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: ds-release-bot[bot] <116609932+ds-release-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant