Skip to content

[BUG] Generated API and openapi spec doesn't handle @@id correctly #1748

Closed
@thomassnielsen

Description

@thomassnielsen

When using the openapi plugin (REST variant) with a schema using @@id, the attributes that make up the compound id are not added to the attribute list for the model.

Given the model

model DashboardTiles extends Base {
  clientId Int
  tileType Int
  visible  Boolean
  Client   Client            @relation(fields: [clientId], references: [id])

  @@id([clientId, tileType])
  @@allow("all", check(Client))
}

The expected list of attributes should be

clientId: number
tileType: number
visible: boolean

Currently the list of attributes is only:

visible: boolean
  • ZenStack version: 2.5.1
  • Prisma version: 5.19.1
  • Database type: Postgresql

Discord thread

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions