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

Flaky results in uniqueness of model names from different packages #745

Closed
krishna-birla opened this issue Jul 7, 2020 · 4 comments
Closed

Comments

@krishna-birla
Copy link

krishna-birla commented Jul 7, 2020

Describe the bug
Flaky results in maintaining unique model names after #736

To Reproduce

  • Have two models (structs) with same name in different packages (same package name but different parent folders).
For example in a project called Awesome, a struct called Message is in two packages, namely foo (Awesome/foo) and foo (Awesome/pkg/foo).
  • Built swagger files again and again, and it shows flaky results.

Expected behavior
The struct names should be: github.com_Awesome_foo.Message and github.com_Awesome_pkg_foo.Message

Actual behavior
Sometimes the struct names are github.com_Awesome_foo.Message and foo.Message.

Only one conflicted struct is handled

Other times it is github.com_Awesome_pkg_foo.Message and foo.Message.

Your swag version
e.g. 1.6.7

Your go version
e.g. 1.14.4

Desktop (please complete the following information):

  • OS: macOS 10.15.5
  • Browser: Safari
  • Version:

Additional context
I would expect that in case of conflict, ideally all conflicted structs should take up full names.

@sdghchj
Copy link
Member

sdghchj commented Jul 9, 2020

Sorry, I have not found a better way to make it stable.

@krishna-birla krishna-birla changed the title Flaky results in uniqueness of modes names from different packages Flaky results in uniqueness of model names from different packages Jul 10, 2020
@krishna-birla
Copy link
Author

@sdghchj Thanks for the super quick action!

Please let me test this.

@sdghchj
Copy link
Member

sdghchj commented Jul 10, 2020

@krishna-birla I known where the problem is, but have not got a proper idea to fix it.

@krishna-birla
Copy link
Author

Okay, please keep the issue open in that case. Sooner or later this will need fixing for sure.

sdghchj added a commit that referenced this issue Jul 12, 2020
…#746)

* stable renaming to fix issue 745; uncapitalize tow members of parser

* optimize

* stable renaming to fix issue 745;

* const
@sdghchj sdghchj closed this as completed Jul 12, 2020
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

2 participants