You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently these configs just replace the previous script, example:
r.Get("/swagger/*", httpSwagger.Handler(
httpSwagger.BeforeScript("console.log('before 1')"),
httpSwagger.BeforeScript("console.log('before 2')"),
httpSwagger.URL("http://localhost:1323/swagger/doc.json"), //The url pointing to API definition
))
// Only 'before 2' is printed
It makes hard to add multiple configuration scripts by forcing joing strings.
The text was updated successfully, but these errors were encountered:
Zhomart
added a commit
to Zhomart/http-swagger
that referenced
this issue
Jan 13, 2023
Summary:
Previsouly this code would allow only a single script to run:
```
r.Get("/swagger/*", httpSwagger.Handler(
httpSwagger.BeforeScript("console.log('before 1')"),
httpSwagger.BeforeScript("console.log('before 2')"),
httpSwagger.URL("http://localhost:1323/swagger/doc.json"), //The url pointing to API definition
))
// Only 'before 2' will be printed
```
Now both scripts are run:
```
'before 1'
'before 2'
```
This improves behavior of BeforeScript and AfterScript. If users
want to provide multiple scripts, they are forced to combine them using
strings.
Closesswaggo#81
Test Plan: Updated existing example and tests. Added new test TestMultipleScripts
Currently these configs just replace the previous script, example:
It makes hard to add multiple configuration scripts by forcing joing strings.
The text was updated successfully, but these errors were encountered: