Skip to content

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

Closed
@gzm0

Description

@gzm0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions