Skip to content

Plugin Open API: Wrong Open API spec generated for meta response data key #1549

@drichardcarl

Description

@drichardcarl

Description and expected behavior
The plugin should generate the proper spec for meta response data key.

Currently, I'm using npx openapi-typescript prisma/schema.json -o prisma/schema.d.ts to auto generate typings from Open API spec which will be later used to create API client using openapi-fetch. The problem is that "meta" key in response data has a wrong spec to begin with, hence the generated type is also wrong.

The expected type is:

ResponseData = {
  ...,
  meta?: {...}
}

and not

ResponseData = {
  ...,
  meta?: {
    meta?: {}
  }
}

Screenshots
(schema.zmodel)
image

(_Meta section of schema.json)
image

(_Meta section of schema.d.ts)
image

(response from api call)
image

Environment (please complete the following information):

  • ZenStack version: 2.2.4
  • Prisma version: 5.13.0
  • Database type: MySQL 8

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions