Documentation
¶
Index ¶
- Constants
- Variables
- func Use()
- type DiscoveryCustomizerDIOut
- type OAS2
- type OAS2Info
- type OAS3
- type OAS3Info
- type OAS3Server
- type OASDocLoader
- type OASVersion
- type OpenApiSpec
- type ParamMeta
- type ParameterProperties
- type Resource
- type SsoConfiguration
- type SwaggerController
- type SwaggerProperties
- type SwaggerSecurityProperties
- type SwaggerSsoProperties
- type SwaggerUIProperties
- type UiConfiguration
Constants ¶
View Source
const ( OASv2 = "2.0" OASv30 = "3.0.0" OASv31 = "3.1.0" )
View Source
const SwaggerPrefix = "swagger"
View Source
const (
TagSwaggerPath = "swaggerPath"
)
Variables ¶
View Source
var Content embed.FS
View Source
var Module = &bootstrap.Module{ Name: "swagger", Precedence: bootstrap.SwaggerPrecedence, PriorityOptions: []fx.Option{ fx.Invoke(configureSecurity), }, Options: []fx.Option{ appconfig.FxEmbeddedDefaults(defaultConfigFS), fx.Provide( bindSwaggerProperties, fx.Annotate(newSwaggerInfoDiscoveryCustomizer, fx.ResultTags(fmt.Sprintf(`group:"%s"`, discovery.FxGroup))), ), fx.Invoke(initialize), }, }
Functions ¶
Types ¶
type DiscoveryCustomizerDIOut ¶
type DiscoveryCustomizerDIOut struct { fx.Out Customizer discovery.ServiceRegistrationCustomizer `group:"discovery_customizer"` }
type OAS2 ¶
type OAS2 struct { OpenAPIVersion string `json:"swagger"` Info OAS2Info `json:"info"` Host string `json:"host,omitempty"` BasePath string `json:"basePath,omitempty"` Schemes []string `json:"schemes,omitempty"` Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` Paths map[string]interface{} `json:"paths,omitempty"` Definitions map[string]interface{} `json:"definitions,omitempty"` Parameters map[string]interface{} `json:"parameters,omitempty"` Responses map[string]interface{} `json:"responses,omitempty"` SecDefs map[string]interface{} `json:"securityDefinitions,omitempty"` Security []interface{} `json:"security,omitempty"` Tags []interface{} `json:"tags,omitempty"` ExtDocs map[string]interface{} `json:"externalDocs,omitempty"` }
OAS2 is Swagger 2.0 Specification https://swagger.io/docs/specification/2-0/basic-structure/ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
type OAS2Info ¶
type OAS2Info struct { Title string `json:"title"` Description string `json:"description,omitempty"` TermsOfService string `json:"termsOfService,omitempty"` Contact map[string]interface{} `json:"contact,omitempty"` License map[string]interface{} `json:"license,omitempty"` Version string `json:"version,omitempty"` }
type OAS3 ¶
type OAS3 struct { OpenAPIVersion string `json:"openapi"` Info OAS3Info `json:"info"` JsonDialect string `json:"jsonSchemaDialect,omitempty"` Servers []OAS3Server `json:"servers,omitempty"` Paths map[string]interface{} `json:"paths,omitempty"` WebHooks map[string]interface{} `json:"webhooks,omitempty"` Components map[string]interface{} `json:"components,omitempty"` Security []interface{} `json:"security,omitempty"` Tags []interface{} `json:"tags,omitempty"` ExtDocs map[string]interface{} `json:"externalDocs,omitempty"` }
OAS3 is Swagger 3.0 Specification https://swagger.io/docs/specification/basic-structure/ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema
type OAS3Info ¶
type OAS3Info struct { Title string `json:"title"` Summary string `json:"summary,omitempty"` Description string `json:"description,omitempty"` TermsOfService string `json:"termsOfService,omitempty"` Contact map[string]interface{} `json:"contact,omitempty"` License map[string]interface{} `json:"license,omitempty"` Version string `json:"version,omitempty"` }
type OAS3Server ¶
type OASDocLoader ¶
type OASDocLoader struct {
// contains filtered or unexported fields
}
func (OASDocLoader) Load ¶
func (l OASDocLoader) Load() (*OpenApiSpec, error)
type OASVersion ¶
type OASVersion string
type OpenApiSpec ¶
type OpenApiSpec struct { Version OASVersion `json:"Version"` OAS2 *OAS2 `json:"OAS2"` OAS3 *OAS3 `json:"OAS3"` }
func (*OpenApiSpec) UnmarshalJSON ¶
func (s *OpenApiSpec) UnmarshalJSON(data []byte) error
type ParameterProperties ¶
type SsoConfiguration ¶
type SwaggerController ¶
type SwaggerController struct {
// contains filtered or unexported fields
}
func NewSwaggerController ¶
func NewSwaggerController(props SwaggerProperties, resolver bootstrap.BuildInfoResolver) *SwaggerController
func (*SwaggerController) Mappings ¶
func (c *SwaggerController) Mappings() []web.Mapping
type SwaggerProperties ¶
type SwaggerProperties struct { BasePath string `json:"base-path"` Spec string `json:"spec"` Security SwaggerSecurityProperties `json:"security"` UI SwaggerUIProperties `json:"ui"` }
func NewSwaggerSsoProperties ¶
func NewSwaggerSsoProperties() *SwaggerProperties
type SwaggerSecurityProperties ¶
type SwaggerSecurityProperties struct { SecureDocs bool `json:"secure-docs"` Sso SwaggerSsoProperties `json:"sso"` }
type SwaggerSsoProperties ¶
type SwaggerSsoProperties struct { BaseUrl string `json:"base-url"` TokenPath string `json:"token-path"` AuthorizePath string `json:"authorize-path"` ClientId string `json:"client-id"` ClientSecret string `json:"client-secret"` AdditionalParams []ParameterProperties `json:"additional-params" binding:"omitempty"` }
type SwaggerUIProperties ¶
type SwaggerUIProperties struct {
Title string `json:"title"`
}
type UiConfiguration ¶
type UiConfiguration struct { ApisSorter string `json:"apisSorter"` DeepLinking bool `json:"deepLinking"` DefaultModelExpandDepth int `json:"defaultModelExpandDepth"` DefaultModelRendering string `json:"defaultModelRendering"` DefaultModelsExpandDepth int `json:"defaultModelsExpandDepth"` DisplayOperationId bool `json:"displayOperationId"` DisplayRequestDuration bool `json:"displayRequestDuration"` DocExpansion string `json:"docExpansion"` Filter bool `json:"filter"` JsonEditor bool `json:"jsonEditor"` OperationsSorter string `json:"operationsSorter"` ShowExtensions bool `json:"showExtensions"` ShowRequestHeaders bool `json:"showRequestHeaders"` SupportedSubmitMethods []string `json:"supportedSubmitMethods"` TagsSorter string `json:"tagsSorter"` ValidatorUrl string `json:"validatorUrl"` Title string `json:"title"` }
Click to show internal directories.
Click to hide internal directories.