Skip to content

Subject API の OpenAPI スキーマを追加#10

Merged
hikaru-0602 merged 6 commits intomainfrom
feature/subject-openapi-generate
Feb 12, 2026
Merged

Subject API の OpenAPI スキーマを追加#10
hikaru-0602 merged 6 commits intomainfrom
feature/subject-openapi-generate

Conversation

@hikaru-0602
Copy link
Copy Markdown
Contributor

@hikaru-0602 hikaru-0602 commented Feb 11, 2026

やったこと

  • Subject APIの実装の基盤だけつくった

これで実装し始めても大丈夫ですか?

Copy link
Copy Markdown
Member

@kantacky kantacky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +859 to +860
allOf:
- $ref: '#/components/schemas/DottoFoundationV1.Class'
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SubjectTargetClass.class のdescriptionで「修士課程・博士課程対象の場合はnull」とありますが、OpenAPI 3.1 のスキーマ定義上は null を許可していません(allOf で string enum 参照のみ)。仕様として null を返す/受ける可能性があるなら、null を許容するスキーマ(例: anyOf/oneOf で null 型を追加)にするか、null ではなく「フィールド省略(未設定)」などの表現に合わせてdescriptionを修正してください。

Suggested change
allOf:
- $ref: '#/components/schemas/DottoFoundationV1.Class'
anyOf:
- allOf:
- $ref: '#/components/schemas/DottoFoundationV1.Class'
- type: 'null'

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hikaru-0602
これ、新しいスキーマじゃないかも?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あれ,まじ

@kantacky kantacky changed the title Feature/subject openapi generate Subject API の OpenAPI スキーマを追加 Feb 11, 2026
@hikaru-0602
Copy link
Copy Markdown
Contributor Author

これでどう?

Copilot AI review requested due to automatic review settings February 11, 2026 04:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 1014 to 1017
class:
allOf:
- $ref: '#/components/schemas/DottoFoundationV1.Class'
- $ref: "#/components/schemas/DottoFoundationV1.Class"
description: 修士課程・博士課程対象の場合はnull
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SubjectService.SubjectTargetClass.class の description で「null」と書かれていますが、スキーマ定義は allOf で文字列 enum 参照のみになっており null を許容していません。実際に null を返す/受ける仕様なら OpenAPI 3.1 の JSON Schema として null を許容する形に修正するか、null ではなく「フィールド省略(未設定)」で表現するなら description を修正してください。

Copilot uses AI. Check for mistakes.
Co-authored-by: Kanta Oikawa <iam@kantacky.com>
Copilot AI review requested due to automatic review settings February 11, 2026 04:58
@hikaru-0602 hikaru-0602 requested a review from kantacky February 11, 2026 04:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hikaru-0602
Copy link
Copy Markdown
Contributor Author

@kantacky @masaya-osuga
TypeSpecで最新の状態でビルドして生成したスキーマを持ってきたけどこれで大丈夫だよね?

Copy link
Copy Markdown
Member

@kantacky kantacky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeSpecから生成した時にシングルクォートになるから、今後自動で生成してPushするワークフローを組んだときに変な差分になりそう
エディタでコピペするとフォーマットが入ってこうなるだろうから、フォーマットしないようにするか、ファイルをコピーするようにしてもらえると良さそう
生成するコードには影響ないと思うので、とりあえずOKです

Copy link
Copy Markdown
Member

@kantacky kantacky Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-nits
このファイルの差分必要?

Copy link
Copy Markdown
Member

@kantacky kantacky Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-nits
このファイルの差分も必要?

Copy link
Copy Markdown
Member

@masaya-osuga masaya-osuga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いいと思う

This reverts commit f1ece7a.
@hikaru-0602 hikaru-0602 merged commit c2a3177 into main Feb 12, 2026
1 check passed
@hikaru-0602 hikaru-0602 deleted the feature/subject-openapi-generate branch February 12, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants