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

Introduce custom formatter for json property names

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

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
25/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ệ
java
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu tại src/main/java/io/vertx/codegen/generators/dataobjecthelper/DataObjectHelperGen.java, quanh vị trí chọn formatter được tham chiếu, sau đó kiểm tra cách xử lý classloader hiện có của loadJsonMappers. Xác định cách tải một formatter từ compilation classpath và xác minh kịch bản hai dự án được mô tả trong issue. Hoàn thành khi một @DataObject có thể ánh xạ endpointConfigs tới endpoints để chuyển đổi JSON theo cả hai chiều.

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

Mô tả

enhancement
Describe the feature

Introduce custom formatter for json property names

Use cases

I have a POJO which is annotated with @DataObject (vertx-codegen) to convert it into JSON and back. This POJO has an attribute called "endpointConfigs", but in the JSON I want to call it "endpoints". I saw that @DataObject has a property called "jsonPropertyNameFormatter", which I think is exactly what I need.

Contribution

I would try to implement this feature. @vietj gave me already some entry points in discord, which I will add to this description then we have everything on one page.

Place to choose the formatter [1].

Discord messages
  • ideally we should be able to support loading this class from a classloader
  • I think the most difficult issue is using the correct classloader for this
  • Introducing a new classloader and configure the classpath in codegen config is the wrong direction, because it adds more complexcity.
  • if you look at loadJsonMappers we do use getClass().getClassLoader() so perhaps it should simply work with this
  • you need two projects one jar with the Case one project that use it from compilation classpath (I hope I can solve it more elegant with just in time compilation)

[1] https://github.com/vert-x3/vertx-codegen/blob/730d4f707ef4eb8d6dca489614b9a5e9e0e3c182/src/main/java/io/vertx/codegen/generators/dataobjecthelper/DataObjectHelperGen.java#L349

Ngôn ngữ chính
Java
Star
111
Fork
88
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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 eclipse-vertx/vertx-codegen

Tất cả issue của eclipse-vertx/vertx-codegen

Issue tương tự

Thêm issue về Java

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.