Skip to content

Conversation

@Zhomart
Copy link

@Zhomart Zhomart commented Jan 13, 2023

Add ScriptSrcs to add extra scripts URLs to load

Summary: This allows importing plugins from local and external hosts.

	r.Get("/swagger/*", httpSwagger.Handler(
		httpSwagger.ScriptSrc("/static/swagger-helper.js"),
		httpSwagger.ScriptSrc("https://unpkg.com/[email protected]/build/index.js"),
		httpSwagger.Plugins([]string{"DisableTryItOutWithoutServersPlugin"},
		httpSwagger.URL("http://localhost:1323/swagger/doc.json"), //The url pointing to API definition
	))

Closes #83

Test Plan: Updated existing tests. Added example in example/go-chi/


Stack created with Sapling. Best reviewed with ReviewStack.

@Zhomart Zhomart changed the title placeholder for pull request Add ScriptSrcs to add extra scripts URLs to load Jan 13, 2023
Summary: This allows importing plugins from local and external hosts.

```
	r.Get("/swagger/*", httpSwagger.Handler(
		httpSwagger.ScriptSrc("/static/swagger-helper.js"),
		httpSwagger.ScriptSrc("https://unpkg.com/[email protected]/build/index.js"),
		httpSwagger.Plugins([]string{"DisableTryItOutWithoutServersPlugin"},
		httpSwagger.URL("http://localhost:1323/swagger/doc.json"), //The url pointing to API definition
	))
```

Closes swaggo#83

Test Plan: Updated existing tests. Added example in example/go-chi/
@Zhomart Zhomart marked this pull request as ready for review January 13, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow adding external scripts to the index.html

1 participant