Skip to content

Update OpenAPI schema#1

Merged
kantacky merged 16 commits intomainfrom
update-openapi-schema
Mar 15, 2026
Merged

Update OpenAPI schema#1
kantacky merged 16 commits intomainfrom
update-openapi-schema

Conversation

@dotto-api-schema-updater
Copy link
Contributor

This PR updates the OpenAPI schema from dotto-typespec.

Triggered by: fun-dotto/dotto-typespec@397b030

@kantacky kantacky marked this pull request as draft March 1, 2026 14:31
github-actions bot and others added 12 commits March 2, 2026 07:58
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kantacky kantacky self-assigned this Mar 13, 2026
@kantacky kantacky marked this pull request as ready for review March 13, 2026 09:34
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 a basic “User Service” vertical slice (OpenAPI spec → generated server types → Gin wiring → handler/service/repository → GORM model + migration) to support fetching a user by ID and creating/updating a user.

Changes:

  • Added GET /v1/users/{id} and POST /v1/users/{id} to the OpenAPI spec and generated Gin + strict server bindings.
  • Implemented handler/service/repository layers for user detail and upsert.
  • Added a GORM User model and updated migrations to create the users table.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
openapi/openapi.yaml Defines the User Service API contract and schemas.
openapi/config.yaml oapi-codegen configuration for Gin + strict server generation.
generated/api.gen.go Generated API types and handler registration from the OpenAPI spec.
cmd/server/main.go Wires DB, OpenAPI request validation, and registers generated routes/handlers.
internal/handler/user.go Introduces the HTTP handler struct with a UserService dependency.
internal/handler/detail.go Implements the strict-server UsersV1Detail handler.
internal/handler/upsert.go Implements the strict-server UsersV1Upsert handler.
internal/handler/converter.go Converts between domain models and generated API models.
internal/service/user.go Adds a service layer and repository interface for user operations.
internal/repository/user.go Implements GORM-backed user persistence and lookup.
internal/domain/user.go Adds the domain User model.
internal/domain/errors.go Adds a domain-level ErrNotFound.
internal/database/user.go Adds the GORM User model and domain conversion helpers.
internal/database/migrate.go Updates automigration to include the User model.
go.mod Adds oapi-codegen runtime dependency and pins the oapi-codegen tool.
go.sum Records new dependency checksums.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +14 to +16
if errors.Is(err, domain.ErrNotFound) {
return nil, err
}
user:
$ref: '#/components/schemas/User'
required:
- user
parameters:
- name: id
in: path
required: true
Comment on lines +51 to 52
api.RegisterHandlers(router, strictHandler)

github-actions bot and others added 3 commits March 15, 2026 06:08
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

@kantacky kantacky merged commit 2da69f9 into main Mar 15, 2026
7 checks passed
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