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

feat: generate formData params via go struct #770

Merged
merged 1 commit into from Aug 12, 2020
Merged

Conversation

BLumia
Copy link
Contributor

@BLumia BLumia commented Aug 8, 2020

Describe the PR
Allow generate params for formData by using go struct.

Relation issue
Intended to resolve #300

Additional context
go test passed even if I didn't change anything related to the unit test, it seems the old test doesn't cover this case. I didn't add any extra test cases for this PR since I'm not sure about how to write unit test for this case. Hope that's okay.

btw if this PR can get merged, the documentation may also need to update.

@codecov
Copy link

codecov bot commented Aug 8, 2020

Codecov Report

Merging #770 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #770   +/-   ##
=======================================
  Coverage   82.16%   82.16%           
=======================================
  Files           8        8           
  Lines        1744     1744           
=======================================
  Hits         1433     1433           
  Misses        193      193           
  Partials      118      118           
Impacted Files Coverage Δ
operation.go 88.46% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b28321d...62fa742. Read the comment docs.

@sdghchj sdghchj merged commit 3ce6eb2 into swaggo:master Aug 12, 2020
@birdycn
Copy link

birdycn commented Feb 23, 2021

How to use

@BLumia
Copy link
Contributor Author

BLumia commented Feb 23, 2021

How to use

The same as when using with query

@birdycn
Copy link

birdycn commented Feb 23, 2021

How to use

The same as when using with query

type Params struct{
  File *multipart.FileHeader `form:"file"
}

How to write tag

@BLumia
Copy link
Contributor Author

BLumia commented Feb 23, 2021

Please consider Read The Fantastic Manual.

(ps. use the form: prefix instead of json:)

btw, if you still got issues, I suggest you open a new issue thread instead of reply in the merged PR.

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.

Support objects for formData
3 participants