Skip to content

PathBasedClient cannot be (directly) used with generated paths #1840

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

Closed
1 task done
gzm0 opened this issue Aug 12, 2024 · 0 comments · Fixed by #1842
Closed
1 task done

PathBasedClient cannot be (directly) used with generated paths #1840

gzm0 opened this issue Aug 12, 2024 · 0 comments · Fixed by #1842
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library

Comments

@gzm0
Copy link
Contributor

gzm0 commented Aug 12, 2024

Description

Typescript fails:

│ test/index.test.ts(1888,58): error TS2344: Type 'paths' does not satisfy the constraint 'Record<string, Record<HttpMethod…
│   Index signature for type 'string' is missing in type 'paths'.

Reproduction

import type { PathBasedClient } from "../src/index.js";
import type { paths } from "./fixtures/api.js";

PathBasedClient<paths> // this line fails to compile

Expected result

Compiles

Checklist

@gzm0 gzm0 added bug Something isn't working openapi-fetch Relevant to the openapi-fetch library labels Aug 12, 2024
gzm0 added a commit to gzm0/openapi-typescript that referenced this issue Aug 12, 2024
To achieve this, we remove unnecessary type bounds.

This fixes openapi-ts#1840.
gzm0 added a commit to gzm0/openapi-typescript that referenced this issue Aug 12, 2024
To achieve this, we remove unnecessary type bounds.

This fixes openapi-ts#1840.
gzm0 added a commit to gzm0/openapi-typescript that referenced this issue Aug 12, 2024
To achieve this, we remove unnecessary type bounds.

This fixes openapi-ts#1840.
gzm0 added a commit to gzm0/openapi-typescript that referenced this issue Aug 13, 2024
To achieve this, we remove unnecessary type bounds.

This fixes openapi-ts#1840.
@drwpow drwpow closed this as completed in 0e42cbb Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant