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

formData generator is broken #1554

Open
whoamineverminds opened this issue Apr 14, 2023 · 8 comments
Open

formData generator is broken #1554

whoamineverminds opened this issue Apr 14, 2023 · 8 comments
Assignees
Labels

Comments

@whoamineverminds
Copy link

whoamineverminds commented Apr 14, 2023

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create formData request struct
  2. Add // @param Token formData Request true "Params" comment
  3. Generate
  4. See broken generated data with repeated one random field

Expected behavior
See all fields defenition

Example
From:
type Request struct {
GrantType string json:"grant_type" validate:"required"
ClientID string json:"client_id" validate:"required"
ClientSecret string json:"client_secret" validate:"required"
RedirectURI string json:"redirect_uri"
Code string json:"code"
CodeVerifier string json:"code_verifier"
Scope string json:"scope"
Username string json:"username"
Password string json:"password"
RefreshToken string json:"refresh_token"
}

Result:
endpoint:
post:
description: Token oauth2
parameters:
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string
- in: formData
name: scope
schema:
type: string

Your swag version
2.0.0

Your go version
1.20.3

@Nerzal
Copy link
Contributor

Nerzal commented Apr 15, 2023

I'll look into this.
And I guess I've already seen and fixed the issue in one of the open PRs. I'll check on Monday.

@Nerzal Nerzal added the bug label Apr 15, 2023
@Nerzal Nerzal self-assigned this Apr 15, 2023
@whoamineverminds
Copy link
Author

tnx, am waitin'

@whoamineverminds
Copy link
Author

whoamineverminds commented Apr 18, 2023

still broken with flag v3.1 true

@Nerzal
Copy link
Contributor

Nerzal commented Apr 18, 2023

There was no new release after the merge.
In general I'd suggest to use the current stable version instead of v2, if you need it for production purposes.

@Nerzal
Copy link
Contributor

Nerzal commented Apr 18, 2023

I created a new v2.0.0-rc2 tag
Does this solve your issue?

@whoamineverminds
Copy link
Author

if docs.go already exists getting error:api/doc/docs.go:1:1: expected 'package', found 'EOF' and docs.go file is empty
but previous problem solved

@whoamineverminds
Copy link
Author

There was no new release after the merge. In general I'd suggest to use the current stable version instead of v2, if you need it for production purposes.

for production already using stable version, now just testing v2, if find some problems, making issue

@Nerzal
Copy link
Contributor

Nerzal commented Apr 18, 2023

Okay, i'll have a look in the error when the docs.go already exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants