openapi-typescript-fetch icon indicating copy to clipboard operation
openapi-typescript-fetch copied to clipboard

Optional args instead of Record<string, never>

Open ierehon1905 opened this issue 2 years ago • 1 comments

Hi, thank you for your cool library.

I was wondering if it is possible to make arg parameter optional when there are no arguments (or there may be none) instead of Record<string, never>.

Right now we have to write

const getMe = fetcher
    .path('/my')
    .method('get')
    .create();

getMe({}); // note {}

for typescript to not yell the error

ierehon1905 avatar May 21 '22 22:05 ierehon1905

I just stumbled upon this... would love to have this changed.

adonaicandido avatar Feb 15 '23 18:02 adonaicandido