[Feature Request] Augmenting the generated strongly typed JSONs
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- developer-experience
Research direction
The issue asks for generated JSON field types to be augmentable, similar to prisma-json-types-generator. Since no files are named, start by locating where ZModel Json? fields are converted into TypeScript types in the ZenStack codebase. Determine whether an extension point already exists; if not, the task is to design one so custom types can be attached to JSON fields and appear in generated query types. Done when a ZModel Json? field can be given a custom TS type like the union shown and that type flows into the generated client.
Written by the indexing model from the issue text.
Description
Similar to prisma-json-types-generated, I would like to augment the generated types to achieve proper type-safety when querying the data.
Example
zmodel
type Ruler {
orientation String
property1 String?
property2 Json?
}
The "real" type
type IRulerLtr = {
orientation: 'ltr'
property1: string
}
type IRulerRtl = {
orientation: 'rtl'
property2: string | number
}
type IRuler = IRulerLtr | IRulerRtl
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 157
- Avg merge
- 11h 42m
- Merged PRs (30d)
- 20
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zenstackhq/zenstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
zenstackhq/zenstack#2873 ·
Maintainers usually reply within 1 day
-
runtime
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zenstackhq/zenstack#2868 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
zenstackhq/zenstack#2694 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
zenstackhq/zenstack#2659 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
zenstackhq/zenstack#2542 · 1 comment ·
Maintainers usually reply within 1 day
All issues in zenstackhq/zenstack
Similar issues
-
area: desktop area: website priority: P2 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
appandflow/stim#3411 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rjsf-team/react-jsonschema-form#5485 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 65/100
lingdojo/kana-dojo#32090 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Friction: Org home and org switcher copy still say repositories and connected agents live in the personal accountPossibly taken A pull request linked to this issue is open or already merged. Openfriction
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
kentcdodds/kody#3265 ·
Maintainers usually reply within 1 day