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
As per the screenshots below, the same OAS 2.0 definition renders correctly in v5.15.2, but fails to render in v5.16.0 (and later versions, all the way up to the current latest v5.17.1).
The only change between the screenshots was updating the SwaggerUI version.
It appears that v5.16.0 treats filter: undefined differently, by forcing it to be the string value "undefined" (which results in the "No operations defined in spec!" message, as nothing matches that filter.
In v5.15.2 and earlier, an undefined filter was treated as an empty string.
To reproduce...
In v5.15.2, configure SwaggerUI as shown above and render.
Update to v5.16.0, and note the difference as per the screenshots.
Expected behavior
Setting filter to undefined should be treated as though no filter is set (empty string), as it was in previous versions.
Screenshots
Note the main visual differences are:
In v5.15.2, the filter input is blank and shows the placeholder text "Filter by tag", but in v5.16.0 it is populated with "undefined"
In v5.15.2, the tags & operations render as expected, but in in v5.16.0 the "No operations defined in spec!" message appears in it's place (but note that the models still render OK)
v5.15.2
v5.16.0
The text was updated successfully, but these errors were encountered:
scottohara
changed the title
Possible regression between v5.15.2 and v5.16.0 ("No operations defined in spec!")
Regression between v5.15.2 and v5.16.0 when the configuration contains filter: undefinedApr 25, 2024
On review, it would seem that setting filter: undefined is not allowed (should be either Boolean or String value), and the fact that it previously worked was accidental rather than intentional.
Happy to close this, and I'll change my usage to cast undefined to false.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
https://petstore.swagger.io/v2/swagger.json
Swagger-UI configuration options:
Describe the bug you're encountering
As per the screenshots below, the same OAS 2.0 definition renders correctly in v5.15.2, but fails to render in v5.16.0 (and later versions, all the way up to the current latest v5.17.1).
The only change between the screenshots was updating the SwaggerUI version.
It appears that v5.16.0 treats
filter: undefined
differently, by forcing it to be the string value "undefined" (which results in the "No operations defined in spec!" message, as nothing matches that filter.In v5.15.2 and earlier, an undefined filter was treated as an empty string.
To reproduce...
Expected behavior
Setting
filter
to undefined should be treated as though no filter is set (empty string), as it was in previous versions.Screenshots
Note the main visual differences are:
v5.15.2
v5.16.0
The text was updated successfully, but these errors were encountered: