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

Extend Map returns to supports more types than basic and json (enums, etc...)

Đang mở
#90 12 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu tại io.vertx.codegen.ProxyModel.isLegalListSetMapResult và tái hiện ví dụ MyProxyService từ issue. So sánh hành vi của nó với tài liệu về các kiểu được cho phép; công việc hoàn tất khi phương thức proxy Map<String, MyEnum> được xử lý nhất quán với các kiểu được hỗ trợ đã được tài liệu hóa.

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

Mô tả

enhancement

The following proxy interface doesn't compile:

package com.melusyn.gatekeeper.service;

import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;

import java.util.Map;

/**
 * The service interface.
 */
@ProxyGen
@VertxGen // Generate the proxy and handler
public interface MyProxyService {

  enum MyEnum {
    Value1,
    Value2,
    Value3,
  }

  void callThatReturnsAMap(String param1, Handler<AsyncResult<Map<String, MyEnum>>> handler);
}

The compilation fails with the error:

 type <io.vertx.core.AsyncResult<java.util.Map<java.lang.String,MyEnum>>> is not legal for use for a parameter in proxy

However, the documentation says otherwise (https://github.com/vert-x3/vertx-codegen#permitted-types).

The following set R of types are permitted as return types from any API method:
[...]
type java.util.List, java.util.Set or java.util.Map<String, C> where C contains
[...]

The method io.vertx.codegen.ProxyModel.isLegalListSetMapResult does not check for Map type.

Has this been overlooked or this is on purpose? I found an old issue #8 referring to it... But not much was said at that time.

I'm willing to do a PR if the core team feel this is missing and should been implemented.

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.