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
Conflicting package + struct name #629
Conversation
@@ -25,7 +25,7 @@ func TestGetPropertyNameSelectorExpr(t *testing.T) { | |||
"string", | |||
"", | |||
} | |||
propertyName, err := getPropertyName(input, New()) | |||
propertyName, err := getPropertyName("test", input, New()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you're testing it so hardcode "test" string, right? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a little bit confused why are these changes fixing the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a little bit confused why are these changes fixing the issue?
In short: they don`t, in bigger projects.
I will test this in different conditions, and add some code to this PR.
Some optimizations. Take a look:
|
Codecov Report
@@ Coverage Diff @@
## master #629 +/- ##
=========================================
- Coverage 85.94% 85.84% -0.1%
=========================================
Files 7 7
Lines 1700 1703 +3
=========================================
+ Hits 1461 1462 +1
- Misses 149 151 +2
Partials 90 90
Continue to review full report at Codecov.
|
@sdghchj Good job! I used your code, but added
In current state code are passing tests. |
What does FuncTyp works for? @wsnotify |
In master we have:
Without this part we failing test at |
I found no FuncType members in testdata/simple3 |
testdata/simple3/web/handler.go:34 |
Sorry, I've still got an old branch. |
optimize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@wsnotify Thank you for your contributions. |
Describe the PR
If code uses two packages that contains types with same name, swag generate wrong json/yaml. This PR fixes this.
Relation issue
Fixes #225
Additional context
This changes need testing on bigger swag files.