swaggo / swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.
MIT License
10.77k stars 1.2k forks source link

Fix generics used with function scoped types #1883

Closed berk-karaal closed 2 months ago

berk-karaal commented 2 months ago

Describe the PR In https://github.com/swaggo/swag/pull/1866 PR, the SchemaName field added to TypeSpecDef struct is not set for function scoped types. This PR sets TypeSpecDef.SchemaName for function scoped types too.

Also added some tests for the cases this PR fixes.

Relation issue fixes #1882

ubogdan commented 2 months ago

@berk-karaal thanks for your contribution !