Generate dgs.codegen.typemappings for shared-schema libraries

Đang mở
#1,002 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
kotlin
Lĩnh vực
build-system

Hướng nghiên cứu

Start by reading the Gradle generateJava configuration and the existing reader for META-INF/dgs.codegen.typemappings added for dependency JARs in PR #735. Define how exported mappings are selected and whether dependency mappings are included, then trace resource processing and JAR packaging. Done means opt-in generation produces a deterministic, tracked resource while manual resources still work when disabled and existing consumers need no configuration changes.

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

Mô tả

enhancement

Shared-schema library maintainers must currently define type mappings twice: in generateJava.typeMapping for their own code generation and in META-INF/dgs.codegen.typemappings for downstream consumers. Adding or changing a mapping requires updating both copies, which can drift.

PR #735 added support for reading this resource from dependency JARs. Generating it was discussed there and requested again in https://github.com/Netflix/dgs-codegen/pull/735#issuecomment-2368474922, but remains unimplemented.

Please add an opt-in Gradle capability to generate the mapping resource and package it in the library JAR. For example, this configuration:

generateJava {
    typeMapping = [BigDecimal: 'java.math.BigDecimal']
}

could produce META-INF/dgs.codegen.typemappings containing:

BigDecimal=java.math.BigDecimal

The generated resource should be wired into resource processing and JAR packaging, with deterministic output and Gradle input/output tracking. Existing manually maintained resources should continue to work when generation is disabled.

Exported mappings can differ from the mappings used to generate a library's own code, so the feature should define how maintainers select or override the exported set. It should also define whether dependency mappings are exported, rather than implicitly republishing every inherited mapping. Consumers should continue using the existing reader without configuration changes.

Ngôn ngữ chính
Kotlin
Star
220
Fork
123
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
23

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

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 Netflix/dgs-codegen

Tất cả issue của Netflix/dgs-codegen

Issue tương tự

Thêm issue về Kotlin

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.