scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.43k stars 226 forks source link

Can't find any html element in Custom javascript #271

Closed talatkuyuk closed 2 years ago

talatkuyuk commented 2 years ago

In the htmlTplString, there is a place for <% customJs %>. The custom javascript is placed in the html header, so I am not able to find any html element with querySelector, getElementById or getElementByClassName in the swagger ui with custom js.

I needed the <% customJs %> placed just after the <script src="./swagger-ui-init.js"> </script> and before the <% customCssUrl %> in the template. In that case I am able to find the html element whatever I want in the swagger ui. (I tested it.)

scottie1984 commented 2 years ago

Should be fixed now as part of https://github.com/scottie1984/swagger-ui-express/releases/tag/4.2.0