Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Feature Request] Augmenting the generated strongly typed JSONs

Đang mở
#2,350 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
developer-experience

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
2.9k
Fork
157
Merge trung bình
2 ngày 46 phút
Pull request đã merge (30 ngày)
17

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của zenstackhq/zenstack

Tất cả issue của zenstackhq/zenstack

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.