-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to preserve RPC paths order in swagger output #3051
Comments
Hi, thanks for your issue! Funnily enough someone else asked for this exact feature on the Slack channel just a few days ago. I usually say that we wait until there are two users who want the same thing until implementing it, so I think we should probably add this. If I may bikeshed for a moment, I'd prefer something like
Given those requirements, I think this should be ready for someone to look at implementing. Would you be interested in contributing this? |
I'm not bothered about what to call it - preserve-rpc-order=true seems entirely acceptable. |
I wouldn't mind giving this a go, if no one has picked it up yet? |
Go for it :) |
Will do! Also, I've noticed that the the paths are keys to the |
@johanbrandhorst I believe I have a PR ready for this, but I've avoided altering the type of the That being said, if I can alter this object's type to something else it'll help reduce the complexity of this feature, so I was wondering if this is okay to do in this PR? I'd have to change a lot of the tests in This is the current defintion for the type openapiPathsObject map[string]openapiPathItemObject And to preserve ordering upon encoding, I was thinking something like this could be better: type openapiPathsObject []pathData
type pathData struct {
Path string
PathItemObject openapiPathItemObject
} |
It sounds fine to me to change it to an ordered data structure, thank you for asking :). |
I've got a pull request for this issue opened now: #3500 Let me know of any flaws in my logic/code! |
馃殌 Feature
The generated swagger files from the proto files always emits the "paths" list in alphabetical order apparently.
We need these in the same order as in the proto file.
An option to the openapiv2 protoc plugin such as "paths_in_emit_order=true" with a default value of false would be exceedingly useful.
The text was updated successfully, but these errors were encountered: