Discover Packages
github.com/apimgr/search
src
swagger
package
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Feb 3, 2026
License: Apache-2.0, BSD-3-Clause, MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Handler serves the Swagger UI and OpenAPI spec
type Components struct {
Schemas map[string ]Schema `json:"schemas,omitempty"`
}
type Contact struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Email string `json:"email,omitempty"`
}
type Info struct {
Title string `json:"title"`
Description string `json:"description"`
Version string `json:"version"`
Contact *Contact `json:"contact,omitempty"`
}
type MediaType struct {
Schema *Schema `json:"schema,omitempty"`
}
type OpenAPISpec struct {
OpenAPI string `json:"openapi"`
Info Info `json:"info"`
Servers []Server `json:"servers"`
Paths map[string ]PathItem `json:"paths"`
Components Components `json:"components,omitempty"`
}
OpenAPISpec represents the OpenAPI 3.0 specification
GenerateSpec generates the OpenAPI specification for the search API
type Operation struct {
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
RequestBody *RequestBody `json:"requestBody,omitempty"`
Responses map[string ]Response `json:"responses"`
}
type Parameter struct {
Name string `json:"name"`
In string `json:"in"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Schema *Schema `json:"schema,omitempty"`
}
type PathItem struct {
Get *Operation `json:"get,omitempty"`
Post *Operation `json:"post,omitempty"`
Put *Operation `json:"put,omitempty"`
Delete *Operation `json:"delete,omitempty"`
Patch *Operation `json:"patch,omitempty"`
}
type RequestBody struct {
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Content map[string ]MediaType `json:"content"`
}
type Response struct {
Description string `json:"description"`
Content map[string ]MediaType `json:"content,omitempty"`
}
type Schema struct {
Type string `json:"type,omitempty"`
Properties map[string ]Schema `json:"properties,omitempty"`
Items *Schema `json:"items,omitempty"`
Example interface{} `json:"example,omitempty"`
}
type Server struct {
URL string `json:"url"`
Description string `json:"description,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.