Documentation ¶
Index ¶
Constants ¶
const ( OpenApiV2Source = "OpenApi2" OpenApiV3Source = "OpenApi3" )
const ( Implicit = "OAuth2Implicit" AuthorizationCode = "OAuth2AuthCode" Password = "OAuth2Password" ClientCredentials = "OAuth2ClientCredentials" BasicSecSchemaType = "http" ApiKeySecSchemaType = "apiKey" OAuth2SecSchemaType = "oauth2" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
Content content in a request example: ContentType could for example be 'application/json And Schema holds information about the content like its format (keys and types) and if it's nullable
type Endpoint ¶
type Endpoint struct { Path string Method string // POST, GET, etc. Body Body Parameters []Parameter Consumes string Produces string Responses []Response Summary string Description string }
Endpoint information about an endpoint inside an API
type OAuthFlow ¶
type OAuthFlow struct { GrantType string AuthorizationURL string TokenURL string RefreshURL string Scopes map[string]string }
OAuthFlow configuration for a OAuth flow https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#oauthFlowsObject
type Parameter ¶
type Parameter struct { Name string In string // body, header, etc. Required bool Description string ParamType string Schema Schema }
Parameter a parameter inside an endpoint
type Schema ¶
type Schema struct { Key string Type string Format string Nullable bool AllowEmpty bool Example any Properties []Schema }
Schema holds information about an object like a json object, xml object, html document, etc.
type SecuritySchema ¶
type SecuritySchema struct { Key string Type string Description string Name string In string BearerFormat string OpenIdConnectUrl string Flows []OAuthFlow }
SecuritySchema defines a security scheme https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object
type WebApiDescription ¶
type WebApiDescription struct { // DiscoverySource The source of the doc (OpenAPIv2, OpenAPIv3, etc.) DiscoverySource string // DiscoveryDoc literal URL of the discovery doc DiscoveryDoc url.URL // Version API version Version string Title string Description string Endpoints []Endpoint SecuritySchemes []SecuritySchema }
WebApiDescription description of a web API holds information about: - endpoints (requests, responses, parameters, etc.) - global information (URL, version, description, title, etc.) - how to authenticate with the API (security information)