Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ScriptSrcs to add extra scripts URLs to load #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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/swagger-ui-plugin-disable-try-it-out-without-servers@1.0.0/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/swagger-ui-plugin-disable-try-it-out-without-servers@1.0.0/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