Conversation
There was a problem hiding this comment.
Pull request overview
Subject Service を外部APIクライアントとして利用できるようにするため、OpenAPI定義と oapi-codegen 設定・生成コードを追加し、Task で生成できるようにしたPRです。
Changes:
- Subject API の OpenAPI 定義(paths/components/servers)を追加
- oapi-codegen 用 config を追加し、Go クライアント/モデル生成物を追加
task generateに subject_api の生成ステップを追加
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openapi/external/subject_api/openapi.yaml | Subject API の OpenAPI 3.1 定義を追加 |
| openapi/external/subject_api/config.yaml | oapi-codegen の生成設定を追加 |
| generated/external/subject_api/client.gen.go | OpenAPI から生成された Go クライアント/モデルを追加 |
| Taskfile.yaml | generate タスクに subject_api のコード生成を追加 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| allOf: | ||
| - $ref: '#/components/schemas/DottoFoundationV1.Class' |
There was a problem hiding this comment.
SubjectTargetClass.class のdescriptionで「修士課程・博士課程対象の場合はnull」とありますが、OpenAPI 3.1 のスキーマ定義上は null を許可していません(allOf で string enum 参照のみ)。仕様として null を返す/受ける可能性があるなら、null を許容するスキーマ(例: anyOf/oneOf で null 型を追加)にするか、null ではなく「フィールド省略(未設定)」などの表現に合わせてdescriptionを修正してください。
| allOf: | |
| - $ref: '#/components/schemas/DottoFoundationV1.Class' | |
| anyOf: | |
| - allOf: | |
| - $ref: '#/components/schemas/DottoFoundationV1.Class' | |
| - type: 'null' |
|
これでどう? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| class: | ||
| allOf: | ||
| - $ref: '#/components/schemas/DottoFoundationV1.Class' | ||
| - $ref: "#/components/schemas/DottoFoundationV1.Class" | ||
| description: 修士課程・博士課程対象の場合はnull |
There was a problem hiding this comment.
SubjectService.SubjectTargetClass.class の description で「null」と書かれていますが、スキーマ定義は allOf で文字列 enum 参照のみになっており null を許容していません。実際に null を返す/受ける仕様なら OpenAPI 3.1 の JSON Schema として null を許容する形に修正するか、null ではなく「フィールド省略(未設定)」で表現するなら description を修正してください。
Co-authored-by: Kanta Oikawa <iam@kantacky.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@kantacky @masaya-osuga |
kantacky
left a comment
There was a problem hiding this comment.
TypeSpecから生成した時にシングルクォートになるから、今後自動で生成してPushするワークフローを組んだときに変な差分になりそう
エディタでコピペするとフォーマットが入ってこうなるだろうから、フォーマットしないようにするか、ファイルをコピーするようにしてもらえると良さそう
生成するコードには影響ないと思うので、とりあえずOKです
This reverts commit f1ece7a.
やったこと
これで実装し始めても大丈夫ですか?