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

Allow pageParam to be a string within generated infiniteQueries #146

Open
robert-pitt-foodhub opened this issue Sep 2, 2024 · 0 comments · May be fixed by #149
Open

Allow pageParam to be a string within generated infiniteQueries #146

robert-pitt-foodhub opened this issue Sep 2, 2024 · 0 comments · May be fixed by #149
Assignees
Labels
enhancement New feature or request

Comments

@robert-pitt-foodhub
Copy link

Describe the bug
Our API uses string as page parameters, such as base64 encoded global ids, however when generating infinite queries where the type of pageParam is not a number within the schema

To Reproduce

  1. Generate schemas where the page types are strings using openapi-rq --pageParam nextPageKey --nextPageParam nextPageKey -i specification.json -c axios
  2. See the generated queries/infiniteQueries.ts file for type error

OpenAPI spec file
Would like to keep private

Expected behavior
If the schema defines the page token as a string then the generated types should also require a string.

Screenshots

Type Error:
Screenshot 2024-09-02 at 01 35 11

Schema:
Screenshot 2024-09-02 at 01 38 01

  • OS: macOS
  • Version 1.6.0

Additional context
N/A

@7nohe 7nohe added the enhancement New feature or request label Sep 16, 2024
@7nohe 7nohe self-assigned this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants