Closed antispam2002 closed 5 months ago
When using the latest python-openapi-us-bundle for Swagger, the UI always shows Petstore OpenAPI instead of the API defined by the app.
The reason is rather simple - in https://github.com/dapper91/pjrpc/blob/badd7ebb8ec87da4fc38f778970800e8b902e78d/pjrpc/server/specs/openapi.py#L937 the index.html is patched, and it is expected that SwaggerUIBundle initialization is embedded into it. However, the index.html in the latest bundle version does not have this code embedded anymore. Instead, it is laid out into swagger-initialization.js, see https://github.com/dapper91/python-openapi-ui-bundles/blob/master/openapi_ui_bundles/swagger_ui/vendor/index.html
index.html
SwaggerUIBundle
swagger-initialization.js
@antispam2002 Hi,
That is a bug in python-openapi-us-bundle library. Fixed it in version 0.2.1.
python-openapi-us-bundle
When using the latest python-openapi-us-bundle for Swagger, the UI always shows Petstore OpenAPI instead of the API defined by the app.
The reason is rather simple - in https://github.com/dapper91/pjrpc/blob/badd7ebb8ec87da4fc38f778970800e8b902e78d/pjrpc/server/specs/openapi.py#L937 the
index.html
is patched, and it is expected thatSwaggerUIBundle
initialization is embedded into it. However, theindex.html
in the latest bundle version does not have this code embedded anymore. Instead, it is laid out intoswagger-initialization.js
, see https://github.com/dapper91/python-openapi-ui-bundles/blob/master/openapi_ui_bundles/swagger_ui/vendor/index.html