openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

I'm running into a problem with `initialPageParam` here. My api expects no or an empty initial page parameter. `initialPageParam=""` generates code that sends `page=0`. I believe the reason is that `formatOptions => safeParseNumber` converts the empty string to `0`.

Open 7nohe opened this issue 11 months ago • 0 comments

          I'm running into a problem with `initialPageParam` here. My api expects no or an empty initial page parameter. `initialPageParam=""` generates code that sends `page=0`. I believe the reason is that `formatOptions => safeParseNumber` converts the empty string to `0`.

I can work around it by setting initialPageParam="''" which generates code that sends page=%27%27 which works with my api but it's a bit ugly.

Ideally there would be a omitInitialPageParam parameter that would change it so that no page parameter is send at all.

Originally posted by @JonasPf in https://github.com/7nohe/openapi-react-query-codegen/issues/149#issuecomment-2376755346

7nohe avatar Jan 20 '25 22:01 7nohe