Skip to content

Add schema#3

Merged
masaya-osuga merged 1 commit intomainfrom
feature/add-oapi-schema
Feb 10, 2026
Merged

Add schema#3
masaya-osuga merged 1 commit intomainfrom
feature/add-oapi-schema

Conversation

@masaya-osuga
Copy link
Member

No description provided.

@masaya-osuga masaya-osuga self-assigned this Feb 10, 2026
@masaya-osuga masaya-osuga requested review from a team, Copilot, hikaru-0602 and kantacky February 10, 2026 01:42
Copy link
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

@masaya-osuga masaya-osuga merged commit b6fdd09 into main Feb 10, 2026
4 of 5 checks passed
Copy link

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

This PR introduces an initial OpenAPI schema for the “Subject Service” and adds Go server/models generated from that schema, along with module updates to support OpenAPI code generation and validation.

Changes:

  • Added openapi/openapi.yaml defining v1 endpoints and component schemas (Courses, Faculties, Subjects, etc.).
  • Added generated Gin server + models code (generated/api.gen.go) via oapi-codegen.
  • Updated go.mod/go.sum to include tooling and transitive dependencies needed for generation/processing.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 6 comments.

File Description
openapi/openapi.yaml Adds the OpenAPI 3.1 spec (paths + schemas) for the Subject Service.
generated/api.gen.go Adds Go types and Gin handler wrappers generated from the OpenAPI spec.
go.mod Adds indirect dependencies and a tool entry for oapi-codegen.
go.sum Updates module checksums for newly added dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

SubjectTargetClass.class is documented as "null" for some cases, but the schema does not permit null (it’s an allOf string ref only). Because the server uses middleware.OapiRequestValidator, requests/responses with an explicit JSON null will fail validation. Either update the schema to allow null (e.g., union with null in OAS 3.1 / JSON Schema) or change the description/contract to indicate the field is omitted instead of null.

Suggested change
description: 修士課程・博士課程対象の場合はnull
description: 修士課程・博士課程対象の場合は省略されます

Copilot uses AI. Check for mistakes.
type: string
responses:
'204':
description: There is no content to send for this request, but the headers may be useful.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The 204 response description here is in English while most other endpoint descriptions are in Japanese. Consider standardizing the language across the spec (either translate this description or use a consistent short 204 description everywhere).

Suggested change
description: There is no content to send for this request, but the headers may be useful.
description: コンテンツなし

Copilot uses AI. Check for mistakes.
type: string
responses:
'204':
description: There is no content to send for this request, but the headers may be useful.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The 204 response description here is in English while most other endpoint descriptions are in Japanese. Consider standardizing the language across the spec (either translate this description or use a consistent short 204 description everywhere).

Suggested change
description: There is no content to send for this request, but the headers may be useful.
description: コンテンツは返却されません。

Copilot uses AI. Check for mistakes.
type: string
responses:
'204':
description: There is no content to send for this request, but the headers may be useful.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The 204 response description here is in English while most other endpoint descriptions are in Japanese. Consider standardizing the language across the spec (either translate this description or use a consistent short 204 description everywhere).

Suggested change
description: There is no content to send for this request, but the headers may be useful.
description: コンテンツなし

Copilot uses AI. Check for mistakes.
type: string
responses:
'204':
description: There is no content to send for this request, but the headers may be useful.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The 204 response description here is in English while most other endpoint descriptions are in Japanese. Consider standardizing the language across the spec (either translate this description or use a consistent short 204 description everywhere).

Suggested change
description: There is no content to send for this request, but the headers may be useful.
description: コンテンツなし

Copilot uses AI. Check for mistakes.
type: string
responses:
'204':
description: There is no content to send for this request, but the headers may be useful.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The 204 response description here is in English while most other endpoint descriptions are in Japanese. Consider standardizing the language across the spec (either translate this description or use a consistent short 204 description everywhere).

Suggested change
description: There is no content to send for this request, but the headers may be useful.
description: レスポンスボディは返却されません。

Copilot uses AI. Check for mistakes.
@masaya-osuga masaya-osuga linked an issue Feb 10, 2026 that may be closed by this pull request
@masaya-osuga masaya-osuga deleted the feature/add-oapi-schema branch February 10, 2026 04:43
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.

コード生成

2 participants