mrin9 / RapiPdf

PDF generation from OpenAPI / Swagger Spec
https://mrin9.github.io/RapiPdf
MIT License
282 stars 102 forks source link

TypeError: A.split is not a function #29

Closed StephenNay closed 5 years ago

StephenNay commented 5 years ago

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!

mrin9 commented 5 years ago

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

mrin9 commented 5 years ago

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 ?

mrin9 commented 5 years ago

This issue has been taken care of in release 2.1.0