Documentation
¶
Index ¶
- Constants
- func NewOpenAPI(c *catalog.Catalog) (oa *OpenAPI, err Error)
- type Components
- type ComponentsSchemas
- type Content
- type Error
- type HeaderObject
- type Info
- type MediaTypeObject
- type OpenAPI
- type Operation
- type ParameterBase
- type ParameterObject
- type PathItem
- type Paths
- type RequestBody
- type ResponseHeaders
- type ResponseObject
- type Responses
- type Server
Constants ¶
View Source
const ( MediaTypeRangeAny mediaType = "*/*" MediaTypeJson mediaType = "application/json" MediaTypeTextPlain mediaType = "text/plain" MediaTypeOctetStream mediaType = "application/octet-stream" // TODO: discuss )
JSIght 0.3 supports: "json", "plainString", "binary"
View Source
const ( ParameterLocationPath parameterLocation = "path" ParameterLocationQuery parameterLocation = "query" ParameterLocationHeader parameterLocation = "header" ParameterLocationCookie parameterLocation = "cookie" )
View Source
const ( ParameterStyleMatrix parameterStyle = "matrix" ParameterStyleLabel parameterStyle = "label" ParameterStyleForm parameterStyle = "form" ParameterStyleSimple parameterStyle = "simple" ParameterStyleDeepObject parameterStyle = "deepObject" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Components ¶
type Components struct {
Schemas ComponentsSchemas `json:"schemas,omitempty"`
}
type ComponentsSchemas ¶
type ComponentsSchemas map[string]schemaObject
type Content ¶
type Content map[mediaType]*MediaTypeObject
Content is used in Responses and Requests
type HeaderObject ¶
type HeaderObject struct {
ParameterBase
}
type MediaTypeObject ¶
type MediaTypeObject struct {
Schema schemaObject `json:"schema,omitempty"` // TODO: empty?
}
Other properties of OA MediaTypeObject are not used in JSigh
type OpenAPI ¶
type OpenAPI struct { OpenAPI string `json:"openapi"` Info *Info `json:"info"` Servers []Server `json:"servers,omitempty"` Paths Paths `json:"paths"` Components *Components `json:"components,omitempty"` // contains filtered or unexported fields }
type Operation ¶
type Operation struct { Summary string `json:"summary,omitempty"` Description string `json:"description,omitempty"` Parameters []*ParameterObject `json:"parameters,omitempty"` RequestBody *RequestBody `json:"requestBody,omitempty"` Responses *Responses `json:"responses"` Tags []string `json:"tags,omitempty"` OperationId *string `json:"operationId,omitempty"` }
type ParameterBase ¶
type ParameterBase struct { Description string `json:"description,omitempty"` Required bool `json:"required,omitempty"` Style parameterStyle `json:"style,omitempty"` Explode bool `json:"explode,omitempty"` Schema schemaObject `json:"schema"` }
Common fields for HeaderObject and ParameterObject In OAS Header Object is officially a subset of Parameter Object
type ParameterObject ¶
type ParameterObject struct { ParameterBase Name string `json:"name"` In parameterLocation `json:"in"` }
type RequestBody ¶
type ResponseHeaders ¶
type ResponseHeaders map[string]*HeaderObject
Only for Response objects. For request headers refer to "parameters"
type ResponseObject ¶
type ResponseObject struct { Description string `json:"description"` Headers ResponseHeaders `json:"headers,omitempty"` Content *Content `json:"content,omitempty"` }
type Responses ¶
type Responses map[responseCode]*ResponseObject
Source Files
¶
- components.go
- components_schemas.go
- content.go
- debug.go
- errors.go
- header_object.go
- info.go
- media_type.go
- media_type_object.go
- openapi.go
- operation.go
- parameter_base.go
- parameter_info.go
- parameter_location.go
- parameter_object.go
- parameter_style.go
- parameters.go
- path_item.go
- paths.go
- request_body.go
- response_headers.go
- response_object.go
- responses.go
- schema_core_client.go
- schema_object.go
- schema_object_any.go
- schema_object_any_of.go
- server.go
- strings.go
- tags.go
Click to show internal directories.
Click to hide internal directories.