Closed r2dliu closed 4 years ago
Hello @r2dliu ,
oatpp-swagger is intended to be cross-platform. If it doesn't work for you, it might be a bug. Also loadResources
function should not prepend anything as there is no code in it's implementation doing that.
How do you call loadResources
function?
Try to put the full path to installed swagger-ui resources.
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::swagger::Resources>, swaggerResources)([] {
// Make sure to specify correct full path to oatpp-swagger/res folder !!!
return oatpp::swagger::Resources::loadResources("<FULL-PATH-HERE>");
}());
Also, make sure that your application has access to the resource files.
Please let me know if it helped!
Regards, Leonid
I caught a mistake with my file path, it looks like it works as intended! Thanks for the response.
I'm building a cmake project on windows and loadResources appears to always append a forward slash, ie "C:...\res/favicon-16x16.png", resulting in a crash. Am I doing something wrong or was this not intended to be multiplatform?