rexyai / RestRserve

R web API framework for building high-performance microservices and app backends
https://restrserve.org
276 stars 32 forks source link

No default encoders for png and javascript files of the Swagger UI when 'use_cdn=FALSE' #164

Closed sambaala closed 3 years ago

sambaala commented 4 years ago

Hello,

When the parameter "use_cdn" of "Application$add_swagger_ui()" is FALSE, the Swagger UI does not display properly in my browser. Javascripts and images are not loaded, with the status code "500 Internal Server Error: can't encode body with content_type = 'image/png'". There are no content encoders for "application/javascript" and "image/png" by default, while the Swagger HTML page requests "favicon-32x32.png", "favicon-16x16.png", "swagger-ui-bundle.js" and "swagger-ui-standalone-preset.js" from the RestRserve assets.

I suggest in a following pull request, to add default encoders for "application/javascript" and "image/png". I also add some unit tests for them.

Best regards,

dselivanov commented 3 years ago

fixed in #165