Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find type definition: V when using like type MapJSON[K,V string] map[K]V #1508

Closed
thinkhp opened this issue Mar 22, 2023 · 1 comment

Comments

@thinkhp
Copy link
Contributor

thinkhp commented Mar 22, 2023

Describe the bug
go file:

package model
type MapJSON[K comparable, V any] map[K]V
type Workload struct {
	Tags   MapJSON[string, string]
}
package api
// GetWorkLoad godoc
//	@Success		200	{object}	model.Workload
func GetWorkLoad(c *gin.Context) {}

Run swag init report error:

...
2023/03/22 10:26:43 Generating model.Workload
2023/03/22 10:26:43 Generating model.MapJSON-string-string
2023/03/22 10:26:43 Error parsing type definition 'model.MapJSON-string-string': cannot find type definition: V
2023/03/22 10:26:43 Error parsing type definition 'model.Workload': cannot find type definition: V
2023/03/22 10:26:43 ParseComment error in file <file.go> :cannot find type definition: V

Your swag version
1.8.11

Your go version
go1.18.5 darwin/arm64

Desktop (please complete the following information):

  • Chipset: Apple M1
  • Version: MacOS Ventura 13.0
@thinkhp
Copy link
Contributor Author

thinkhp commented Mar 22, 2023

also created a PR fix this issue #1509

@thinkhp thinkhp closed this as completed Mar 27, 2023
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

No branches or pull requests

1 participant