Swagger UI: passing `displayOperationId=true` in URL not displaying operation IDs anymore
Summary
Since upgrading Swagger UI, passing ?displayOperationId=true
doesn't seem to work anymore.
It looks like this is a bug in the Swagger UI dependency, according to their docs it is possible to pass displayOperationId
in the URL query string.
We could temporarily patch this in our codebase by reading displayOperationId
from the query string and pass it as a config option. Alternatively, we can enable displayOperationId
by default.
Steps to reproduce
- Create an OpenAPI file
- View the file
- Add
?displayOperationId=true
in the URL query string
Example Project
https://gitlab.com/jerasmus/jerasmus-test-project/-/blob/master/swagger.json?displayOperationId=true
What is the current bug behavior?
Passing ?displayOperationId=true
in the URL does not display the operation names.
What is the expected correct behavior?
Passing ?displayOperationId=true
in the URL should display the operation names.
Possible fixes
- We could temporarily patch this in our codebase by reading
displayOperationId
from the query string and pass it as a config option. - Alternatively, we can enable
displayOperationId
by default. - Or we can fix the bug in Swagger-ui by contributing upstream.
Edited by Jacques Erasmus