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

fix required params parsing for routes with multiple paths and multiple params #1621

Merged
merged 2 commits into from
Jul 7, 2023
Merged

fix required params parsing for routes with multiple paths and multiple params #1621

merged 2 commits into from
Jul 7, 2023

Conversation

Phenix66
Copy link
Contributor

@Phenix66 Phenix66 commented Jul 6, 2023

Describe the PR
Fixes #1267

Relation issue
e.g. https://github.com/swaggo/swag/pull/118/files

Additional context
Add any other context about the problem here.

parser.go Outdated
*op = &operation.Operation
if len(operation.RouterProperties) > 1 {
newOp := *operation
validParams := []spec.Parameter{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use var validParams []spec.Parameter in order to avoid mem allocations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.06 ⚠️

Comparison is base (c8372f6) 83.76% compared to head (2119c4d) 83.70%.

❗ Current head 2119c4d differs from pull request most recent head c1b1d08. Consider uploading reports for the commit c1b1d08 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1621      +/-   ##
==========================================
- Coverage   83.76%   83.70%   -0.06%     
==========================================
  Files          19       17       -2     
  Lines        3752     3726      -26     
==========================================
- Hits         3143     3119      -24     
+ Misses        521      519       -2     
  Partials       88       88              
Impacted Files Coverage Δ
parser.go 93.89% <100.00%> (+0.06%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ubogdan
Copy link
Contributor

ubogdan commented Jul 7, 2023

@Phenix66 Thanks for your contribution

@ubogdan ubogdan merged commit 0cee1c5 into swaggo:master Jul 7, 2023
9 checks passed
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.

Multiple path params with multiple paths leads to unnecessary required params
2 participants