You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a package where I have my custom enum defined in one file:
typeStrategystring
While the values of this type is defined in other files of that package like:
const (
PriorityStrategy="priority"
)
Also, I have a CI check that does swag init && git diff --exit-code to remind me to update API specs when the corresponding code has changed.
Expected behavior
I expect that my enum values are generated in a deterministic order, so no matter how many times I regenerate the spec it gives no changes as far as the underlying enum values stayed the same.
Actual behavior
Sometime, swag init changes the order of enum values causing changes & the CI job to fail:
Your swag version
v1.16.2
Your go version
go1.21.5 darwin/amd64
Desktop (please complete the following information):
OS: MacOS
Browser: -
Version: -
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
It is better to declare all the enums of the same type together in one file, I think。
In this way, your can arrange their sequences according your intention.
Describe the bug
I have a package where I have my custom enum defined in one file:
While the values of this type is defined in other files of that package like:
Also, I have a CI check that does
swag init && git diff --exit-code
to remind me to update API specs when the corresponding code has changed.Expected behavior
I expect that my enum values are generated in a deterministic order, so no matter how many times I regenerate the spec it gives no changes as far as the underlying enum values stayed the same.
Actual behavior
Sometime,
swag init
changes the order of enum values causing changes & the CI job to fail:Your swag version
v1.16.2
Your go version
go1.21.5 darwin/amd64
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: