-
Notifications
You must be signed in to change notification settings - Fork 45
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
The generation-result is not deterministic #47
Comments
I am not sure whether the plugin is actually behaving differently than the Swagger framework itself. I mean we could add a sorting, as you suggest, but I am thinking whether this would more correctly be solved in Swagger itself as we are merely wrapping it. |
This problem seems to be reoccurring quite often in the Swagger framework itself. There are many open issues about this, even from 2017: swagger-api/swagger-core#2775 What is the best way to solve this matter both properly and swiftly you reckon, @langecode ? How can I help? |
Well, if there is that many open issued with Swagger Code it seems not very high priority and I do acknowledge it can be a problem if you want to do a simple diff between outputs (we actually did do a diff tool for OpenAPI specifications that does it semantically - however I do not think we ported that to OpenAPI 3 yet: https://github.com/openapi-tools/open-api-diff). If it has value to you I think it would be ok to include a sorting option to the plugin as suggested by @ahoehma - I am not working much with Java these days so it is a little hard to find the time to implement it - but feel free to do a PR and I shall find the time to look through that. |
@wanno-drijfhout @langecode @ahoehma We generated a pull request for this issue. This causes blocking problems when adopting this plugin. |
@langecode I fear updating to the new version doesn't lead to a deterministic or sorted output. @hiddewie found a bug in the refactoring and created PR #50 . |
Feedback ... now I'm using 2.1.4 and I still have some random jumps of paths in the output.json/yaml.
|
@ahoehma There seem to be more things that need to be sorted, e.g. #50 (comment). The current solution is a workaround, and should be solved in swagger-core). PRs and issues have also been referenced opened there. |
Describe the bug
I have a controller-class.
I'm able to generate json and yaml.
But every time I run the plugin the result looks different to the prev. one.
This is not so helpfull because I put the result into my git-repo.
To Reproduce
Simply run the generation multiple time without any change.
Expected behavior
The generated json/yaml must create always the same output.
I tried to "fix" this behavior in io.openapitools.swagger.GenerateMojo.execute()
...
The text was updated successfully, but these errors were encountered: