Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(net/goai): add openapi uuid.UUID type support#4604

Merged
hailaz merged 1 commit intomasterfrom
fix/openai_type
Jan 15, 2026
Merged

fix(net/goai): add openapi uuid.UUID type support#4604
hailaz merged 1 commit intomasterfrom
fix/openai_type

Conversation

@joy999
Copy link
Contributor

@joy999 joy999 commented Jan 13, 2026

This pull request updates the logic in golangTypeToOAIType to improve how Go types are mapped to OpenAPI types. The most important changes are focused on handling specific struct and slice types more accurately, ensuring better compatibility with OpenAPI specifications.

Type mapping improvements:

  • Added explicit handling for []uint8 and uuid.UUID types, mapping both to TypeString. This ensures these commonly used types are correctly represented in OpenAPI schemas.
  • Refactored the switch statement to check for specific struct types (time.Time, gtime.Time, ghttp.UploadFile, []uint8, and uuid.UUID) before falling back to the kind-based mapping. This improves accuracy for special-case types.

Copilot AI review requested due to automatic review settings January 13, 2026 03:58
Copy link
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

This pull request improves Go-to-OpenAPI type mapping by adding support for uuid.UUID types and refactoring the type detection logic for better organization and efficiency.

Changes:

  • Added explicit handling for uuid.UUID type to map to TypeString in OpenAPI schemas
  • Refactored type-specific checks to occur before kind-based checks for improved clarity and performance

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

@joy999 joy999 changed the title add openai uuid.UUID type support fix(openapi): add openapi uuid.UUID type support Jan 13, 2026
@joy999 joy999 requested a review from Copilot January 13, 2026 05:41
Copy link
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 1 out of 1 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.

@gqcn gqcn changed the title fix(openapi): add openapi uuid.UUID type support fix(net/goai): add openapi uuid.UUID type support Jan 13, 2026
Copy link
Member

@gqcn gqcn left a comment

Choose a reason for hiding this comment

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

/lgtm

@hailaz hailaz merged commit 3120a8b into master Jan 15, 2026
44 checks passed
@hailaz hailaz deleted the fix/openai_type branch January 15, 2026 02:20
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.

3 participants