Skip to content
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

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

Closed
thomassnielsen opened this issue Sep 27, 2024 · 0 comments
Closed
Milestone

Comments

@thomassnielsen
Copy link
Contributor

thomassnielsen commented Sep 27, 2024

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

@thomassnielsen thomassnielsen changed the title Generated openapi spec doesn't handle @@id correctly [BUG] Generated openapi spec doesn't handle @@id correctly Sep 27, 2024
@jiashengguo jiashengguo added this to the v2.6.x milestone Sep 27, 2024
@thomassnielsen thomassnielsen changed the title [BUG] Generated openapi spec doesn't handle @@id correctly [BUG] Generated API and openapi spec doesn't handle @@id correctly Sep 27, 2024
@ymc9 ymc9 modified the milestones: v2.6.x, v2.7.0 Oct 1, 2024
@ymc9 ymc9 closed this as completed Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants