microsoft / microsoft/OpenAPI.NET.OData

Action and Operation do not expose $select and $expand over entity types

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

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

Ngôn ngữ chính
C#
Star
240
Fork
70
Merge trung bình
7 giờ 59 phút
Pull request đã merge (30 ngày)
13

Mô tả

Action and Operation do not expose $select and $expand over entity types while this is possible for /entity/propertyOfComplexType

Assemblies affected

Microsoft.OpenApi.OData 1.7.5

Steps to reproduce

Register additional function for entity set:

        var fax = builder.EntityType<XFax>();
        fax.Collection.Function(nameof("GetByNumber"))
            .ReturnsFromEntitySet<XFax>("Fax")
            .NonNullable()
            .Parameter<string>("number").NonNullable();
Expected result

GetByNumber should have both $select and $expand operations because XFax is Entity type

Actual result

No operations available

Additional detail

I see that ComplexPropertyGetOperationHandler has the following logic:

  1. Expose $top, $skip, $search, $filter $count for a collection
  2. Try to expose $select and $expand

On the contrary EdmOperationImportOperationHandler has the following logic:

  1. Expose $top, $skip, $search, $filter $count for a collection
  2. Expose $select and $expand if 1. is true

Therefore I can't get $select and $expand for Function or Operation. Is it something explicitly prohibited by OData?
How can I do this in a different way?

P.S. I think as a workaround I can make alternate key. But I don't see any examples for OData 8

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu với ComplexPropertyGetOperationHandler và EdmOperationImportOperationHandler, sau đó tái hiện hàm bổ sung được đăng ký trên entity set XFax. So sánh các operation được tạo cho những hàm trả về entity với hành vi $select và $expand dự kiến. Hoàn thành khi đã xác nhận và sửa hành vi của handler, đồng thời có coverage cho trường hợp được báo cáo.

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

Đánh giá

Công nghệ
csharp
Lĩnh vực
api, backend-api-design
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.