prisma-json-types-generator icon indicating copy to clipboard operation
prisma-json-types-generator copied to clipboard

When config.useType is true, type is double quoted

Open Arlen22 opened this issue 1 year ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

Versions

Apparently all version since this was introduced?

A minimal reproducible example

none

Description

https://github.com/arthurfiorette/prisma-json-types-generator/blob/6d4fe1fe730567d2fa762f4b1b7153d944ff02ed/src/util/create-signature.ts#L24

This line results in the type name being double quoted. For some reason that I can't understand this does not always break things, but it does result in things randomly not working. I suspect that I've been ignoring the types and perhaps if someone was actually seriously relying on this feature it would be a bigger problem. Anyway, removing either the JSON.stringify or the surrounding quote is required.

Steps to Reproduce

Here's the generator from my schema.prisma file. Adding this to any file should be all you need to reproduce.

generator json {
  provider     = "prisma-json-types-generator"
  namespace    = "PrismaJson"
  clientOutput = "./client"
  useType      = "AllTypes"
}

Expected Behavior

No response

Arlen22 avatar Apr 03 '24 18:04 Arlen22

Hey! Thanks for this bug report, would you like to address this issue? Remember to add unit tests!

arthurfiorette avatar Apr 03 '24 19:04 arthurfiorette

https://github.com/arthurfiorette/prisma-json-types-generator/releases/tag/v3.1.0

arthurfiorette avatar Sep 30 '24 02:09 arthurfiorette