dapper91 / pjrpc

python json-rpc client/server without boilerplate
https://pjrpc.readthedocs.io
The Unlicense
30 stars 3 forks source link

pjrpc incorrectly serves openapi-swagger-ui bundle #103

Closed antispam2002 closed 5 months ago

antispam2002 commented 6 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

dapper91 commented 6 months ago

@antispam2002 Hi,

That is a bug in python-openapi-us-bundle library. Fixed it in version 0.2.1.