-
Notifications
You must be signed in to change notification settings - Fork 35
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
provide a way to order the endpoints #168
Comments
@nioncode If you want to change the endpoint order of the swagger, you can change the default behavior by setting the from flask_openapi3 import OpenAPI
app = OpenAPI(__name__)
app.config["SWAGGER_CONFIG"] = {
"operationsSorter":"method"
}
|
Sorry for my late response. Is there a similar flag to control the redoc API? I found out that the order of the endpoints is actually how they are in our python code in the generated |
I've found that some configurations can be used:
usage: app.config["REDOC_CONFIG"] = {
"sortOperationsAlphabetically": True
} |
The problem is that we don't want to sort alphabetically, but semantically. E.g. a
|
Is there a way to modify the order of the endpoints? Currently it seems they are grouped by tags and then sorted alphabetically by their path, which results in non-intuitive ordering (at least in our use case).
Assume we have the endpoints:
Naturally, we'd like to see
/start
before/finish
in the documentation, but currently these are reversed.It would be great if we could provide a custom name used for sorting, e.g. something like:
It would also be possible by using a simple integer for the sort order, but I think having a string and then keep using the alphabetical sorting order allows more customization and is less brittle when adding a new function, since we could also create some kind of subgroups between requests to order some requests relative to each other without impacting global order, e.g.:
Does something like this maybe already exist?
The text was updated successfully, but these errors were encountered: