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

batch file upload format generation #1943

Open
jo87jimmy opened this issue Dec 11, 2024 · 0 comments
Open

batch file upload format generation #1943

jo87jimmy opened this issue Dec 11, 2024 · 0 comments

Comments

@jo87jimmy
Copy link

Describe the bug
Issues with Swaggo's batch file upload format generation

To Reproduce
// @Param files formData []string false "Multi file" format(binary)
This will generate the following docs.go     

...  
"parameters": [
	{
		"type": "array",
		"format": "binary",
		"items": {
		"type": "string"
	},
		"description": "Multi file",
		"name": "files",
		"in": "formData"
	}
],
...
image

Expected behavior
However, if we move "format": "binary" into items, the output will be correct

"parameters": [
	{
		"type": "array",
		"items": {
		"type": "string",
		"format": "binary"
	},
		"description": "Multi file",
		"name": "files",
		"in": "formData"
	}
],
image

Your swag version
1.16.3

Your go version
1.20

Desktop (please complete the following information):

  • OS: windows 11
  • Browser:chrome
  • Version: 131.0.6778.139

Additional context
So how do we put "format": "binary" into items?

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