Socket
Book a DemoInstallSign in
Socket

github.com/stephanhcb/go-autumn-web-swagger-ui

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/stephanhcb/go-autumn-web-swagger-ui

Source
Go
Version
v0.3.3
Version published
Created
Source

go-autumn-web-swagger-ui

IMPORTANT Third Party Licensing Information

The static files included under third_party/swagger_ui are

                      Copyright 2020-2021 SmartBear Software Inc.

They are licensed under

                             Apache License
                       Version 2.0, January 2004
                    http://www.apache.org/licenses/

See here for the full licensing information. This LICENSE file is also included with the static distribution provided by this module. If you use it as instructed, it will be statically served under /swagger-ui/LICENSE

Original download location:

https://github.com/swagger-api/swagger-ui

About go-autumn-web-swagger-ui

A library that provides a static go source file for the swagger-api/swagger-ui distributable ui module.

How to regenerate

  • update swagger ui files
  • update default url from 'https://petstore.swagger.io/v2/swagger.json' to '/v3/api-docs' in swagger-initializer.js
  • do not forget to retain LICENSE and README.txt
  • delete assets_vfsdata.go
  • rename the package to main in main.go
  • run main.go
  • change package back to auwebswaggerui in both main.go and generated file
  • capitalize var assets to Assets so it becomes exported

How to use

Simply import the module using go.mod.

The main.go file is really just here to re-generate the static source code, if swagger-ui has been updated.

auwebswaggerui.Assets is an instance of http.FileSystem, so you can do stuff like

  http.Handle("/swagger-ui/", http.FileServer(auwebswaggerui.Assets))

FAQs

Package last updated on 11 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts