Remove `exceptions.go`

Đang mở
#351 1 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ái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
go

Hướng nghiên cứu

Bắt đầu bằng cách đọc internal/generate/exceptions.go và ngữ cảnh trong pull request #289, sau đó xem xét hành vi tạo mã dựa trên OpenAPI được mô tả trong issue. Xác định những exception nào có thể được loại bỏ và liệu các hint còn lại có yêu cầu hành vi nhất quán của Nexus API hoặc các phần mở rộng OpenAPI hay không. Hoàn thành khi không còn cần exceptions.go và hành vi tạo SDK được giữ nguyên.

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

Mô tả

Enhancement Go SDK

In most cases, our codegen logic derives go types, methods, etc. purely from the openapi spec. However, in a few cases, we need to provide hints to change the default behavior, captured in https://github.com/oxidecomputer/oxide.go/blob/main/internal/generate/exceptions.go. We should gradually remove cases from this file and eventually drop it entirely. Instead, we can either change the nexus api to behave consistently, or expose openapi extensions from nexus to provide codegen hints in exceptional cases. This will allow nexus to control how the sdk is generated, rather than building hidden knowledge about nexus into the codegen logic here.

By the way, I was looking at exceptions.go and didn't fully understand the overrides we've defined there. For example, we configure a few specific types to serialize using omitzero rather than the default omitempty. We said in the PR description that the goal was to serialize empty slices of those types to [] instead of omitting, but I think changing from omitempty to omitzero actually has the opposite effect. @sudomateo do you have context for that change?

Ngôn ngữ chính
Go
Star
26
Fork
6
Merge trung bình
17 giờ 27 phút
Pull request đã merge (30 ngày)
2

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 oxidecomputer/oxide.go

Tất cả issue của oxidecomputer/oxide.go

Issue tương tự

Thêm issue về Go

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.