mrin9 / RapiPdf

PDF generation from OpenAPI / Swagger Spec

Home Page:https://mrin9.github.io/RapiPdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: A.split is not a function

StephenNay opened this issue · comments

I copied the example HTML file and pasted my JSON into it to try RapiPdf on my machine. I got this error in the console:

Uncaught (in promise) TypeError: A.split is not a function

That pointed to this code in the (formatted) rapipdf-min.js, starting at line 64329:

            a.servers && a.servers.map(t=>{
                if (t.url && "/" === t.url.substr(0, 1)) {
                    var e = A.split("/");
                    t.url = "".concat(e[0], "//").concat(e[2]).concat(t.url)
                }
            }
           ),

I changed the third line to this:

var e = u.split("/");

The error went away and the PDF file was generated. I'm a technical writer, and not good enough with JavaScript to be confident that I would be fixing the right thing in the source files, so I'm opening this issue instead of fixing it and creating a pull request. I don't even know if my change was the right thing to do, but it didn't work before and now it does.

Thanks for the great tool!

thank you for letting us know about it, and taking time to point out the source of this issue. will deliver a fix soon

will it be possible for you to provide a sample spec, that I can try to ensure if all the things are taken care of ?

This issue has been taken care of in release 2.1.0