Remove `exceptions.go`

オープン
#351 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
go

調査の方向性

まず internal/generate/exceptions.go と pull request #289 のコンテキストを読み、その後、issue で説明されている OpenAPI 駆動のコード生成の動作を確認します。どの例外を削除できるか、また残りのヒントに一貫した Nexus API の動作または OpenAPI 拡張が必要かどうかを判断します。exceptions.go が不要になり、SDK の生成動作が維持されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
Go
スター
26
フォーク
6
平均マージ
17時間 27分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oxidecomputer/oxide.go のほかの issue

oxidecomputer/oxide.go の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。