Skip to content

Allow pageParam to be a string within generated infiniteQueries #146

@robert-pitt-foodhub

Description

@robert-pitt-foodhub

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @7nohe@robert-pitt-foodhub

    Issue actions

      Allow pageParam to be a string within generated infiniteQueries · Issue #146 · 7nohe/openapi-react-query-codegen