Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: have an option omit status OR headers OR both from fetch response #1836

Open
camillecroci opened this issue Jan 20, 2025 · 0 comments
Labels
fetch Fetch client related issue

Comments

@camillecroci
Copy link

Hello !

Context

I started working with Orval 7.1.1. I have written a custom fetch function that was a variation around the provided example:

export const customFetch = async <T>(path: string, options: RequestInit): Promise<T> => {
    // ...
    return { status: response.status, data } as T
}

A recent PR also adds headers to the response.

Problem

The headers of my responses can be quite big and I would prefer not to return them.
It is possible to use the flag includeHttpResponseReturnType to stop getting headers in the response, but it also remove status, which I need.

Feature request

It would be nice to have 2 flags or have includeHttpResponseReturnType being able to be set to none, status, headers. That would allow to have none of them, or only headers, or only status returned.

@melloware melloware added the fetch Fetch client related issue label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetch Fetch client related issue
Projects
None yet
Development

No branches or pull requests

2 participants