Skip to content

fix(net/goai): swagger $ref replace#4512

Merged
hailaz merged 4 commits intogogf:masterfrom
xiaoyi510:master
Nov 19, 2025
Merged

fix(net/goai): swagger $ref replace#4512
hailaz merged 4 commits intogogf:masterfrom
xiaoyi510:master

Conversation

@xiaoyi510
Copy link
Contributor

@xiaoyi510 xiaoyi510 commented Nov 15, 2025

修复swagger泛型导致的 []/三个特殊字符不支持

@xiaoyi510 xiaoyi510 changed the title 解决了 Swagger 中golang T泛类型中 "[]/" 三个特殊 schemaName 为. 避免swagger报错问题 fix(net/goai): swagger $ref replace Nov 16, 2025
@xiaoyi510 xiaoyi510 closed this Nov 16, 2025
@xiaoyi510 xiaoyi510 reopened this Nov 16, 2025
@xiaoyi510 xiaoyi510 closed this Nov 16, 2025
@xiaoyi510 xiaoyi510 reopened this Nov 16, 2025
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 PR fixes an issue with Swagger schema name generation when handling Go generic types. The changes ensure that special characters [, ], and / in type names (commonly found in generic types) are properly replaced with dots (.) to create valid OpenAPI schema references.

Key Changes

  • Added replacement of / with . early in the schema name generation process
  • Extended the character replacement map to handle [ and ] characters by converting them to .

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

@hailaz hailaz merged commit ac88e64 into gogf:master Nov 19, 2025
18 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.

3 participants